hybrid_platforms_conductor 32.7.3 → 32.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +1 -0
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test.rb +1 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +23 -0
- data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +8 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 539ccbcddce0dda10361f172eb18b5db378aa6e299117e4c25f3416a0e5eb3f8
|
4
|
+
data.tar.gz: 9e3f5c649cbc70399b462698d80794a56ce4e141b552d88df809373cb0e33b3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f665a9dd0e2aed5c3e78fee2840db66eaa67374e81609042c42687ec65a86621ad1d6f5d0c25578526b19b8f3f534dc1c4330b5956348b83928138d0a6e30509
|
7
|
+
data.tar.gz: 4d7cc60f030cfe9ab7c24053b4c1fa2ef440c95a8170685157de7c4f25d54fc8d2b469303baffb98214d58e39613ae116bf42df0991832e68b8046c9b7eccae1
|
@@ -512,6 +512,7 @@ module HybridPlatformsConductor
|
|
512
512
|
end
|
513
513
|
out 'External ControlMaster has been spawned.'
|
514
514
|
out 'Please login into it, keep its session opened and press enter here when done...'
|
515
|
+
raise "Can't spawn interactive ControlMaster to #{node} in non-interactive mode. You may want to change the hpc_interactive env variable." if ENV['hpc_interactive'] == 'false'
|
515
516
|
$stdin.gets
|
516
517
|
exit_status = 0
|
517
518
|
else
|
@@ -94,6 +94,7 @@ module HybridPlatformsConductorTest
|
|
94
94
|
ENV.delete 'hpc_password_for_thycotic'
|
95
95
|
ENV.delete 'hpc_domain_for_thycotic'
|
96
96
|
ENV.delete 'hpc_certificates'
|
97
|
+
ENV.delete 'hpc_interactive'
|
97
98
|
# Set the necessary Hybrid Platforms Conductor environment variables
|
98
99
|
ENV['hpc_ssh_user'] = 'test_user'
|
99
100
|
HybridPlatformsConductor::ServicesHandler.packaged_deployments.clear
|
data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb
CHANGED
@@ -44,6 +44,29 @@ describe HybridPlatformsConductor::ActionsExecutor do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
it 'can\'t create an SSH master to 1 node not having Session Exec capabilities when hpc_interactive is false' do
|
48
|
+
with_test_platform(nodes: { 'node' => { meta: { host_ip: '192.168.42.42', ssh_session_exec: 'false' } } }) do
|
49
|
+
ENV['hpc_interactive'] = 'false'
|
50
|
+
with_cmd_runner_mocked(
|
51
|
+
[
|
52
|
+
['which env', proc { [0, "/usr/bin/env\n", ''] }],
|
53
|
+
['ssh -V 2>&1', proc { [0, "OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u 20 Dec 2019\n", ''] }]
|
54
|
+
] + ssh_expected_commands_for(
|
55
|
+
{ 'node' => { connection: '192.168.42.42', user: 'test_user' } },
|
56
|
+
with_control_master_create_optional: true,
|
57
|
+
with_control_master_destroy: false,
|
58
|
+
with_session_exec: false
|
59
|
+
)
|
60
|
+
) do
|
61
|
+
test_connector.ssh_user = 'test_user'
|
62
|
+
expect do
|
63
|
+
test_connector.with_connection_to(['node']) do
|
64
|
+
end
|
65
|
+
end.to raise_error 'Can\'t spawn interactive ControlMaster to node in non-interactive mode. You may want to change the hpc_interactive env variable.'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
47
70
|
it 'creates SSH master to several nodes' do
|
48
71
|
with_test_platform(nodes: {
|
49
72
|
'node1' => { meta: { host_ip: '192.168.42.1' } },
|
@@ -54,13 +54,15 @@ module HybridPlatformsConductorTest
|
|
54
54
|
if with_session_exec
|
55
55
|
/^.+\/ssh #{with_batch_mode ? '-o BatchMode=yes ' : ''}-o ControlMaster=yes -o ControlPersist=yes hpc\.#{Regexp.escape(node)} true$/
|
56
56
|
else
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
unless ENV['hpc_interactive'] == 'false'
|
58
|
+
# Mock the user hitting enter as the Control Master will be created in another thread and the main thread waits for user input.
|
59
|
+
expect($stdin).to receive(:gets) do
|
60
|
+
# We have to wait for the Control Master creation thread to actually create the Control Master before hitting Enter.
|
61
|
+
while !control_master_created do
|
62
|
+
sleep 0.1
|
63
|
+
end
|
64
|
+
"\n"
|
62
65
|
end
|
63
|
-
"\n"
|
64
66
|
end
|
65
67
|
/^xterm -e '.+\/ssh -o ControlMaster=yes -o ControlPersist=yes hpc\.#{Regexp.escape(node)}'$/
|
66
68
|
end,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hybrid_platforms_conductor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 32.
|
4
|
+
version: 32.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muriel Salvan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: range_operators
|