beaker 4.38.1 → 4.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +12 -0
- data/.rubocop.yml +62 -0
- data/.rubocop_todo.yml +215 -0
- data/CHANGELOG.md +72 -33
- data/Gemfile +8 -1
- data/HISTORY.md +103 -0
- data/Rakefile +10 -9
- data/acceptance/fixtures/module/Gemfile +1 -1
- data/acceptance/fixtures/module/Rakefile +2 -2
- data/acceptance/fixtures/module/spec/acceptance/demo_spec.rb +8 -11
- data/acceptance/fixtures/module/spec/classes/init_spec.rb +1 -1
- data/acceptance/lib/helpers/test_helper.rb +3 -3
- data/acceptance/tests/base/dsl/helpers/hocon_helpers_test.rb +6 -6
- data/acceptance/tests/base/dsl/helpers/host_helpers/archive_file_from_test.rb +6 -6
- data/acceptance/tests/base/dsl/helpers/host_helpers/backup_the_file_test.rb +6 -12
- data/acceptance/tests/base/dsl/helpers/host_helpers/create_remote_file_test.rb +4 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/curl_on_test.rb +1 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/deploy_package_repo_test.rb +7 -7
- data/acceptance/tests/base/dsl/helpers/host_helpers/on_test.rb +4 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/retry_on_test.rb +4 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/rsync_to_test.rb +8 -11
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_cron_on_test.rb +2 -2
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_on_test.rb +6 -11
- data/acceptance/tests/base/dsl/helpers/host_helpers/run_script_test.rb +5 -9
- data/acceptance/tests/base/dsl/helpers/host_helpers/scp_from_test.rb +2 -2
- data/acceptance/tests/base/dsl/helpers/host_helpers/scp_to_test.rb +1 -1
- data/acceptance/tests/base/dsl/helpers/host_helpers/shell_test.rb +4 -4
- data/acceptance/tests/base/dsl/helpers/host_helpers/upgrade_package_test.rb +1 -1
- data/acceptance/tests/base/dsl/platform_tag_confiner_test.rb +1 -1
- data/acceptance/tests/base/dsl/structure_test.rb +4 -10
- data/acceptance/tests/base/host/file_test.rb +7 -7
- data/acceptance/tests/base/host/group_test.rb +2 -2
- data/acceptance/tests/base/host/host_test.rb +5 -5
- data/acceptance/tests/base/host/packages.rb +26 -28
- data/acceptance/tests/base/host/packages_unix.rb +4 -4
- data/acceptance/tests/base/host/user_test.rb +2 -2
- data/acceptance/tests/install/from_file.rb +2 -2
- data/beaker.gemspec +9 -9
- data/docs/concepts/style_guide.md +1 -1
- data/docs/how_to/debug_beaker_tests.md +1 -1
- data/docs/how_to/test_arbitrary_beaker_versions.md +2 -2
- data/lib/beaker/cli.rb +6 -8
- data/lib/beaker/command.rb +3 -3
- data/lib/beaker/command_factory.rb +2 -2
- data/lib/beaker/dsl/assertions.rb +1 -1
- data/lib/beaker/dsl/helpers/hocon_helpers.rb +2 -2
- data/lib/beaker/dsl/helpers/host_helpers.rb +11 -11
- data/lib/beaker/dsl/helpers/web_helpers.rb +3 -3
- data/lib/beaker/dsl/outcomes.rb +4 -4
- data/lib/beaker/dsl/roles.rb +2 -2
- data/lib/beaker/dsl/structure.rb +10 -10
- data/lib/beaker/host/aix/group.rb +3 -3
- data/lib/beaker/host/aix/user.rb +3 -3
- data/lib/beaker/host/cisco.rb +11 -11
- data/lib/beaker/host/eos.rb +2 -2
- data/lib/beaker/host/mac/exec.rb +1 -1
- data/lib/beaker/host/mac/group.rb +7 -7
- data/lib/beaker/host/mac/pkg.rb +6 -6
- data/lib/beaker/host/mac/user.rb +6 -6
- data/lib/beaker/host/pswindows/exec.rb +8 -8
- data/lib/beaker/host/pswindows/file.rb +1 -1
- data/lib/beaker/host/pswindows/group.rb +3 -3
- data/lib/beaker/host/pswindows/pkg.rb +6 -6
- data/lib/beaker/host/pswindows/user.rb +2 -2
- data/lib/beaker/host/unix/exec.rb +6 -6
- data/lib/beaker/host/unix/file.rb +3 -4
- data/lib/beaker/host/unix/group.rb +3 -3
- data/lib/beaker/host/unix/pkg.rb +17 -17
- data/lib/beaker/host/unix/user.rb +3 -3
- data/lib/beaker/host/unix.rb +10 -9
- data/lib/beaker/host/windows/exec.rb +3 -3
- data/lib/beaker/host/windows/file.rb +2 -2
- data/lib/beaker/host/windows/group.rb +3 -3
- data/lib/beaker/host/windows/pkg.rb +6 -6
- data/lib/beaker/host/windows/user.rb +2 -2
- data/lib/beaker/host/windows.rb +2 -2
- data/lib/beaker/host.rb +7 -7
- data/lib/beaker/host_prebuilt_steps.rb +38 -45
- data/lib/beaker/hypervisor.rb +4 -4
- data/lib/beaker/local_connection.rb +3 -3
- data/lib/beaker/logger.rb +5 -11
- data/lib/beaker/logger_junit.rb +2 -2
- data/lib/beaker/network_manager.rb +2 -2
- data/lib/beaker/options/command_line_parser.rb +1 -1
- data/lib/beaker/options/hosts_file_parser.rb +21 -4
- data/lib/beaker/options/options_file_parser.rb +1 -1
- data/lib/beaker/options/options_hash.rb +1 -3
- data/lib/beaker/options/parser.rb +6 -6
- data/lib/beaker/options/presets.rb +2 -2
- data/lib/beaker/options/validator.rb +2 -2
- data/lib/beaker/perf.rb +9 -9
- data/lib/beaker/platform.rb +1 -1
- data/lib/beaker/shared/host_manager.rb +4 -5
- data/lib/beaker/shared/repetition.rb +4 -4
- data/lib/beaker/shared/semvar.rb +2 -2
- data/lib/beaker/shared/timed.rb +2 -2
- data/lib/beaker/ssh_connection.rb +9 -9
- data/lib/beaker/subcommand.rb +6 -6
- data/lib/beaker/tasks/quick_start.rb +2 -2
- data/lib/beaker/tasks/rake_task.rb +3 -3
- data/lib/beaker/test_suite.rb +2 -2
- data/lib/beaker/test_suite_result.rb +8 -11
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/cli_spec.rb +46 -43
- data/spec/beaker/command_spec.rb +17 -7
- data/spec/beaker/dsl/assertions_spec.rb +2 -11
- data/spec/beaker/dsl/helpers/host_helpers_spec.rb +7 -7
- data/spec/beaker/dsl/helpers/web_helpers_spec.rb +2 -2
- data/spec/beaker/dsl/outcomes_spec.rb +1 -0
- data/spec/beaker/dsl/roles_spec.rb +48 -5
- data/spec/beaker/dsl/structure_spec.rb +22 -15
- data/spec/beaker/dsl/test_tagging_spec.rb +16 -16
- data/spec/beaker/dsl/wrappers_spec.rb +7 -7
- data/spec/beaker/host/cisco_spec.rb +8 -8
- data/spec/beaker/host/freebsd/exec_spec.rb +3 -3
- data/spec/beaker/host/freebsd/pkg_spec.rb +6 -3
- data/spec/beaker/host/mac/exec_spec.rb +3 -3
- data/spec/beaker/host/mac_spec.rb +6 -6
- data/spec/beaker/host/pswindows/exec_spec.rb +8 -5
- data/spec/beaker/host/pswindows/file_spec.rb +6 -3
- data/spec/beaker/host/pswindows_spec.rb +1 -1
- data/spec/beaker/host/unix/exec_spec.rb +24 -24
- data/spec/beaker/host/unix/file_spec.rb +18 -17
- data/spec/beaker/host/unix/pkg_spec.rb +26 -22
- data/spec/beaker/host/unix_spec.rb +8 -8
- data/spec/beaker/host/windows/exec_spec.rb +4 -4
- data/spec/beaker/host/windows/file_spec.rb +4 -4
- data/spec/beaker/host/windows/group_spec.rb +12 -12
- data/spec/beaker/host/windows/pkg_spec.rb +5 -5
- data/spec/beaker/host_prebuilt_steps_spec.rb +26 -20
- data/spec/beaker/host_spec.rb +72 -63
- data/spec/beaker/hypervisor/hypervisor_spec.rb +14 -14
- data/spec/beaker/localhost_connection_spec.rb +6 -4
- data/spec/beaker/logger_junit_spec.rb +16 -17
- data/spec/beaker/logger_spec.rb +54 -52
- data/spec/beaker/network_manager_spec.rb +5 -5
- data/spec/beaker/options/command_line_parser_spec.rb +2 -2
- data/spec/beaker/options/data/hosts_preserved.yml +395 -0
- data/spec/beaker/options/hosts_file_parser_spec.rb +9 -2
- data/spec/beaker/options/options_file_parser_spec.rb +1 -1
- data/spec/beaker/options/options_hash_spec.rb +4 -4
- data/spec/beaker/options/parser_spec.rb +23 -23
- data/spec/beaker/options/presets_spec.rb +2 -2
- data/spec/beaker/options/subcommand_options_parser_spec.rb +4 -3
- data/spec/beaker/options/validator_spec.rb +18 -18
- data/spec/beaker/perf_spec.rb +29 -28
- data/spec/beaker/platform_spec.rb +3 -2
- data/spec/beaker/shared/error_handler_spec.rb +1 -1
- data/spec/beaker/shared/fog_credentials_spec.rb +12 -12
- data/spec/beaker/shared/host_manager_spec.rb +7 -7
- data/spec/beaker/shared/repetition_spec.rb +9 -9
- data/spec/beaker/ssh_connection_spec.rb +14 -12
- data/spec/beaker/subcommand/subcommand_util_spec.rb +9 -4
- data/spec/beaker/subcommand_spec.rb +30 -28
- data/spec/beaker/test_case_spec.rb +11 -15
- data/spec/beaker/test_suite_spec.rb +24 -24
- data/spec/matchers.rb +1 -1
- data/spec/mocks.rb +5 -5
- data/spec/spec_helper.rb +0 -3
- metadata +59 -59
- data/spec/mock_fission.rb +0 -60
- data/spec/mock_vsphere.rb +0 -314
- data/spec/mock_vsphere_helper.rb +0 -183
data/spec/mock_vsphere_helper.rb
DELETED
@@ -1,183 +0,0 @@
|
|
1
|
-
class MockVsphereSnapshot
|
2
|
-
attr_accessor :name
|
3
|
-
|
4
|
-
def RevertToSnapshot_Task
|
5
|
-
self
|
6
|
-
end
|
7
|
-
|
8
|
-
def wait_for_completion
|
9
|
-
true
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
|
15
|
-
class MockVsphereVM
|
16
|
-
attr_accessor :name, :powerState, :snapshot, :template, :toolsRunningStatus
|
17
|
-
|
18
|
-
def initialize
|
19
|
-
@powerState = "poweredOff"
|
20
|
-
@toolsRunningStatus = "guestToolsStopped"
|
21
|
-
@first = true
|
22
|
-
end
|
23
|
-
|
24
|
-
def runtime
|
25
|
-
self
|
26
|
-
end
|
27
|
-
|
28
|
-
def powerState
|
29
|
-
@powerState
|
30
|
-
end
|
31
|
-
|
32
|
-
def toolsRunningStatus
|
33
|
-
prev = @toolsRunningStatus
|
34
|
-
@toolsRunningStatus = "guestToolsRunning"
|
35
|
-
prev
|
36
|
-
end
|
37
|
-
|
38
|
-
def PowerOnVM_Task
|
39
|
-
@powerState = 'poweredOn'
|
40
|
-
self
|
41
|
-
end
|
42
|
-
|
43
|
-
def PowerOffVM_Task
|
44
|
-
@powerState = "poweredOff"
|
45
|
-
self
|
46
|
-
end
|
47
|
-
|
48
|
-
def summary
|
49
|
-
self
|
50
|
-
end
|
51
|
-
|
52
|
-
def guest
|
53
|
-
self
|
54
|
-
end
|
55
|
-
|
56
|
-
def ipAddress
|
57
|
-
@toolsRunningStatus = 'guestToolsRunning'
|
58
|
-
"#{@name}.ip.address"
|
59
|
-
end
|
60
|
-
|
61
|
-
def CloneVM_Task opts
|
62
|
-
clone = MockVsphereVM.new
|
63
|
-
clone.name = opts[:name]
|
64
|
-
clone.snapshot = self.snapshot
|
65
|
-
clone.template = self.template
|
66
|
-
clone.PowerOnVM_Task
|
67
|
-
MockVsphereHelper.add_vm( opts[:name], clone )
|
68
|
-
clone
|
69
|
-
end
|
70
|
-
|
71
|
-
def wait_for_completion
|
72
|
-
true
|
73
|
-
end
|
74
|
-
|
75
|
-
def Destroy_Task
|
76
|
-
true
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
|
82
|
-
class MockVsphereHelper
|
83
|
-
|
84
|
-
@@fog_file = {}
|
85
|
-
@@vms = {}
|
86
|
-
|
87
|
-
def initialize arg
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
def self.add_vm name, vm
|
92
|
-
@@vms[name] = vm
|
93
|
-
end
|
94
|
-
|
95
|
-
def self.set_config conf
|
96
|
-
@@fog_file = conf
|
97
|
-
end
|
98
|
-
|
99
|
-
def self.powerOn
|
100
|
-
@@vms.each do | name, vm |
|
101
|
-
vm.powerState = "poweredOn"
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def self.powerOff
|
106
|
-
@@vms.each do | name, vm |
|
107
|
-
vm.powerState = "poweredOff"
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
def self.set_vms hosts
|
112
|
-
@@vms = {}
|
113
|
-
hosts.each do |host|
|
114
|
-
vm = MockVsphereVM.new
|
115
|
-
vm.name = host.name
|
116
|
-
vm.snapshot = MockVsphereSnapshot.new
|
117
|
-
vm.snapshot.name = host[:snapshot]
|
118
|
-
@@vms[host.name] = vm
|
119
|
-
template = MockVsphereVM.new
|
120
|
-
template.name = host[:template]
|
121
|
-
template.snapshot = MockVsphereSnapshot.new
|
122
|
-
template.snapshot.name = host[:snapshot]
|
123
|
-
@@vms[host[:template]] = template
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
def self.load_config file
|
128
|
-
@@fog_file
|
129
|
-
end
|
130
|
-
|
131
|
-
def find_vms keys
|
132
|
-
found = {}
|
133
|
-
keys = ([] << keys)
|
134
|
-
keys.flatten!
|
135
|
-
keys.each do |key|
|
136
|
-
if @@vms.has_key?( key )
|
137
|
-
found[key] = @@vms[key]
|
138
|
-
end
|
139
|
-
end
|
140
|
-
found
|
141
|
-
end
|
142
|
-
|
143
|
-
def self.find_vm key
|
144
|
-
if @@vms.has_key?( key )
|
145
|
-
@@vms[key]
|
146
|
-
else
|
147
|
-
nil
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
def find_snapshot vm, snap
|
152
|
-
if @@vms[vm.name].snapshot.name == snap
|
153
|
-
@@vms[vm.name].snapshot
|
154
|
-
else
|
155
|
-
nil
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
def find_customization template
|
160
|
-
nil
|
161
|
-
end
|
162
|
-
|
163
|
-
def find_datastore dc,datastore
|
164
|
-
datastore
|
165
|
-
end
|
166
|
-
|
167
|
-
def find_pool dc,pool
|
168
|
-
pool
|
169
|
-
end
|
170
|
-
|
171
|
-
def find_folder dc,folder
|
172
|
-
folder
|
173
|
-
end
|
174
|
-
|
175
|
-
def wait_for_tasks tasks, try, attempts
|
176
|
-
true
|
177
|
-
end
|
178
|
-
|
179
|
-
def close
|
180
|
-
true
|
181
|
-
end
|
182
|
-
|
183
|
-
end
|