<commit_before># A Groovy library based on JUnit and Groovy SSH DSL for verifying results of Puppet modules.

## Overview

## Usage

## Credits 

<commit_msg>added basic documentation<commit_after># puppet-unit 

## Overview

A **Groovy** library (based on **JUnit** - https://github.com/junit-team/junit, and **Groovy SSH DSL** - 
https://github.com/aestasit/groovy-ssh-dsl) for creating integration tests of **Puppet** modules.

The **puppet-unit** is designed to work with some virtualization or cloud solutions, which allow starting testable 
server instances on-demand. 

**Aestas/IT** is usually using **puppet-unit** together with **Gramazon** (https://github.com/aestasit/gramazon) - 
a **Groovy** library and **Gradle** plugin for working with **Amazon EC2** instances.  

## Quick example

The following code show an integration test for simple JDBC driver installation module:

    class JdbcInstallTest extends BasePuppetIntegrationTest {
          
      @Test
      def void verifyMySqlDriverIsDownloaded() {
        
        apply("""
          jdbc::install { 'mysql':
            media_library_host => '$mediaLibraryHost' 
          }
        """)
    
        assertTrue directoryExists("/opt/jdbc")
        assertTrue fileExists("/opt/jdbc/mysql-connector-5.1.23-generic-noarch.jar")
        
      }
    
      @Test
      def void verifyDerbyDriverIsDownloaded() {
        
        apply("""
          jdbc::install { 'derby':
            media_library_host => '$mediaLibraryHost' 
          }
        """)
    
        assertTrue directoryExists("/opt/jdbc")
        assertTrue fileExists("/opt/jdbc/derby-driver-10.9.1.0-generic-noarch.jar")
        
      }
            
      @BeforeClass
      def static void installTools() {
        command('yum -y -q install tree')
      }
    
      @Before
      def void cleanUp() {
        println "Removing installation directories:"
        command('rm -rf /opt/jdbc')
      }
    
      @After
      def void debug() {
        println "Checking directory content:"
        command('tree -ad /opt/jdbc')
      }
      
    }

{'fraction_non_alphanumeric': 0.11270296084049666, 'fraction_numerical': 0.004775549188156638, 'mean_word_length': 2.314873417721519, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1904956', 'n_tokens_mistral': 633, 'n_tokens_neox': 594, 'n_words': 161}