Sha256: e5614fcff076776c3ca5ce32628d2cf144af66aa165f64c068efeb764d73ba2a

Contents?: true

Size: 1.92 KB

Versions: 11

Compression:

Stored size: 1.92 KB

Contents

require 'spec_helper_acceptance'

case fact('osfamily')
when 'RedHat'
  servicename = 'httpd'
when 'Debian'
  servicename = 'apache2'
when 'FreeBSD'
  servicename = 'apache22'
else
  raise "Unconfigured OS for apache service on #{fact('osfamily')}"
end

case fact('osfamily')
when 'FreeBSD'
  describe 'apache::mod::event class' do
    describe 'running puppet code' do
      # Using puppet_apply as a helper
      it 'should work with no errors' do
        pp = <<-EOS
          class { 'apache':
            mpm_module => 'event',
          }
        EOS

        # Run it twice and test for idempotency
        apply_manifest(pp, :catch_failures => true)
        expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
      end
    end

    describe service(servicename) do
      it { should be_running }
      it { should be_enabled }
    end
  end
end

describe 'apache::mod::worker class' do
  describe 'running puppet code' do
    # Using puppet_apply as a helper
    it 'should work with no errors' do
      pp = <<-EOS
        class { 'apache':
          mpm_module => 'worker',
        }
      EOS

      # Run it twice and test for idempotency
      apply_manifest(pp, :catch_failures => true)
      expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
    end
  end

  describe service(servicename) do
    it { should be_running }
    it { should be_enabled }
  end
end

describe 'apache::mod::prefork class' do
  describe 'running puppet code' do
    # Using puppet_apply as a helper
    it 'should work with no errors' do
      pp = <<-EOS
        class { 'apache':
          mpm_module => 'prefork',
        }
      EOS

      # Run it twice and test for idempotency
      apply_manifest(pp, :catch_failures => true)
      expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
    end
  end

  describe service(servicename) do
    it { should be_running }
    it { should be_enabled }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.6.0 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.5.2 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.5.1 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.5.0 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.4.1 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.4.0 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.3.3 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.3.2 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.3.1 modules/apache/spec/acceptance/prefork_worker_spec.rb
freighthop-0.3.0 modules/apache/spec/acceptance/prefork_worker_spec.rb