apt_key_spec.rb
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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