<commit_before>require sprintf('%s/../../path_helper', File.dirname(File.expand_path(__FILE__)))

require 'rouster'
require 'rouster/puppet'
require 'rouster/testing'

require 'test/unit'

class TestPuppetRoles < Test::Unit::TestCase

  def setup
    @ppm = Rouster.new(:name => 'ppm', :vagrantfile => sprintf('%s/../../../piab/Vagrantfile', File.dirname(File.expand_path(__FILE__))))
    @ppm.rebuild() unless @ppm.status.eql?('running') # destroy / rebuild

    @app = Rouster.new(:name => 'app', :vagrantfile => '../piab/Vagrantfile')

    assert_nothing_raised do
		  @ppm.run_puppet('master', { :expected_exitcode => [0,2] })
    end

    assert_match(/Finished catalog run in/, @ppm.get_output())

    # define base here
    @expected_packages = {
      'puppet' => { :ensure => true },
      'facter' => { :ensure => 'present' }
    }

    @expected_files = {
      '/etc/passwd' => {
        :contains => [ 'vagrant', 'root'],
        :ensure   => 'file',
        :group    => 'root',
        :mode     => '0644',
        :owner    => 'root'
      },

      '/tmp' => {
        :ensure => 'directory',
        :group  => 'root',
        :owner  => 'root',<commit_msg>skipping tests that require SFDC'c PIAB project<commit_after>require sprintf('%s/../../path_helper', File.dirname(File.expand_path(__FILE__)))

require 'rouster'
require 'rouster/puppet'
require 'rouster/testing'

require 'test/unit'

class TestPuppetRoles < Test::Unit::TestCase

  def setup

    piab_vagrantfile = sprintf('%s/../../../piab/Vagrantfile', File.dirname(File.expand_path(__FILE__)))

    unless File.file?(piab_vagrantfile)
      skip(sprintf('missing SFDC specific Vagrantfile[%s], skipping', piab_vagrantfile))
    end

    assert_nothing_raised do
      @ppm = Rouster.new(:name => 'ppm', :vagrantfile => piab_vagrantfile)
      @ppm.up()
      @ppm.remove_existing_certs('ppm')
      #@ppm.rebuild() unless @ppm.status.eql?('running') # destroy / rebuild
    end

    assert_nothing_raised do
      @app = Rouster.new(:name => 'app', :vagrantfile => piab_vagrantfile)
    end

    assert_nothing_raised do
		  @ppm.run_puppet('master', { :expected_exitcode => [0,2] })
    end

    assert_match(/Finished catalog run in/, @ppm.get_output())

    # define base here
    @expected_packages = {
      'puppet' => { :ensure => true },
      'facter' => { :ensure => 'present' }
    }

    @expected_files = {
      '/etc/passwd' => {
        :contains => [ 'vagrant', 'root'],
        :ensure   => 'file',
        :group    => 'root',
        :mode     => '0644',
        :owner    => 'root'
      },

      '/tmp' => {
        :ensure => 'directory',
        :group  => 'root',
        :owner  => 'root',
{'fraction_non_alphanumeric': 0.17804154302670624, 'fraction_numerical': 0.004451038575667656, 'mean_word_length': 2.7615062761506275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '741903', 'n_tokens_mistral': 958, 'n_tokens_neox': 912, 'n_words': 170}