beaker 4.42.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +26 -13
- data/.rubocop.yml +23 -10
- data/.rubocop_todo.yml +34 -10
- data/CHANGELOG.md +16 -61
- data/Gemfile +12 -7
- data/HISTORY.md +605 -0
- data/Rakefile +99 -111
- data/acceptance/config/acceptance-options.rb +1 -1
- data/acceptance/config/base/acceptance-options.rb +2 -2
- data/acceptance/config/hypervisor/acceptance-options.rb +2 -2
- data/acceptance/config/subcommands/acceptance-options.rb +2 -2
- data/acceptance/fixtures/module/Rakefile +1 -1
- data/acceptance/fixtures/module/spec/acceptance/demo_spec.rb +8 -12
- data/acceptance/fixtures/module/spec/classes/init_spec.rb +0 -1
- data/acceptance/fixtures/module/spec/spec_helper_acceptance.rb +3 -5
- data/acceptance/lib/helpers/test_helper.rb +6 -5
- data/acceptance/pre_suite/subcommands/05_install_ruby.rb +2 -3
- data/acceptance/pre_suite/subcommands/08_install_beaker.rb +1 -2
- data/acceptance/tests/base/dsl/helpers/configuration_test.rb +4 -4
- data/acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb +1 -2
- data/acceptance/tests/base/dsl/helpers/host_helpers/add_system32_hosts_entry_test.rb +0 -3
- data/acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb +3 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/backup_the_file_test.rb +9 -9
- data/acceptance/tests/base/dsl/helpers/host_helpers/check_for_package_test.rb +0 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/create_remote_file_test.rb +19 -26
- data/acceptance/tests/base/dsl/helpers/host_helpers/curl_on_test.rb +2 -2
- data/acceptance/tests/base/dsl/helpers/host_helpers/curl_with_retries_test.rb +0 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/on_test.rb +18 -13
- data/acceptance/tests/base/dsl/helpers/host_helpers/retry_on_test.rb +3 -3
- data/acceptance/tests/base/dsl/helpers/host_helpers/rsync_to_test.rb +22 -27
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_cron_on_test.rb +12 -16
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_on_test.rb +3 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_test.rb +3 -3
- data/acceptance/tests/base/dsl/helpers/host_helpers/scp_from_test.rb +4 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/scp_to_test.rb +3 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/shell_test.rb +5 -5
- data/acceptance/tests/base/dsl/helpers/host_helpers/upgrade_package_test.rb +3 -5
- data/acceptance/tests/base/dsl/platform_tag_confiner_test.rb +14 -17
- data/acceptance/tests/base/dsl/structure_test.rb +5 -11
- data/acceptance/tests/base/host/file_test.rb +2 -2
- data/acceptance/tests/base/host/group_test.rb +0 -1
- data/acceptance/tests/base/host/host_test.rb +66 -63
- data/acceptance/tests/base/host/packages.rb +1 -2
- data/acceptance/tests/base/host/packages_unix.rb +0 -55
- data/acceptance/tests/base/host/user_test.rb +0 -1
- data/acceptance/tests/base/host_prebuilt_steps/ssh_environment_test.rb +1 -2
- data/acceptance/tests/base/test_suite/export.rb +6 -9
- data/acceptance/tests/install/from_file.rb +2 -4
- data/acceptance/tests/load_path_bootstrap.rb +1 -1
- data/acceptance/tests/subcommands/destroy.rb +19 -21
- data/acceptance/tests/subcommands/exec.rb +0 -1
- data/acceptance/tests/subcommands/init.rb +2 -3
- data/acceptance/tests/subcommands/provision.rb +0 -1
- data/beaker.gemspec +4 -7
- data/docs/concepts/argument_processing_and_precedence.md +1 -10
- data/docs/how_to/debug_beaker_tests.md +12 -12
- data/docs/how_to/hosts/eos.md +2 -12
- data/docs/how_to/install_puppet.md +0 -18
- data/docs/how_to/the_beaker_dsl.md +0 -2
- data/lib/beaker/cli.rb +59 -68
- data/lib/beaker/command.rb +20 -28
- data/lib/beaker/command_factory.rb +3 -2
- data/lib/beaker/dsl/assertions.rb +6 -18
- data/lib/beaker/dsl/helpers/hocon_helpers.rb +3 -7
- data/lib/beaker/dsl/helpers/host_helpers.rb +62 -123
- data/lib/beaker/dsl/helpers/test_helpers.rb +3 -5
- data/lib/beaker/dsl/helpers/web_helpers.rb +19 -39
- data/lib/beaker/dsl/helpers.rb +2 -4
- data/lib/beaker/dsl/outcomes.rb +13 -15
- data/lib/beaker/dsl/patterns.rb +1 -3
- data/lib/beaker/dsl/roles.rb +17 -20
- data/lib/beaker/dsl/structure.rb +53 -65
- data/lib/beaker/dsl/test_tagging.rb +7 -10
- data/lib/beaker/dsl/wrappers.rb +15 -16
- data/lib/beaker/dsl.rb +2 -3
- data/lib/beaker/host/aix/exec.rb +1 -1
- data/lib/beaker/host/aix/file.rb +0 -1
- data/lib/beaker/host/aix/group.rb +1 -1
- data/lib/beaker/host/aix/user.rb +1 -1
- data/lib/beaker/host/aix.rb +3 -4
- data/lib/beaker/host/cisco.rb +27 -39
- data/lib/beaker/host/eos.rb +4 -30
- data/lib/beaker/host/freebsd/exec.rb +1 -1
- data/lib/beaker/host/freebsd/pkg.rb +3 -3
- data/lib/beaker/host/freebsd.rb +9 -12
- data/lib/beaker/host/mac/exec.rb +4 -4
- data/lib/beaker/host/mac/group.rb +7 -7
- data/lib/beaker/host/mac/pkg.rb +3 -106
- data/lib/beaker/host/mac/user.rb +2 -2
- data/lib/beaker/host/mac.rb +8 -9
- data/lib/beaker/host/pswindows/exec.rb +66 -70
- data/lib/beaker/host/pswindows/file.rb +3 -5
- data/lib/beaker/host/pswindows/group.rb +3 -3
- data/lib/beaker/host/pswindows/pkg.rb +12 -12
- data/lib/beaker/host/pswindows/user.rb +3 -3
- data/lib/beaker/host/pswindows.rb +4 -3
- data/lib/beaker/host/unix/exec.rb +81 -83
- data/lib/beaker/host/unix/file.rb +41 -46
- data/lib/beaker/host/unix/group.rb +1 -1
- data/lib/beaker/host/unix/pkg.rb +138 -401
- data/lib/beaker/host/unix/user.rb +2 -2
- data/lib/beaker/host/unix.rb +8 -11
- data/lib/beaker/host/windows/exec.rb +17 -17
- data/lib/beaker/host/windows/file.rb +3 -3
- data/lib/beaker/host/windows/group.rb +3 -3
- data/lib/beaker/host/windows/pkg.rb +3 -54
- data/lib/beaker/host/windows/user.rb +3 -3
- data/lib/beaker/host/windows.rb +12 -12
- data/lib/beaker/host.rb +76 -133
- data/lib/beaker/host_prebuilt_steps.rb +88 -196
- data/lib/beaker/hypervisor/noop.rb +2 -4
- data/lib/beaker/hypervisor.rb +44 -61
- data/lib/beaker/local_connection.rb +2 -4
- data/lib/beaker/logger.rb +68 -76
- data/lib/beaker/logger_junit.rb +21 -25
- data/lib/beaker/network_manager.rb +39 -42
- data/lib/beaker/options/command_line_parser.rb +12 -23
- data/lib/beaker/options/hosts_file_parser.rb +16 -25
- data/lib/beaker/options/options_file_parser.rb +3 -6
- data/lib/beaker/options/options_hash.rb +2 -7
- data/lib/beaker/options/parser.rb +86 -102
- data/lib/beaker/options/presets.rb +114 -123
- data/lib/beaker/options/subcommand_options_file_parser.rb +3 -6
- data/lib/beaker/options/validator.rb +26 -31
- data/lib/beaker/perf.rb +25 -30
- data/lib/beaker/platform.rb +27 -39
- data/lib/beaker/result.rb +7 -6
- data/lib/beaker/shared/error_handler.rb +8 -10
- data/lib/beaker/shared/fog_credentials.rb +5 -9
- data/lib/beaker/shared/host_manager.rb +36 -41
- data/lib/beaker/shared/options_resolver.rb +3 -7
- data/lib/beaker/shared/repetition.rb +2 -4
- data/lib/beaker/shared/semvar.rb +37 -41
- data/lib/beaker/shared/timed.rb +0 -3
- data/lib/beaker/shared.rb +1 -1
- data/lib/beaker/ssh_connection.rb +38 -47
- data/lib/beaker/subcommand.rb +17 -24
- data/lib/beaker/subcommands/subcommand_util.rb +4 -4
- data/lib/beaker/tasks/quick_start.rb +4 -9
- data/lib/beaker/tasks/rake_task.rb +25 -27
- data/lib/beaker/tasks/test.rb +4 -4
- data/lib/beaker/test_case.rb +16 -28
- data/lib/beaker/test_suite.rb +35 -39
- data/lib/beaker/test_suite_result.rb +45 -47
- data/lib/beaker/version.rb +1 -1
- data/lib/beaker.rb +6 -7
- data/spec/beaker/cli_spec.rb +121 -142
- data/spec/beaker/command_spec.rb +55 -59
- data/spec/beaker/dsl/assertions_spec.rb +36 -36
- data/spec/beaker/dsl/helpers/host_helpers_spec.rb +110 -131
- data/spec/beaker/dsl/helpers/test_helpers_spec.rb +9 -10
- data/spec/beaker/dsl/helpers/web_helpers_spec.rb +22 -31
- data/spec/beaker/dsl/outcomes_spec.rb +14 -14
- data/spec/beaker/dsl/roles_spec.rb +125 -130
- data/spec/beaker/dsl/structure_spec.rb +172 -161
- data/spec/beaker/dsl/test_tagging_spec.rb +89 -90
- data/spec/beaker/dsl/wrappers_spec.rb +32 -33
- data/spec/beaker/host/aix_spec.rb +14 -14
- data/spec/beaker/host/cisco_spec.rb +84 -94
- data/spec/beaker/host/eos_spec.rb +15 -36
- data/spec/beaker/host/freebsd/exec_spec.rb +3 -6
- data/spec/beaker/host/freebsd/pkg_spec.rb +24 -27
- data/spec/beaker/host/mac/exec_spec.rb +2 -3
- data/spec/beaker/host/mac/group_spec.rb +48 -57
- data/spec/beaker/host/mac/user_spec.rb +54 -63
- data/spec/beaker/host/pswindows/exec_spec.rb +30 -32
- data/spec/beaker/host/pswindows/file_spec.rb +16 -16
- data/spec/beaker/host/pswindows/user_spec.rb +17 -23
- data/spec/beaker/host/pswindows_spec.rb +13 -13
- data/spec/beaker/host/unix/exec_spec.rb +75 -80
- data/spec/beaker/host/unix/file_spec.rb +65 -78
- data/spec/beaker/host/unix/pkg_spec.rb +150 -411
- data/spec/beaker/host/unix_spec.rb +11 -207
- data/spec/beaker/host/windows/exec_spec.rb +30 -32
- data/spec/beaker/host/windows/file_spec.rb +18 -19
- data/spec/beaker/host/windows/group_spec.rb +10 -12
- data/spec/beaker/host/windows/pkg_spec.rb +6 -9
- data/spec/beaker/host/windows/user_spec.rb +17 -23
- data/spec/beaker/host/windows_spec.rb +39 -39
- data/spec/beaker/host_prebuilt_steps_spec.rb +168 -349
- data/spec/beaker/host_spec.rb +204 -284
- data/spec/beaker/hypervisor/hypervisor_spec.rb +36 -61
- data/spec/beaker/localhost_connection_spec.rb +10 -11
- data/spec/beaker/logger_junit_spec.rb +19 -30
- data/spec/beaker/logger_spec.rb +153 -136
- data/spec/beaker/network_manager_spec.rb +23 -23
- data/spec/beaker/options/command_line_parser_spec.rb +20 -23
- data/spec/beaker/options/hosts_file_parser_spec.rb +30 -32
- data/spec/beaker/options/options_file_parser_spec.rb +4 -7
- data/spec/beaker/options/options_hash_spec.rb +4 -6
- data/spec/beaker/options/parser_spec.rb +167 -167
- data/spec/beaker/options/presets_spec.rb +7 -9
- data/spec/beaker/options/subcommand_options_parser_spec.rb +13 -14
- data/spec/beaker/options/validator_spec.rb +10 -11
- data/spec/beaker/perf_spec.rb +18 -21
- data/spec/beaker/platform_spec.rb +25 -55
- data/spec/beaker/shared/error_handler_spec.rb +7 -16
- data/spec/beaker/shared/fog_credentials_spec.rb +29 -29
- data/spec/beaker/shared/host_manager_spec.rb +50 -84
- data/spec/beaker/shared/options_resolver_spec.rb +9 -12
- data/spec/beaker/shared/repetition_spec.rb +17 -24
- data/spec/beaker/shared/semvar_spec.rb +21 -26
- data/spec/beaker/ssh_connection_spec.rb +76 -83
- data/spec/beaker/subcommand/subcommand_util_spec.rb +31 -33
- data/spec/beaker/subcommand_spec.rb +75 -77
- data/spec/beaker/test_case_spec.rb +25 -50
- data/spec/beaker/test_suite_spec.rb +147 -154
- data/spec/helpers.rb +39 -45
- data/spec/matchers.rb +8 -7
- data/spec/mocks.rb +1 -6
- data/spec/spec_helper.rb +0 -1
- metadata +8 -24
- data/acceptance/tests/base/dsl/helpers/host_helpers/deploy_package_repo_test.rb +0 -142
- data/acceptance/tests/base/external_resources_test.rb +0 -31
- data/spec/beaker/host/mac_spec.rb +0 -113
|
@@ -18,106 +18,102 @@ module Beaker
|
|
|
18
18
|
"me"
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
@logger
|
|
23
|
-
end
|
|
24
|
-
|
|
21
|
+
attr_reader :logger
|
|
25
22
|
end
|
|
26
23
|
|
|
27
24
|
let(:opts) { @opts || {} }
|
|
28
|
-
let(:logger) { double(
|
|
29
|
-
let(:platform)
|
|
25
|
+
let(:logger) { double('logger').as_null_object }
|
|
26
|
+
let(:platform) do
|
|
30
27
|
if @platform
|
|
31
|
-
{ 'platform' => Beaker::Platform.new(
|
|
28
|
+
{ 'platform' => Beaker::Platform.new(@platform) }
|
|
32
29
|
else
|
|
33
|
-
{ 'platform' => Beaker::Platform.new(
|
|
30
|
+
{ 'platform' => Beaker::Platform.new('osx-10.9-x86_64') }
|
|
34
31
|
end
|
|
35
|
-
|
|
32
|
+
end
|
|
36
33
|
let(:instance) { UnixFileTest.new(opts.merge(platform), logger) }
|
|
37
34
|
|
|
38
35
|
describe '#repo_type' do
|
|
39
|
-
%w[
|
|
36
|
+
%w[centos redhat].each do |platform|
|
|
40
37
|
it "returns correctly for platform '#{platform}'" do
|
|
41
38
|
@platform = "#{platform}-5-x86_64"
|
|
42
|
-
expect(
|
|
39
|
+
expect(instance.repo_type).to be === 'rpm'
|
|
43
40
|
end
|
|
44
41
|
end
|
|
45
42
|
|
|
46
43
|
it 'returns correctly for debian-based platforms' do
|
|
47
44
|
@platform = 'debian-6-x86_64'
|
|
48
|
-
expect(
|
|
45
|
+
expect(instance.repo_type).to be === 'deb'
|
|
49
46
|
end
|
|
50
47
|
|
|
51
48
|
it 'errors for all other platform types' do
|
|
52
49
|
@platform = 'eos-4-x86_64'
|
|
53
|
-
expect
|
|
50
|
+
expect do
|
|
54
51
|
instance.repo_type
|
|
55
|
-
|
|
52
|
+
end.to raise_error(ArgumentError, /repo\ type\ not\ known/)
|
|
56
53
|
end
|
|
57
54
|
end
|
|
58
55
|
|
|
59
56
|
describe '#package_config_dir' do
|
|
60
|
-
%w[
|
|
57
|
+
%w[centos redhat].each do |platform|
|
|
61
58
|
it "returns correctly for platform '#{platform}'" do
|
|
62
59
|
@platform = "#{platform}-5-x86_64"
|
|
63
|
-
expect(
|
|
60
|
+
expect(instance.package_config_dir).to be === '/etc/yum.repos.d/'
|
|
64
61
|
end
|
|
65
62
|
end
|
|
66
63
|
|
|
67
64
|
it 'returns correctly for debian-based platforms' do
|
|
68
65
|
@platform = 'debian-6-x86_64'
|
|
69
|
-
expect(
|
|
66
|
+
expect(instance.package_config_dir).to be === '/etc/apt/sources.list.d'
|
|
70
67
|
end
|
|
71
68
|
|
|
72
69
|
it 'returns correctly for sles-based platforms' do
|
|
73
70
|
@platform = 'sles-12-x86_64'
|
|
74
|
-
expect(
|
|
71
|
+
expect(instance.package_config_dir).to be === '/etc/zypp/repos.d/'
|
|
75
72
|
end
|
|
76
73
|
|
|
77
74
|
it 'returns correctly for opensuse-based platforms' do
|
|
78
75
|
@platform = 'opensuse-15-x86_64'
|
|
79
|
-
expect(
|
|
76
|
+
expect(instance.package_config_dir).to be === '/etc/zypp/repos.d/'
|
|
80
77
|
end
|
|
81
78
|
|
|
82
79
|
it 'errors for all other platform types' do
|
|
83
80
|
@platform = 'eos-4-x86_64'
|
|
84
|
-
expect
|
|
81
|
+
expect do
|
|
85
82
|
instance.package_config_dir
|
|
86
|
-
|
|
83
|
+
end.to raise_error(ArgumentError, /package\ config\ dir\ unknown/)
|
|
87
84
|
end
|
|
88
85
|
end
|
|
89
86
|
|
|
90
87
|
describe '#repo_filename' do
|
|
91
|
-
|
|
92
|
-
['centos','redhat'].each do |platform|
|
|
88
|
+
%w[centos redhat].each do |platform|
|
|
93
89
|
it "sets the el portion correctly for '#{platform}'" do
|
|
94
90
|
@platform = "#{platform}-5-x86_64"
|
|
95
|
-
allow(
|
|
96
|
-
filename = instance.repo_filename(
|
|
97
|
-
expect(
|
|
91
|
+
allow(instance).to receive(:is_pe?).and_return(false)
|
|
92
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version7')
|
|
93
|
+
expect(filename).to match(/sion7\-el\-/)
|
|
98
94
|
end
|
|
99
95
|
end
|
|
100
96
|
|
|
101
97
|
it 'sets the sles portion correctly for sles platforms' do
|
|
102
98
|
@platform = 'sles-11-x86_64'
|
|
103
|
-
allow(
|
|
104
|
-
filename = instance.repo_filename(
|
|
105
|
-
expect(
|
|
99
|
+
allow(instance).to receive(:is_pe?).and_return(false)
|
|
100
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version7')
|
|
101
|
+
expect(filename).to match(/sion7\-sles\-/)
|
|
106
102
|
end
|
|
107
103
|
|
|
108
104
|
it 'sets the opensuse portion correctly for opensuse platforms' do
|
|
109
105
|
@platform = 'opensuse-15-x86_64'
|
|
110
|
-
allow(
|
|
111
|
-
filename = instance.repo_filename(
|
|
112
|
-
expect(
|
|
106
|
+
allow(instance).to receive(:is_pe?).and_return(false)
|
|
107
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version7')
|
|
108
|
+
expect(filename).to match(/sion7\-opensuse\-/)
|
|
113
109
|
end
|
|
114
110
|
|
|
115
111
|
it 'builds the filename correctly for el-based platforms' do
|
|
116
112
|
@platform = 'el-21-x86_64'
|
|
117
|
-
allow(
|
|
118
|
-
filename = instance.repo_filename(
|
|
113
|
+
allow(instance).to receive(:is_pe?).and_return(false)
|
|
114
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version8')
|
|
119
115
|
correct = 'pl-pkg_name-pkg_version8-el-21-x86_64.repo'
|
|
120
|
-
expect(
|
|
116
|
+
expect(filename).to be === correct
|
|
121
117
|
end
|
|
122
118
|
|
|
123
119
|
it 'builds the filename correctly for redhatfips platforms' do
|
|
@@ -126,76 +122,67 @@ module Beaker
|
|
|
126
122
|
expect(instance).to receive(:[]).with('packaging_platform').and_return('redhatfips-7-x86_64')
|
|
127
123
|
filename = instance.repo_filename('pkg_name', 'pkg_version')
|
|
128
124
|
correct = 'pl-pkg_name-pkg_version-redhatfips-7-x86_64.repo'
|
|
129
|
-
expect(
|
|
125
|
+
expect(filename).to be === correct
|
|
130
126
|
end
|
|
131
127
|
|
|
132
128
|
it 'adds in the PE portion of the filename correctly for el-based PE hosts' do
|
|
133
129
|
@platform = 'el-21-x86_64'
|
|
134
|
-
allow( instance ).to receive( :is_pe? ).and_return(true)
|
|
135
|
-
filename = instance.repo_filename( 'pkg_name', 'pkg_version9' )
|
|
136
|
-
correct = 'pl-pkg_name-pkg_version9-el-21-x86_64.repo'
|
|
137
|
-
expect( filename ).to be === correct
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
it 'builds the filename correctly for amazon-based platforms' do
|
|
141
|
-
@platform = 'amazon-2023-x86_64'
|
|
142
130
|
allow(instance).to receive(:is_pe?).and_return(true)
|
|
143
|
-
filename = instance.repo_filename('pkg_name', '
|
|
144
|
-
correct = 'pl-pkg_name-
|
|
131
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version9')
|
|
132
|
+
correct = 'pl-pkg_name-pkg_version9-el-21-x86_64.repo'
|
|
145
133
|
expect(filename).to be === correct
|
|
146
134
|
end
|
|
147
135
|
|
|
148
136
|
it 'builds the filename correctly for debian-based platforms' do
|
|
149
137
|
@platform = 'debian-8-x86_64'
|
|
150
|
-
filename = instance.repo_filename(
|
|
138
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version10')
|
|
151
139
|
correct = 'pl-pkg_name-pkg_version10-jessie.list'
|
|
152
|
-
expect(
|
|
140
|
+
expect(filename).to be === correct
|
|
153
141
|
end
|
|
154
142
|
|
|
155
143
|
it 'uses the variant for the codename on the cumulus platform' do
|
|
156
144
|
@platform = 'cumulus-2.5-x86_64'
|
|
157
|
-
filename = instance.repo_filename(
|
|
145
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version11')
|
|
158
146
|
correct = 'pl-pkg_name-pkg_version11-cumulus.list'
|
|
159
|
-
expect(
|
|
147
|
+
expect(filename).to be === correct
|
|
160
148
|
end
|
|
161
149
|
|
|
162
150
|
it 'adds wrlinux to variant on cisco platforms' do
|
|
163
151
|
@platform = 'cisco_nexus-7-x86_64'
|
|
164
|
-
allow(
|
|
165
|
-
filename = instance.repo_filename(
|
|
166
|
-
expect(
|
|
152
|
+
allow(instance).to receive(:is_pe?).and_return(false)
|
|
153
|
+
filename = instance.repo_filename('pkg_name', 'pkg_version12')
|
|
154
|
+
expect(filename).to match(/sion12\-cisco\-wrlinux\-/)
|
|
167
155
|
end
|
|
168
156
|
|
|
169
157
|
it 'errors for non-el or debian-based platforms' do
|
|
170
158
|
@platform = 'freebsd-22-x86_64'
|
|
171
|
-
expect
|
|
172
|
-
instance.repo_filename(
|
|
173
|
-
|
|
159
|
+
expect do
|
|
160
|
+
instance.repo_filename('pkg_name', 'pkg_version')
|
|
161
|
+
end.to raise_error(ArgumentError, /repo\ filename\ pattern\ not\ known/)
|
|
174
162
|
end
|
|
175
163
|
end
|
|
176
164
|
|
|
177
165
|
describe '#noask_file_text' do
|
|
178
|
-
|
|
179
166
|
it 'errors on non-solaris platforms' do
|
|
180
167
|
@platform = 'cumulus-4000-x86_64'
|
|
181
|
-
expect
|
|
168
|
+
expect do
|
|
182
169
|
instance.noask_file_text
|
|
183
|
-
|
|
170
|
+
end.to raise_error(ArgumentError, /^noask\ file\ text\ unknown/)
|
|
184
171
|
end
|
|
185
172
|
|
|
186
173
|
it 'errors on solaris versions other than 10' do
|
|
187
174
|
@platform = 'solaris-11-x86_64'
|
|
188
|
-
expect
|
|
175
|
+
expect do
|
|
189
176
|
instance.noask_file_text
|
|
190
|
-
|
|
177
|
+
end.to raise_error(ArgumentError, /^noask\ file\ text\ unknown/)
|
|
191
178
|
end
|
|
192
179
|
|
|
193
180
|
it 'returns the noask file correctly for solaris 10' do
|
|
194
181
|
@platform = 'solaris-10-x86_64'
|
|
195
182
|
text = instance.noask_file_text
|
|
196
|
-
expect(
|
|
197
|
-
expect(
|
|
198
|
-
expect(
|
|
183
|
+
expect(text).to match(/instance\=overwrite/)
|
|
184
|
+
expect(text).to match(/space\=quit/)
|
|
185
|
+
expect(text).to match(/basedir\=default/)
|
|
199
186
|
end
|
|
200
187
|
end
|
|
201
188
|
|
|
@@ -204,13 +191,13 @@ module Beaker
|
|
|
204
191
|
let(:path) { '/path/to/chown/on' }
|
|
205
192
|
|
|
206
193
|
it 'calls the system method' do
|
|
207
|
-
expect(
|
|
208
|
-
expect(
|
|
194
|
+
expect(instance).to receive(:execute).with("chown #{user} #{path}").and_return(0)
|
|
195
|
+
expect(instance.chown(user, path)).to be === 0
|
|
209
196
|
end
|
|
210
197
|
|
|
211
198
|
it 'passes -R if recursive' do
|
|
212
|
-
expect(
|
|
213
|
-
instance.chown(
|
|
199
|
+
expect(instance).to receive(:execute).with("chown \-R #{user} #{path}")
|
|
200
|
+
instance.chown(user, path, true)
|
|
214
201
|
end
|
|
215
202
|
end
|
|
216
203
|
|
|
@@ -218,8 +205,8 @@ module Beaker
|
|
|
218
205
|
let(:path) { '/path/to/cat/on' }
|
|
219
206
|
|
|
220
207
|
it 'calls cat for path' do
|
|
221
|
-
expect(
|
|
222
|
-
expect(
|
|
208
|
+
expect(instance).to receive(:execute).with("cat #{path}").and_return(0)
|
|
209
|
+
expect(instance.cat(path)).to be === 0
|
|
223
210
|
end
|
|
224
211
|
end
|
|
225
212
|
|
|
@@ -229,7 +216,7 @@ module Beaker
|
|
|
229
216
|
path = '/path/to/file'
|
|
230
217
|
mod = '+x'
|
|
231
218
|
|
|
232
|
-
expect(
|
|
219
|
+
expect(instance).to receive(:execute).with("chmod #{mod} #{path}")
|
|
233
220
|
instance.chmod(mod, path)
|
|
234
221
|
end
|
|
235
222
|
end
|
|
@@ -239,7 +226,7 @@ module Beaker
|
|
|
239
226
|
path = '/path/to/file'
|
|
240
227
|
mod = '+x'
|
|
241
228
|
|
|
242
|
-
expect(
|
|
229
|
+
expect(instance).to receive(:execute).with("chmod -R #{mod} #{path}")
|
|
243
230
|
instance.chmod(mod, path, true)
|
|
244
231
|
end
|
|
245
232
|
end
|
|
@@ -250,13 +237,13 @@ module Beaker
|
|
|
250
237
|
let(:path) { '/path/to/chgrp/on' }
|
|
251
238
|
|
|
252
239
|
it 'calls the system method' do
|
|
253
|
-
expect(
|
|
254
|
-
expect(
|
|
240
|
+
expect(instance).to receive(:execute).with("chgrp #{group} #{path}").and_return(0)
|
|
241
|
+
expect(instance.chgrp(group, path)).to be === 0
|
|
255
242
|
end
|
|
256
243
|
|
|
257
244
|
it 'passes -R if recursive' do
|
|
258
|
-
expect(
|
|
259
|
-
instance.chgrp(
|
|
245
|
+
expect(instance).to receive(:execute).with("chgrp \-R #{group} #{path}")
|
|
246
|
+
instance.chgrp(group, path, true)
|
|
260
247
|
end
|
|
261
248
|
end
|
|
262
249
|
|
|
@@ -264,8 +251,8 @@ module Beaker
|
|
|
264
251
|
let(:path) { '/path/to/ls_ld' }
|
|
265
252
|
|
|
266
253
|
it 'calls the system method' do
|
|
267
|
-
expect(
|
|
268
|
-
expect(
|
|
254
|
+
expect(instance).to receive(:execute).with("ls -ld #{path}").and_return(0)
|
|
255
|
+
expect(instance.ls_ld(path)).to be === 0
|
|
269
256
|
end
|
|
270
257
|
end
|
|
271
258
|
end
|