beaker-puppet 1.29.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +28 -7
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +842 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +5 -20
- data/Rakefile +64 -169
- data/acceptance/config/acceptance-options.rb +3 -3
- data/acceptance/config/gem/acceptance-options.rb +8 -8
- data/acceptance/config/git/acceptance-options.rb +8 -8
- data/acceptance/config/pkg/acceptance-options.rb +7 -7
- data/acceptance/pre_suite/gem/install.rb +6 -6
- data/acceptance/pre_suite/git/install.rb +22 -22
- data/acceptance/pre_suite/pkg/install.rb +3 -3
- data/acceptance/tests/backwards_compatible.rb +6 -7
- data/acceptance/tests/clone_git_repo_on_test.rb +12 -13
- data/acceptance/tests/create_tmpdir_on_test.rb +13 -9
- data/acceptance/tests/install_smoke_test.rb +5 -4
- data/acceptance/tests/stub_host.rb +11 -10
- data/acceptance/tests/web_helpers_test.rb +11 -10
- data/beaker-puppet.gemspec +16 -23
- data/bin/beaker-puppet +2 -4
- data/lib/beaker-puppet/helpers/facter_helpers.rb +9 -7
- data/lib/beaker-puppet/helpers/host_helpers.rb +10 -7
- data/lib/beaker-puppet/helpers/puppet_helpers.rb +151 -160
- data/lib/beaker-puppet/helpers/rake_helpers.rb +1 -1
- data/lib/beaker-puppet/helpers/tk_helpers.rb +22 -28
- data/lib/beaker-puppet/install_utils/aio_defaults.rb +39 -43
- data/lib/beaker-puppet/install_utils/ezbake_utils.rb +34 -42
- data/lib/beaker-puppet/install_utils/foss_defaults.rb +134 -138
- data/lib/beaker-puppet/install_utils/foss_utils.rb +293 -320
- data/lib/beaker-puppet/install_utils/module_utils.rb +58 -70
- data/lib/beaker-puppet/install_utils/puppet5.rb +30 -35
- data/lib/beaker-puppet/install_utils/puppet_utils.rb +58 -68
- data/lib/beaker-puppet/install_utils/windows_utils.rb +34 -36
- data/lib/beaker-puppet/version.rb +1 -1
- data/lib/beaker-puppet/wrappers.rb +13 -14
- data/lib/beaker-puppet.rb +4 -5
- data/setup/aio/010_Install_Puppet_Agent.rb +5 -6
- data/setup/common/000-delete-puppet-when-none.rb +2 -4
- data/setup/common/003_solaris_cert_fix.rb +74 -70
- data/setup/common/005_redhat_subscription_fix.rb +3 -2
- data/setup/common/011_Install_Puppet_Server.rb +7 -9
- data/setup/common/012_Finalize_Installs.rb +5 -5
- data/setup/common/025_StopFirewall.rb +1 -1
- data/setup/common/030_StopSssd.rb +2 -2
- data/setup/common/040_ValidateSignCert.rb +10 -12
- data/setup/common/045_EnsureMasterStarted.rb +2 -2
- data/setup/gem/010_GemInstall.rb +5 -4
- data/setup/git/000_EnvSetup.rb +48 -48
- data/setup/git/010_TestSetup.rb +13 -12
- data/setup/git/020_PuppetUserAndGroup.rb +3 -2
- data/setup/git/060_InstallModules.rb +14 -14
- data/setup/git/070_InstallCACerts.rb +82 -82
- data/spec/beaker-puppet/helpers/facter_helpers_spec.rb +22 -24
- data/spec/beaker-puppet/helpers/host_helpers_spec.rb +10 -6
- data/spec/beaker-puppet/helpers/puppet_helpers_spec.rb +506 -517
- data/spec/beaker-puppet/helpers/tk_helpers_spec.rb +20 -24
- data/spec/beaker-puppet/install_utils/ezbake_utils_spec.rb +86 -90
- data/spec/beaker-puppet/install_utils/foss_utils_spec.rb +636 -599
- data/spec/beaker-puppet/install_utils/module_utils_spec.rb +125 -116
- data/spec/beaker-puppet/install_utils/puppet5_spec.rb +159 -165
- data/spec/beaker-puppet/install_utils/puppet_utils_spec.rb +92 -77
- data/spec/beaker-puppet/install_utils/windows_utils_spec.rb +101 -89
- data/spec/beaker-puppet/wrappers_spec.rb +10 -10
- data/spec/helpers.rb +85 -91
- data/tasks/ci.rake +171 -179
- metadata +33 -62
- data/setup/common/020_InstallCumulusModules.rb +0 -13
- data/setup/common/021_InstallAristaModuleMasters.rb +0 -12
- data/setup/common/022_InstallAristaModuleAgents.rb +0 -13
@@ -5,22 +5,23 @@ require 'pathname'
|
|
5
5
|
class PuppetModules
|
6
6
|
attr_reader :modules
|
7
7
|
|
8
|
-
def initialize(modules=[])
|
8
|
+
def initialize(modules = [])
|
9
9
|
@modules = modules
|
10
10
|
end
|
11
11
|
|
12
12
|
def list
|
13
13
|
return [] unless modules
|
14
|
+
|
14
15
|
modules.collect do |uri|
|
15
16
|
git_url, git_ref = uri.split '#'
|
16
17
|
folder = Pathname.new(git_url).basename('.git')
|
17
18
|
name = folder.to_s.split('-', 2)[1] || folder.to_s
|
18
19
|
{
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
20
|
+
name: name,
|
21
|
+
url: git_url,
|
22
|
+
folder: folder.to_s,
|
23
|
+
ref: git_ref,
|
24
|
+
protocol: git_url.split(':')[0].intern,
|
24
25
|
}
|
25
26
|
end
|
26
27
|
end
|
@@ -31,7 +32,7 @@ def install_git_module(mod, hosts)
|
|
31
32
|
# temporary directory to this location. This will preserve the global
|
32
33
|
# state of the system while allowing individual test cases to quickly run
|
33
34
|
# with a module "installed" in the module path.
|
34
|
-
moddir =
|
35
|
+
moddir = '/opt/puppet-git-repos'
|
35
36
|
target = "#{moddir}/#{mod[:name]}"
|
36
37
|
|
37
38
|
step "Clone #{mod[:url]} if needed"
|
@@ -40,19 +41,18 @@ def install_git_module(mod, hosts)
|
|
40
41
|
step "Update #{mod[:name]} and check out revision #{mod[:ref]}"
|
41
42
|
|
42
43
|
commands = ["cd #{target}",
|
43
|
-
|
44
|
+
'remote rm origin',
|
44
45
|
"remote add origin #{mod[:url]}",
|
45
|
-
|
46
|
+
'fetch origin',
|
46
47
|
"checkout -f #{mod[:ref]}",
|
47
48
|
"reset --hard refs/remotes/origin/#{mod[:ref]}",
|
48
|
-
|
49
|
-
]
|
49
|
+
'clean -fdx',]
|
50
50
|
|
51
|
-
on hosts, commands.join(
|
51
|
+
on hosts, commands.join(' && git ')
|
52
52
|
end
|
53
53
|
|
54
54
|
def install_scp_module(mod, hosts)
|
55
|
-
moddir =
|
55
|
+
moddir = '/opt/puppet-git-repos'
|
56
56
|
target = "#{moddir}/#{mod[:name]}"
|
57
57
|
|
58
58
|
step "Purge #{target} if needed"
|
@@ -68,7 +68,7 @@ skip_test 'not testing with puppetserver' unless @options['is_puppetserver']
|
|
68
68
|
|
69
69
|
modules = PuppetModules.new(options[:modules]).list
|
70
70
|
|
71
|
-
step
|
71
|
+
step 'Masters: Install Puppet Modules'
|
72
72
|
masters = hosts.select { |host| host['roles'].include? 'master' }
|
73
73
|
|
74
74
|
modules.each do |mod|
|
@@ -1,95 +1,95 @@
|
|
1
|
-
test_name
|
2
|
-
confine :to, :
|
1
|
+
test_name 'Install CA Certs'
|
2
|
+
confine :to, platform: 'windows'
|
3
3
|
|
4
|
-
GEOTRUST_GLOBAL_CA =
|
5
|
-
-----BEGIN CERTIFICATE-----
|
6
|
-
MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
|
7
|
-
MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
|
8
|
-
YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG
|
9
|
-
EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg
|
10
|
-
R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9
|
11
|
-
9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq
|
12
|
-
fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv
|
13
|
-
iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lV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['use_existing_container']
|
80
80
|
|
81
|
-
step
|
82
|
-
create_remote_file(host,
|
83
|
-
on host,
|
84
|
-
on host,
|
81
|
+
step 'Installing Geotrust CA cert'
|
82
|
+
create_remote_file(host, 'geotrustglobal.pem', GEOTRUST_GLOBAL_CA)
|
83
|
+
on host, 'chmod 644 geotrustglobal.pem'
|
84
|
+
on host, 'cmd /c certutil -v -addstore Root `cygpath -w geotrustglobal.pem`'
|
85
85
|
|
86
|
-
step
|
87
|
-
create_remote_file(host,
|
88
|
-
on host,
|
89
|
-
on host,
|
86
|
+
step 'Installing Usertrust Network CA cert'
|
87
|
+
create_remote_file(host, 'usertrust-network.pem', USERTRUST_NETWORK_CA)
|
88
|
+
on host, 'chmod 644 usertrust-network.pem'
|
89
|
+
on host, 'cmd /c certutil -v -addstore Root `cygpath -w usertrust-network.pem`'
|
90
90
|
|
91
|
-
step
|
92
|
-
create_remote_file(host,
|
93
|
-
on host,
|
94
|
-
on host,
|
91
|
+
step 'Installing Equifax CA cert'
|
92
|
+
create_remote_file(host, 'equifax.pem', EQUIFAX_CA)
|
93
|
+
on host, 'chmod 644 equifax.pem'
|
94
|
+
on host, 'cmd /c certutil -v -addstore Root `cygpath -w equifax.pem`'
|
95
95
|
end
|
@@ -12,32 +12,31 @@ class ClassMixedWithDSLHelpers
|
|
12
12
|
def logger
|
13
13
|
RSpec::Mocks::Double.new('logger').as_null_object
|
14
14
|
end
|
15
|
-
|
16
15
|
end
|
17
16
|
|
18
17
|
describe ClassMixedWithDSLHelpers do
|
19
|
-
let(
|
20
|
-
let(
|
21
|
-
let(
|
18
|
+
let(:command) { 'ls' }
|
19
|
+
let(:host) { double.as_null_object }
|
20
|
+
let(:result) { Beaker::Result.new(host, command) }
|
22
21
|
|
23
|
-
let(
|
24
|
-
let(
|
25
|
-
let(
|
26
|
-
let(
|
27
|
-
let(
|
28
|
-
let(
|
22
|
+
let(:master) { make_host('master', roles: %w[master agent default]) }
|
23
|
+
let(:agent) { make_host('agent', roles: %w[agent]) }
|
24
|
+
let(:custom) { make_host('custom', roles: %w[custom agent]) }
|
25
|
+
let(:dash) { make_host('console', roles: %w[dashboard agent]) }
|
26
|
+
let(:db) { make_host('db', roles: %w[database agent]) }
|
27
|
+
let(:hosts) { [master, agent, dash, db, custom] }
|
29
28
|
|
30
29
|
before :each do
|
31
|
-
allow(
|
30
|
+
allow(subject).to receive(:hosts).and_return(hosts)
|
32
31
|
end
|
33
32
|
|
34
33
|
describe '#fact_on' do
|
35
34
|
it 'retrieves a fact on a single host' do
|
36
35
|
result.stdout = "{\"osfamily\": \"family\"}\n"
|
37
|
-
expect(
|
38
|
-
expect(
|
36
|
+
expect(subject).to receive(:facter).with('"osfamily"', { json: nil }).once
|
37
|
+
expect(subject).to receive(:on).and_return(result)
|
39
38
|
|
40
|
-
expect(
|
39
|
+
expect(subject.fact_on('host', 'osfamily')).to be === JSON.parse(result.stdout)['osfamily']
|
41
40
|
end
|
42
41
|
|
43
42
|
it 'converts each element to a structured fact when it receives an array of results from #on' do
|
@@ -45,23 +44,23 @@ describe ClassMixedWithDSLHelpers do
|
|
45
44
|
times = hosts.length
|
46
45
|
results_array = [result] * times
|
47
46
|
parsed_array = [JSON.parse(result.stdout)['os']] * times
|
48
|
-
allow(
|
47
|
+
allow(subject).to receive(:on).and_return(results_array)
|
49
48
|
|
50
|
-
expect(
|
49
|
+
expect(subject.fact_on(hosts, 'os')).to be === parsed_array
|
51
50
|
end
|
52
51
|
|
53
52
|
it 'returns a single result for single host' do
|
54
53
|
result.stdout = "{\"osfamily\": \"family\"}\n"
|
55
54
|
parsed_result = JSON.parse(result.stdout)['osfamily']
|
56
|
-
allow(
|
55
|
+
allow(subject).to receive(:on).and_return(result)
|
57
56
|
|
58
|
-
expect(
|
57
|
+
expect(subject.fact_on('host', 'osfamily')).to be === parsed_result
|
59
58
|
end
|
60
59
|
|
61
60
|
it 'preserves data types' do
|
62
|
-
result.stdout =
|
63
|
-
allow(
|
64
|
-
structured_fact = subject.fact_on('host','identity')
|
61
|
+
result.stdout = '{"identity": { "uid": 0, "user": "root", "privileged": true }}'
|
62
|
+
allow(subject).to receive(:on).and_return(result)
|
63
|
+
structured_fact = subject.fact_on('host', 'identity')
|
65
64
|
|
66
65
|
expect(structured_fact['uid'].class).to be Fixnum
|
67
66
|
expect(structured_fact['user'].class).to be String
|
@@ -76,11 +75,10 @@ describe ClassMixedWithDSLHelpers do
|
|
76
75
|
|
77
76
|
describe '#fact' do
|
78
77
|
it 'delegates to #fact_on with the default host' do
|
79
|
-
expect(
|
80
|
-
expect(
|
78
|
+
expect(subject).to receive(:fact_on).with(anything, 'osfamily', {}).once
|
79
|
+
expect(subject).to receive(:default)
|
81
80
|
|
82
81
|
subject.fact('osfamily')
|
83
82
|
end
|
84
83
|
end
|
85
|
-
|
86
84
|
end
|
@@ -8,9 +8,11 @@ describe ClassMixedWithDSLHelpers do
|
|
8
8
|
let(:privatebindir) { 'C:\\Program Files\\Puppet Labs\\Puppet\\bin' }
|
9
9
|
|
10
10
|
context 'when platform is windows and non cygwin' do
|
11
|
-
let(:winhost)
|
12
|
-
|
13
|
-
|
11
|
+
let(:winhost) do
|
12
|
+
make_host('winhost_non_cygwin', { platform: 'windows',
|
13
|
+
privatebindir: privatebindir,
|
14
|
+
is_cygwin: 'false', })
|
15
|
+
end
|
14
16
|
|
15
17
|
it 'run the correct ruby_command' do
|
16
18
|
expect(subject.ruby_command(winhost)).to eq("cmd /V /C \"set PATH=#{privatebindir};!PATH! && ruby\"")
|
@@ -18,9 +20,11 @@ describe ClassMixedWithDSLHelpers do
|
|
18
20
|
end
|
19
21
|
|
20
22
|
context 'when platform is windows and cygwin' do
|
21
|
-
let(:winhost)
|
22
|
-
|
23
|
-
|
23
|
+
let(:winhost) do
|
24
|
+
make_host('winhost', { platform: Beaker::Platform.new('windows-2016-a64'),
|
25
|
+
privatebindir: privatebindir,
|
26
|
+
is_cygwin: true, })
|
27
|
+
end
|
24
28
|
|
25
29
|
it 'run the correct ruby_command' do
|
26
30
|
expect(subject.ruby_command(winhost)).to eq("env PATH=\"#{privatebindir}:${PATH}\" ruby")
|