summaryrefslogtreecommitdiffstats
path: root/doctor_tests/installer/base.py
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2018-01-17 10:20:44 +0200
committerTomi Juvonen <tomi.juvonen@nokia.com>2018-08-09 12:08:49 +0300
commitb54cbc5dd2d32fcb27238680b4657ed384d021c5 (patch)
tree4a7e648892d8d1c0efe50e276452a45c754303fb /doctor_tests/installer/base.py
parentb2bb504032ac81a2ed3f404113b097d9ce3d7f14 (diff)
Add setup and cleanup for maintenance test
JIRA: DOCTOR-106 Change-Id: Idb95e1391e8f9094f68e2c7bc79fd2d7e01af9de Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
Diffstat (limited to 'doctor_tests/installer/base.py')
-rw-r--r--doctor_tests/installer/base.py38
1 files changed, 25 insertions, 13 deletions
diff --git a/doctor_tests/installer/base.py b/doctor_tests/installer/base.py
index f37b7f1a..4eed3f29 100644
--- a/doctor_tests/installer/base.py
+++ b/doctor_tests/installer/base.py
@@ -58,21 +58,33 @@ class BaseInstaller(object):
def setup_stunnel(self):
self.log.info('Setup ssh stunnel in %s installer......'
% self.conf.installer.type)
+ tunnels = [self.conf.consumer.port]
+ if self.conf.test_case == 'maintenance':
+ tunnel_uptime = 1200
+ tunnels += [self.conf.app_manager.port, self.conf.inspector.port]
+ elif self.conf.test_case == 'all':
+ tunnel_uptime = 1800
+ tunnels += [self.conf.app_manager.port, self.conf.inspector.port]
+ else:
+ tunnel_uptime = 600
for node_ip in self.controllers:
- cmd = ("ssh -o UserKnownHostsFile=/dev/null"
- " -o StrictHostKeyChecking=no"
- " -i %s %s@%s -R %s:localhost:%s"
- " sleep 600 > ssh_tunnel.%s"
- " 2>&1 < /dev/null "
- % (self.key_file,
- self.node_user_name,
- node_ip,
- self.conf.consumer.port,
- self.conf.consumer.port,
- node_ip))
- server = subprocess.Popen('exec ' + cmd, shell=True)
- self.servers.append(server)
+ for port in tunnels:
+ self.log.info('tunnel for port %s' % port)
+ cmd = ("ssh -o UserKnownHostsFile=/dev/null"
+ " -o StrictHostKeyChecking=no"
+ " -i %s %s@%s -R %s:localhost:%s"
+ " sleep %s > ssh_tunnel.%s"
+ " 2>&1 < /dev/null "
+ % (self.key_file,
+ self.node_user_name,
+ node_ip,
+ port,
+ port,
+ tunnel_uptime,
+ node_ip))
+ server = subprocess.Popen('exec ' + cmd, shell=True)
+ self.servers.append(server)
def _get_ssh_key(self, client, key_path):
self.log.info('Get SSH keys from %s installer......'