hybrid_platforms_conductor 33.9.0 → 33.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/bin/last_deploys +3 -4
- data/bin/nodes_to_deploy +19 -9
- data/docs/gen/mermaid/README.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/check-node.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/deploy.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/free_ips.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/free_veids.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/get_impacted_nodes.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/last_deploys.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/nodes_to_deploy.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/report.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/run.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/setup.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/ssh_config.md-0.png +0 -0
- data/docs/gen/mermaid/docs/executables/test.md-0.png +0 -0
- data/lib/hybrid_platforms_conductor/actions_executor.rb +2 -2
- data/lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb +2 -2
- data/lib/hybrid_platforms_conductor/config.rb +1 -0
- data/lib/hybrid_platforms_conductor/deployer.rb +19 -13
- data/lib/hybrid_platforms_conductor/executable.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_ip.rb +21 -7
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +1 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/proxmox_waiter.rb +6 -6
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/mediawiki.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/keepass.rb +6 -6
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb +2 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/linear_strategy.rb +1 -1
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/private_ips.rb +1 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/public_ips.rb +1 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +1 -2
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +2 -2
- data/lib/hybrid_platforms_conductor/plugins.rb +4 -3
- data/lib/hybrid_platforms_conductor/tests_runner.rb +2 -2
- data/lib/hybrid_platforms_conductor/topographer.rb +5 -6
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/bash_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +8 -8
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +8 -8
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/helpers_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/timeout_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +44 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb +12 -12
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb +8 -8
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/docker_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/expired_containers_spec.rb +27 -27
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/retries_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb +25 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs_plugins_api_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb +9 -9
- data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/services_deployment_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/platforms_handler_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/plugins_spec.rb +30 -2
- data/spec/hybrid_platforms_conductor_test/api/services_handler/deploy_allowed_spec.rb +7 -7
- data/spec/hybrid_platforms_conductor_test/api/services_handler/package_spec.rb +18 -18
- data/spec/hybrid_platforms_conductor_test/api/services_handler/prepare_for_deploy_spec.rb +30 -30
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/common_spec.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_check_spec.rb +6 -6
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_ssh_spec.rb +6 -6
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb +4 -4
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb +8 -8
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_2.rb +5 -5
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others_2.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/docs_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/check_node_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +75 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/cmd_runner_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_handler_spec.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/tests_runner_spec.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/executables/report_spec.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/executables/run_spec.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/helpers/actions_executor_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/cmdb_helpers.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb +7 -7
- data/spec/hybrid_platforms_conductor_test/helpers/platforms_handler_helpers.rb +3 -3
- data/spec/hybrid_platforms_conductor_test/helpers/provisioner_proxmox_helpers.rb +11 -12
- data/spec/hybrid_platforms_conductor_test/helpers/serverless_chef_helpers.rb +2 -2
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem_with_lib/sub1/lib/sub2/hpc_plugins/test_plugin_type_3/test_plugin_id_5.rb +34 -0
- data/spec/hybrid_platforms_conductor_test/shared_examples/deployer.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/test_connector.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +2 -2
- data/spec/hybrid_platforms_conductor_test.rb +2 -0
- metadata +152 -136
@@ -10,7 +10,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
10
10
|
package: proc do |services:, secrets:, local_environment:|
|
11
11
|
expect(services).to eq('node1' => %w[service1])
|
12
12
|
expect(secrets).to eq({})
|
13
|
-
expect(local_environment).to
|
13
|
+
expect(local_environment).to be false
|
14
14
|
end
|
15
15
|
}
|
16
16
|
) do
|
@@ -31,7 +31,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
31
31
|
package: proc do |services:, secrets:, local_environment:|
|
32
32
|
expect(services).to eq('node1' => %w[service1])
|
33
33
|
expect(secrets).to eq({})
|
34
|
-
expect(local_environment).to
|
34
|
+
expect(local_environment).to be false
|
35
35
|
nbr_calls += 1
|
36
36
|
end
|
37
37
|
}
|
@@ -56,7 +56,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
56
56
|
package: proc do |services:, secrets:, local_environment:|
|
57
57
|
expect(services).to eq('node1' => %w[service1])
|
58
58
|
expect(secrets).to eq({})
|
59
|
-
expect(local_environment).to
|
59
|
+
expect(local_environment).to be false
|
60
60
|
nbr_calls += 1
|
61
61
|
end
|
62
62
|
}
|
@@ -91,7 +91,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
91
91
|
package: proc do |services:, secrets:, local_environment:|
|
92
92
|
expect(services).to eq('node1' => %w[service1])
|
93
93
|
expect(secrets).to eq('my_secret' => 'value')
|
94
|
-
expect(local_environment).to
|
94
|
+
expect(local_environment).to be false
|
95
95
|
end
|
96
96
|
}
|
97
97
|
) do
|
@@ -111,7 +111,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
111
111
|
package: proc do |services:, secrets:, local_environment:|
|
112
112
|
expect(services).to eq('node1' => %w[service1])
|
113
113
|
expect(secrets).to eq({})
|
114
|
-
expect(local_environment).to
|
114
|
+
expect(local_environment).to be true
|
115
115
|
end
|
116
116
|
}
|
117
117
|
) do
|
@@ -137,7 +137,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
137
137
|
package: proc do |services:, secrets:, local_environment:|
|
138
138
|
expect(services).to eq('node1' => %w[service1])
|
139
139
|
expect(secrets).to eq({})
|
140
|
-
expect(local_environment).to
|
140
|
+
expect(local_environment).to be false
|
141
141
|
nbr_calls['platform1'] += 1
|
142
142
|
end
|
143
143
|
},
|
@@ -147,7 +147,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
147
147
|
package: proc do |services:, secrets:, local_environment:|
|
148
148
|
expect(services).to eq('node2' => %w[service2])
|
149
149
|
expect(secrets).to eq({})
|
150
|
-
expect(local_environment).to
|
150
|
+
expect(local_environment).to be false
|
151
151
|
nbr_calls['platform2'] += 1
|
152
152
|
end
|
153
153
|
},
|
@@ -157,7 +157,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
157
157
|
package: proc do |services:, secrets:, local_environment:|
|
158
158
|
expect(services).to eq('node3' => %w[service3])
|
159
159
|
expect(secrets).to eq({})
|
160
|
-
expect(local_environment).to
|
160
|
+
expect(local_environment).to be false
|
161
161
|
nbr_calls['platform3'] += 1
|
162
162
|
end
|
163
163
|
}
|
@@ -190,7 +190,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
190
190
|
package: proc do |services:, secrets:, local_environment:|
|
191
191
|
expect(services).to eq('node1' => %w[service1])
|
192
192
|
expect(secrets).to eq({})
|
193
|
-
expect(local_environment).to
|
193
|
+
expect(local_environment).to be false
|
194
194
|
nbr_calls['platform1'] += 1
|
195
195
|
end
|
196
196
|
},
|
@@ -200,7 +200,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
200
200
|
package: proc do |services:, secrets:, local_environment:|
|
201
201
|
expect(services).to eq('node2' => %w[service2])
|
202
202
|
expect(secrets).to eq({})
|
203
|
-
expect(local_environment).to
|
203
|
+
expect(local_environment).to be false
|
204
204
|
nbr_calls['platform2'] += 1
|
205
205
|
end
|
206
206
|
},
|
@@ -210,7 +210,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
210
210
|
package: proc do |services:, secrets:, local_environment:|
|
211
211
|
expect(services).to eq('node1' => %w[service3])
|
212
212
|
expect(secrets).to eq({})
|
213
|
-
expect(local_environment).to
|
213
|
+
expect(local_environment).to be false
|
214
214
|
nbr_calls['platform3'] += 1
|
215
215
|
end
|
216
216
|
}
|
@@ -243,7 +243,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
243
243
|
package: proc do |services:, secrets:, local_environment:|
|
244
244
|
expect(services).to eq('node' => %w[service1 service2])
|
245
245
|
expect(secrets).to eq({})
|
246
|
-
expect(local_environment).to
|
246
|
+
expect(local_environment).to be false
|
247
247
|
nbr_calls['platform1'] += 1
|
248
248
|
end
|
249
249
|
},
|
@@ -253,7 +253,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
253
253
|
package: proc do |services:, secrets:, local_environment:|
|
254
254
|
expect(services).to eq('node' => %w[service3])
|
255
255
|
expect(secrets).to eq({})
|
256
|
-
expect(local_environment).to
|
256
|
+
expect(local_environment).to be false
|
257
257
|
nbr_calls['platform2'] += 1
|
258
258
|
end
|
259
259
|
},
|
@@ -263,7 +263,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
263
263
|
package: proc do |services:, secrets:, local_environment:|
|
264
264
|
expect(services).to eq('node' => %w[service5 service6])
|
265
265
|
expect(secrets).to eq({})
|
266
|
-
expect(local_environment).to
|
266
|
+
expect(local_environment).to be false
|
267
267
|
nbr_calls['platform3'] += 1
|
268
268
|
end
|
269
269
|
}
|
@@ -296,7 +296,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
296
296
|
package: proc do |services:, secrets:, local_environment:|
|
297
297
|
expect(services).to eq('node1' => %w[service1])
|
298
298
|
expect(secrets).to eq({})
|
299
|
-
expect(local_environment).to
|
299
|
+
expect(local_environment).to be false
|
300
300
|
nbr_calls['platform1'] += 1
|
301
301
|
end
|
302
302
|
},
|
@@ -306,7 +306,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
306
306
|
package: proc do |services:, secrets:, local_environment:|
|
307
307
|
expect(services).to eq('node2' => %w[service2])
|
308
308
|
expect(secrets).to eq({})
|
309
|
-
expect(local_environment).to
|
309
|
+
expect(local_environment).to be false
|
310
310
|
nbr_calls['platform2'] += 1
|
311
311
|
end
|
312
312
|
},
|
@@ -316,7 +316,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
316
316
|
package: proc do |services:, secrets:, local_environment:|
|
317
317
|
expect(services).to eq('node3' => %w[service3])
|
318
318
|
expect(secrets).to eq({})
|
319
|
-
expect(local_environment).to
|
319
|
+
expect(local_environment).to be false
|
320
320
|
nbr_calls['platform3'] += 1
|
321
321
|
end
|
322
322
|
}
|
@@ -355,7 +355,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
355
355
|
package: proc do |services:, secrets:, local_environment:|
|
356
356
|
expect(services).to eq('node1' => %w[service1])
|
357
357
|
expect(secrets).to eq(expected_secrets)
|
358
|
-
expect(local_environment).to
|
358
|
+
expect(local_environment).to be false
|
359
359
|
nbr_calls += 1
|
360
360
|
end
|
361
361
|
}
|
@@ -11,8 +11,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
11
11
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
12
12
|
expect(services).to eq('node1' => %w[service1])
|
13
13
|
expect(secrets).to eq({})
|
14
|
-
expect(local_environment).to
|
15
|
-
expect(why_run).to
|
14
|
+
expect(local_environment).to be false
|
15
|
+
expect(why_run).to be false
|
16
16
|
called = true
|
17
17
|
end
|
18
18
|
}
|
@@ -23,7 +23,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
23
23
|
local_environment: false,
|
24
24
|
why_run: false
|
25
25
|
)
|
26
|
-
expect(called).to
|
26
|
+
expect(called).to be true
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -36,8 +36,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
36
36
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
37
37
|
expect(services).to eq('node1' => %w[service1])
|
38
38
|
expect(secrets).to eq('my_secret' => 'value')
|
39
|
-
expect(local_environment).to
|
40
|
-
expect(why_run).to
|
39
|
+
expect(local_environment).to be false
|
40
|
+
expect(why_run).to be false
|
41
41
|
called = true
|
42
42
|
end
|
43
43
|
}
|
@@ -48,7 +48,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
48
48
|
local_environment: false,
|
49
49
|
why_run: false
|
50
50
|
)
|
51
|
-
expect(called).to
|
51
|
+
expect(called).to be true
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -61,8 +61,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
61
61
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
62
62
|
expect(services).to eq('node1' => %w[service1])
|
63
63
|
expect(secrets).to eq({})
|
64
|
-
expect(local_environment).to
|
65
|
-
expect(why_run).to
|
64
|
+
expect(local_environment).to be true
|
65
|
+
expect(why_run).to be false
|
66
66
|
called = true
|
67
67
|
end
|
68
68
|
}
|
@@ -73,7 +73,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
73
73
|
local_environment: true,
|
74
74
|
why_run: false
|
75
75
|
)
|
76
|
-
expect(called).to
|
76
|
+
expect(called).to be true
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -86,8 +86,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
86
86
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
87
87
|
expect(services).to eq('node1' => %w[service1])
|
88
88
|
expect(secrets).to eq({})
|
89
|
-
expect(local_environment).to
|
90
|
-
expect(why_run).to
|
89
|
+
expect(local_environment).to be false
|
90
|
+
expect(why_run).to be true
|
91
91
|
called = true
|
92
92
|
end
|
93
93
|
}
|
@@ -98,7 +98,7 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
98
98
|
local_environment: false,
|
99
99
|
why_run: true
|
100
100
|
)
|
101
|
-
expect(called).to
|
101
|
+
expect(called).to be true
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
@@ -116,8 +116,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
116
116
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
117
117
|
expect(services).to eq('node1' => %w[service1])
|
118
118
|
expect(secrets).to eq({})
|
119
|
-
expect(local_environment).to
|
120
|
-
expect(why_run).to
|
119
|
+
expect(local_environment).to be false
|
120
|
+
expect(why_run).to be false
|
121
121
|
called['platform1'] = true
|
122
122
|
end
|
123
123
|
},
|
@@ -127,8 +127,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
127
127
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
128
128
|
expect(services).to eq('node2' => %w[service2])
|
129
129
|
expect(secrets).to eq({})
|
130
|
-
expect(local_environment).to
|
131
|
-
expect(why_run).to
|
130
|
+
expect(local_environment).to be false
|
131
|
+
expect(why_run).to be false
|
132
132
|
called['platform2'] = true
|
133
133
|
end
|
134
134
|
},
|
@@ -138,8 +138,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
138
138
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
139
139
|
expect(services).to eq('node3' => %w[service3])
|
140
140
|
expect(secrets).to eq({})
|
141
|
-
expect(local_environment).to
|
142
|
-
expect(why_run).to
|
141
|
+
expect(local_environment).to be false
|
142
|
+
expect(why_run).to be false
|
143
143
|
called['platform3'] = true
|
144
144
|
end
|
145
145
|
}
|
@@ -173,8 +173,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
173
173
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
174
174
|
expect(services).to eq('node1' => %w[service1])
|
175
175
|
expect(secrets).to eq({})
|
176
|
-
expect(local_environment).to
|
177
|
-
expect(why_run).to
|
176
|
+
expect(local_environment).to be false
|
177
|
+
expect(why_run).to be false
|
178
178
|
called['platform1'] = true
|
179
179
|
end
|
180
180
|
},
|
@@ -184,8 +184,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
184
184
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
185
185
|
expect(services).to eq('node2' => %w[service2])
|
186
186
|
expect(secrets).to eq({})
|
187
|
-
expect(local_environment).to
|
188
|
-
expect(why_run).to
|
187
|
+
expect(local_environment).to be false
|
188
|
+
expect(why_run).to be false
|
189
189
|
called['platform2'] = true
|
190
190
|
end
|
191
191
|
},
|
@@ -195,8 +195,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
195
195
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
196
196
|
expect(services).to eq('node1' => %w[service3])
|
197
197
|
expect(secrets).to eq({})
|
198
|
-
expect(local_environment).to
|
199
|
-
expect(why_run).to
|
198
|
+
expect(local_environment).to be false
|
199
|
+
expect(why_run).to be false
|
200
200
|
called['platform3'] = true
|
201
201
|
end
|
202
202
|
}
|
@@ -230,8 +230,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
230
230
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
231
231
|
expect(services).to eq('node' => %w[service1 service2])
|
232
232
|
expect(secrets).to eq({})
|
233
|
-
expect(local_environment).to
|
234
|
-
expect(why_run).to
|
233
|
+
expect(local_environment).to be false
|
234
|
+
expect(why_run).to be false
|
235
235
|
called['platform1'] = true
|
236
236
|
end
|
237
237
|
},
|
@@ -241,8 +241,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
241
241
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
242
242
|
expect(services).to eq('node' => %w[service3])
|
243
243
|
expect(secrets).to eq({})
|
244
|
-
expect(local_environment).to
|
245
|
-
expect(why_run).to
|
244
|
+
expect(local_environment).to be false
|
245
|
+
expect(why_run).to be false
|
246
246
|
called['platform2'] = true
|
247
247
|
end
|
248
248
|
},
|
@@ -252,8 +252,8 @@ describe HybridPlatformsConductor::ServicesHandler do
|
|
252
252
|
prepare_for_deploy: proc do |services:, secrets:, local_environment:, why_run:|
|
253
253
|
expect(services).to eq('node' => %w[service5 service6])
|
254
254
|
expect(secrets).to eq({})
|
255
|
-
expect(local_environment).to
|
256
|
-
expect(why_run).to
|
255
|
+
expect(local_environment).to be false
|
256
|
+
expect(why_run).to be false
|
257
257
|
called['platform3'] = true
|
258
258
|
end
|
259
259
|
}
|
@@ -140,7 +140,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
140
140
|
register_test_plugins(test_tests_runner, several_tests: HybridPlatformsConductorTest::TestPlugins::SeveralChecks)
|
141
141
|
# Mock the Actions Executor and Deployer expected calls
|
142
142
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
143
|
-
expect(test_deployer.use_why_run).to
|
143
|
+
expect(test_deployer.use_why_run).to be true
|
144
144
|
{
|
145
145
|
'node11' => [0, 'node11 check ok', 'node11 stderr'],
|
146
146
|
'node12' => [0, 'node12 check ok', 'node12 stderr'],
|
@@ -153,7 +153,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
153
153
|
expect(actions.size).to eq node_suffixes.size
|
154
154
|
node_suffixes.each do |node_suffix|
|
155
155
|
node = "node#{node_suffix}"
|
156
|
-
expect(actions.key?(node)).to
|
156
|
+
expect(actions.key?(node)).to be true
|
157
157
|
expect(actions[node].size).to eq 1
|
158
158
|
expect(actions[node][:remote_bash]).to eq [
|
159
159
|
'echo \'===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====\'',
|
@@ -162,7 +162,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
162
162
|
'echo "$?"'
|
163
163
|
]
|
164
164
|
end
|
165
|
-
node_suffixes.
|
165
|
+
node_suffixes.to_h do |node_suffix|
|
166
166
|
[
|
167
167
|
"node#{node_suffix}",
|
168
168
|
[
|
@@ -178,7 +178,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
178
178
|
EO_STDERR
|
179
179
|
]
|
180
180
|
]
|
181
|
-
end
|
181
|
+
end
|
182
182
|
end])
|
183
183
|
# Run everything
|
184
184
|
test_tests_runner.tests = [:several_tests]
|
@@ -207,7 +207,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
207
207
|
with_test_platform({ tests: { specific_platform_handler_test: SpecificPlatformHandlerTest } }) do
|
208
208
|
test_tests_runner.tests = [:specific_platform_handler_test]
|
209
209
|
expect(test_tests_runner.run_tests([])).to eq 0
|
210
|
-
expect(SpecificPlatformHandlerTest.run).to
|
210
|
+
expect(SpecificPlatformHandlerTest.run).to be true
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
@@ -26,7 +26,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
26
26
|
with_test_platform_for_node_check_tests do
|
27
27
|
test_tests_runner.tests = [:node_check_test]
|
28
28
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
29
|
-
expect(test_deployer.use_why_run).to
|
29
|
+
expect(test_deployer.use_why_run).to be true
|
30
30
|
{
|
31
31
|
'node11' => [0, 'node11 check ok', 'node11 stderr'],
|
32
32
|
'node12' => [0, 'node12 check ok', 'node12 stderr'],
|
@@ -48,7 +48,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
48
48
|
with_test_platform_for_node_check_tests do
|
49
49
|
test_tests_runner.tests = [:node_check_test]
|
50
50
|
expect(test_deployer).to receive(:deploy_on).with(%w[node12 node22]).once do
|
51
|
-
expect(test_deployer.use_why_run).to
|
51
|
+
expect(test_deployer.use_why_run).to be true
|
52
52
|
{
|
53
53
|
'node12' => [0, 'node12 check ok', 'node12 stderr'],
|
54
54
|
'node22' => [0, 'node22 check ok', 'node22 stderr']
|
@@ -66,7 +66,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
66
66
|
with_test_platform_for_node_check_tests do
|
67
67
|
test_tests_runner.tests = %i[node_check_test node_check_test_2]
|
68
68
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
69
|
-
expect(test_deployer.use_why_run).to
|
69
|
+
expect(test_deployer.use_why_run).to be true
|
70
70
|
{
|
71
71
|
'node11' => [0, 'node11 check ok', 'node11 stderr'],
|
72
72
|
'node12' => [0, 'node12 check ok', 'node12 stderr'],
|
@@ -92,7 +92,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
92
92
|
with_test_platform_for_node_check_tests do
|
93
93
|
test_tests_runner.tests = [:node_check_test]
|
94
94
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
95
|
-
expect(test_deployer.use_why_run).to
|
95
|
+
expect(test_deployer.use_why_run).to be true
|
96
96
|
{
|
97
97
|
'node11' => [0, 'node11 check ok', 'node11 stderr'],
|
98
98
|
'node12' => [1, 'node12 check ok', 'node12 stderr'],
|
@@ -114,7 +114,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
114
114
|
with_test_platform_for_node_check_tests do
|
115
115
|
test_tests_runner.tests = [:node_check_test]
|
116
116
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
117
|
-
expect(test_deployer.use_why_run).to
|
117
|
+
expect(test_deployer.use_why_run).to be true
|
118
118
|
{
|
119
119
|
'node11' => [0, 'node11 check ok', 'node11 stderr'],
|
120
120
|
'node12' => [1, 'node12 check ok', 'node12 stderr'],
|
@@ -178,7 +178,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
178
178
|
HybridPlatformsConductorTest::TestPlugins::NodeCheck.only_on_nodes = %w[node12 node22]
|
179
179
|
test_tests_runner.tests = [:node_check_test]
|
180
180
|
expect(test_deployer).to receive(:deploy_on).with(%w[node12 node22]).once do
|
181
|
-
expect(test_deployer.use_why_run).to
|
181
|
+
expect(test_deployer.use_why_run).to be true
|
182
182
|
{
|
183
183
|
'node12' => [0, 'node12 check ok', 'node12 stderr'],
|
184
184
|
'node22' => [0, 'node22 check ok', 'node22 stderr']
|
@@ -34,7 +34,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
34
34
|
expect(actions.size).to eq node_suffixes.size
|
35
35
|
node_suffixes.each do |node_suffix|
|
36
36
|
node = "node#{node_suffix}"
|
37
|
-
expect(actions.key?(node)).to
|
37
|
+
expect(actions.key?(node)).to be true
|
38
38
|
expect(actions[node].size).to eq 1
|
39
39
|
expect(actions[node][:remote_bash]).to eq [
|
40
40
|
'echo \'===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====\'',
|
@@ -43,7 +43,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
43
43
|
'echo "$?"'
|
44
44
|
]
|
45
45
|
end
|
46
|
-
node_suffixes.
|
46
|
+
node_suffixes.to_h do |node_suffix|
|
47
47
|
[
|
48
48
|
"node#{node_suffix}",
|
49
49
|
[
|
@@ -59,7 +59,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
59
59
|
EO_STDERR
|
60
60
|
]
|
61
61
|
]
|
62
|
-
end
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
it 'executes SSH node tests once per node with the correct command' do
|
@@ -120,7 +120,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
120
120
|
expect(actions.size).to eq node_suffixes.size
|
121
121
|
node_suffixes.each do |node_suffix|
|
122
122
|
node = "node#{node_suffix}"
|
123
|
-
expect(actions.key?(node)).to
|
123
|
+
expect(actions.key?(node)).to be true
|
124
124
|
expect(actions[node].size).to eq 1
|
125
125
|
expect(actions[node][:remote_bash]).to eq [
|
126
126
|
'echo \'===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====\'',
|
@@ -133,7 +133,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
133
133
|
'echo "$?"'
|
134
134
|
]
|
135
135
|
end
|
136
|
-
node_suffixes.
|
136
|
+
node_suffixes.to_h do |node_suffix|
|
137
137
|
[
|
138
138
|
"node#{node_suffix}",
|
139
139
|
[
|
@@ -154,7 +154,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
154
154
|
EO_STDERR
|
155
155
|
]
|
156
156
|
]
|
157
|
-
end
|
157
|
+
end
|
158
158
|
end])
|
159
159
|
test_tests_runner.tests = %i[node_ssh_test node_ssh_test_2]
|
160
160
|
ssh_executions = []
|
@@ -208,7 +208,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
208
208
|
with_test_platforms_for_reports_test do
|
209
209
|
# Mock the Actions Executor and Deployer expected calls
|
210
210
|
expect(test_deployer).to receive(:deploy_on).with(%w[node11 node12 node21 node22]).once do
|
211
|
-
expect(test_deployer.use_why_run).to
|
211
|
+
expect(test_deployer.use_why_run).to be true
|
212
212
|
{
|
213
213
|
'node11' => [0, 'node11 check ok', 'node11 stderr'],
|
214
214
|
'node12' => [0, 'node12 check ok', 'node12 stderr'],
|
@@ -221,7 +221,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
221
221
|
expect(actions.size).to eq node_suffixes.size
|
222
222
|
node_suffixes.each do |node_suffix|
|
223
223
|
node = "node#{node_suffix}"
|
224
|
-
expect(actions.key?(node)).to
|
224
|
+
expect(actions.key?(node)).to be true
|
225
225
|
expect(actions[node].size).to eq 1
|
226
226
|
expect(actions[node][:remote_bash]).to eq [
|
227
227
|
'echo \'===== TEST COMMAND EXECUTION ===== Separator generated by Hybrid Platforms Conductor test framework =====\'',
|
@@ -230,7 +230,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
230
230
|
'echo "$?"'
|
231
231
|
]
|
232
232
|
end
|
233
|
-
node_suffixes.
|
233
|
+
node_suffixes.to_h do |node_suffix|
|
234
234
|
[
|
235
235
|
"node#{node_suffix}",
|
236
236
|
[
|
@@ -246,7 +246,7 @@ describe HybridPlatformsConductor::TestsRunner do
|
|
246
246
|
EO_STDERR
|
247
247
|
]
|
248
248
|
]
|
249
|
-
end
|
249
|
+
end
|
250
250
|
end])
|
251
251
|
# Run everything
|
252
252
|
test_tests_runner.tests = [:several_tests]
|
@@ -40,7 +40,7 @@ module HybridPlatformsConductorTest
|
|
40
40
|
# Nodes for which the property can't be fetched can be ommitted.
|
41
41
|
def get_upcase(nodes, metadata)
|
42
42
|
record_call(:get_upcase, nodes, metadata)
|
43
|
-
nodes.
|
43
|
+
nodes.to_h { |node| [node, node.upcase] }
|
44
44
|
end
|
45
45
|
|
46
46
|
# Get a specific property for a given set of nodes.
|
@@ -55,7 +55,7 @@ module HybridPlatformsConductorTest
|
|
55
55
|
# Nodes for which the property can't be fetched can be ommitted.
|
56
56
|
def get_double(nodes, metadata)
|
57
57
|
record_call(:get_double, nodes, metadata)
|
58
|
-
nodes.
|
58
|
+
nodes.to_h { |node| [node, node * 2] }
|
59
59
|
end
|
60
60
|
|
61
61
|
# Get a specific property for a given set of nodes.
|
@@ -70,7 +70,7 @@ module HybridPlatformsConductorTest
|
|
70
70
|
# Nodes for which the property can't be fetched can be ommitted.
|
71
71
|
def get_reversed_double(nodes, metadata)
|
72
72
|
record_call(:get_reversed_double, nodes, metadata)
|
73
|
-
nodes.
|
73
|
+
nodes.to_h { |node| [node, metadata[node][:double].reverse] }
|
74
74
|
end
|
75
75
|
|
76
76
|
# Get a specific property for a given set of nodes.
|
@@ -85,7 +85,7 @@ module HybridPlatformsConductorTest
|
|
85
85
|
# Nodes for which the property can't be fetched can be ommitted.
|
86
86
|
def get_reversed_downcase(nodes, metadata)
|
87
87
|
record_call(:get_reversed_downcase, nodes, metadata)
|
88
|
-
nodes.
|
88
|
+
nodes.to_h { |node| [node, metadata[node][:downcase] ? metadata[node][:downcase].reverse : 'UNKNOWN'] }
|
89
89
|
end
|
90
90
|
|
91
91
|
# Get a specific property for a given set of nodes.
|
@@ -115,7 +115,7 @@ module HybridPlatformsConductorTest
|
|
115
115
|
# Nodes for which the property can't be fetched can be ommitted.
|
116
116
|
def get_same_comment(nodes, metadata)
|
117
117
|
record_call(:get_same_comment, nodes, metadata)
|
118
|
-
nodes.
|
118
|
+
nodes.to_h { |node| [node, "Comment for #{node}"] }
|
119
119
|
end
|
120
120
|
|
121
121
|
# Get a specific property for a given set of nodes.
|
@@ -130,7 +130,7 @@ module HybridPlatformsConductorTest
|
|
130
130
|
# Nodes for which the property can't be fetched can be ommitted.
|
131
131
|
def get_different_comment(nodes, metadata)
|
132
132
|
record_call(:get_different_comment, nodes, metadata)
|
133
|
-
nodes.
|
133
|
+
nodes.to_h { |node| [node, 'Comment from test_cmdb'] }
|
134
134
|
end
|
135
135
|
|
136
136
|
# Get a specific property for a given set of nodes.
|
@@ -145,7 +145,7 @@ module HybridPlatformsConductorTest
|
|
145
145
|
# Nodes for which the property can't be fetched can be ommitted.
|
146
146
|
def get_different_comment_2(nodes, metadata)
|
147
147
|
record_call(:get_different_comment_2, nodes, metadata)
|
148
|
-
nodes.
|
148
|
+
nodes.to_h { |node| [node, 'Comment2 from test_cmdb'] }
|
149
149
|
end
|
150
150
|
|
151
151
|
# Register a call to be checked by the tests later
|
@@ -156,7 +156,7 @@ module HybridPlatformsConductorTest
|
|
156
156
|
def record_call(method, *args)
|
157
157
|
@calls = [] unless defined?(@calls)
|
158
158
|
# Create a shallow copy of the args, just to make sure they won't get changed by later code
|
159
|
-
@calls << [method] + Marshal.load(Marshal.dump(args))
|
159
|
+
@calls << ([method] + Marshal.load(Marshal.dump(args)))
|
160
160
|
end
|
161
161
|
|
162
162
|
end
|
@@ -27,7 +27,7 @@ module HybridPlatformsConductorTest
|
|
27
27
|
def get_nothing(nodes, metadata)
|
28
28
|
record_call(:get_nothing, nodes, metadata)
|
29
29
|
# Here we return something to test that if the first one fails we have the second CMDB
|
30
|
-
nodes.
|
30
|
+
nodes.to_h { |node| [node, "#{node} has nothing"] }
|
31
31
|
end
|
32
32
|
|
33
33
|
# Get a specific property for a given set of nodes.
|
@@ -42,7 +42,7 @@ module HybridPlatformsConductorTest
|
|
42
42
|
# Nodes for which the property can't be fetched can be ommitted.
|
43
43
|
def get_same_comment(nodes, metadata)
|
44
44
|
record_call(:get_same_comment, nodes, metadata)
|
45
|
-
nodes.
|
45
|
+
nodes.to_h { |node| [node, "Comment for #{node}"] }
|
46
46
|
end
|
47
47
|
|
48
48
|
# Get a specific property for a given set of nodes.
|
@@ -57,7 +57,7 @@ module HybridPlatformsConductorTest
|
|
57
57
|
# Nodes for which the property can't be fetched can be ommitted.
|
58
58
|
def get_different_comment(nodes, metadata)
|
59
59
|
record_call(:get_different_comment, nodes, metadata)
|
60
|
-
nodes.
|
60
|
+
nodes.to_h { |node| [node, 'Comment from test_cmdb_2'] }
|
61
61
|
end
|
62
62
|
|
63
63
|
# Get a specific property for a given set of nodes.
|
@@ -72,7 +72,7 @@ module HybridPlatformsConductorTest
|
|
72
72
|
# Nodes for which the property can't be fetched can be ommitted.
|
73
73
|
def get_different_comment_2(nodes, metadata)
|
74
74
|
record_call(:get_different_comment_2, nodes, metadata)
|
75
|
-
nodes.
|
75
|
+
nodes.to_h { |node| [node, 'Comment2 from test_cmdb_2'] }
|
76
76
|
end
|
77
77
|
|
78
78
|
# Register a call to be checked by the tests later
|
@@ -83,7 +83,7 @@ module HybridPlatformsConductorTest
|
|
83
83
|
def record_call(method, *args)
|
84
84
|
@calls = [] unless defined?(@calls)
|
85
85
|
# Create a shallow copy of the args, just to make sure they won't get changed by later code
|
86
|
-
@calls << [method] + Marshal.load(Marshal.dump(args))
|
86
|
+
@calls << ([method] + Marshal.load(Marshal.dump(args)))
|
87
87
|
end
|
88
88
|
|
89
89
|
end
|
@@ -30,7 +30,7 @@ module HybridPlatformsConductorTest
|
|
30
30
|
# Nodes for which the property can't be fetched can be ommitted.
|
31
31
|
def get_others(nodes, metadata)
|
32
32
|
record_call(:get_others, nodes, metadata)
|
33
|
-
nodes.
|
33
|
+
nodes.to_h do |node|
|
34
34
|
[
|
35
35
|
node,
|
36
36
|
{
|
@@ -39,7 +39,7 @@ module HybridPlatformsConductorTest
|
|
39
39
|
nothing: "#{node} has another nothing"
|
40
40
|
}
|
41
41
|
]
|
42
|
-
end
|
42
|
+
end
|
43
43
|
end
|
44
44
|
|
45
45
|
# Register a call to be checked by the tests later
|
@@ -50,7 +50,7 @@ module HybridPlatformsConductorTest
|
|
50
50
|
def record_call(method, *args)
|
51
51
|
@calls = [] unless defined?(@calls)
|
52
52
|
# Create a shallow copy of the args, just to make sure they won't get changed by later code
|
53
|
-
@calls << [method] + Marshal.load(Marshal.dump(args))
|
53
|
+
@calls << ([method] + Marshal.load(Marshal.dump(args)))
|
54
54
|
end
|
55
55
|
|
56
56
|
end
|