Sha256: c469de7ec66f2ea91c9ff8bc7c0461399ed96a7e0fbf74cf42de20f354752bf8

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper_system'

describe 'apt::key' do

  context 'reset' do
    it 'clean up keys' do
      shell('apt-key del 4BD6EC30')
      shell('apt-key del D50582E6')
    end
  end

  context 'apt::key' do
    it 'should work with no errors' do
      pp = <<-EOS
      include '::apt'
      apt::key { 'puppetlabs':
        key        => '4BD6EC30',
        key_server => 'pgp.mit.edu',
      }

      apt::key { 'jenkins':
        key        => 'D50582E6',
        key_source => 'http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key',
      }
      EOS

      puppet_apply(pp) do |r|
        r.exit_code.should_not == 1
      end
    end

    describe 'keys should exist' do
      it 'finds puppetlabs key' do
        shell('apt-key list | grep 4BD6EC30') do |r|
          r.exit_code.should be_zero
        end
      end
      it 'finds jenkins key' do
        shell('apt-key list | grep D50582E6') do |r|
          r.exit_code.should be_zero
        end
      end
    end
  end

  context 'reset' do
    it 'clean up keys' do
      shell('apt-key del 4BD6EC30')
      shell('apt-key del D50582E6')
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
freighthop-0.3.3 modules/apt/spec/system/apt_key_spec.rb
freighthop-0.3.2 modules/apt/spec/system/apt_key_spec.rb
freighthop-0.3.1 modules/apt/spec/system/apt_key_spec.rb
freighthop-0.3.0 modules/apt/spec/system/apt_key_spec.rb
freighthop-0.2.1 modules/apt/spec/system/apt_key_spec.rb
freighthop-0.2.0 modules/apt/spec/system/apt_key_spec.rb
freighthop-0.1.0 modules/apt/spec/system/apt_key_spec.rb