summaryrefslogtreecommitdiffstats
path: root/doctor_tests/installer/apex.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2018-08-22 09:48:58 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2018-08-23 17:44:49 +0800
commitda25598a6a31abe0579ffed12d1719e5ff75f9a7 (patch)
tree7b51732d5864ea936d907b85a8595bd7c4e6142f /doctor_tests/installer/apex.py
parentf9e1e3b1ae4be80bc2dc61d9c4213c81c091ea72 (diff)
bugfix: add doctor datasource in congress
Change-Id: I465fd6c59daf99dd543488a15819dab78e8cdd7b Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'doctor_tests/installer/apex.py')
-rw-r--r--doctor_tests/installer/apex.py55
1 files changed, 35 insertions, 20 deletions
diff --git a/doctor_tests/installer/apex.py b/doctor_tests/installer/apex.py
index bfa72d32..694adb88 100644
--- a/doctor_tests/installer/apex.py
+++ b/doctor_tests/installer/apex.py
@@ -9,6 +9,7 @@
import re
import time
+from doctor_tests.common.constants import Inspector
from doctor_tests.common.utils import SSHClient
from doctor_tests.installer.base import BaseInstaller
@@ -16,9 +17,11 @@ from doctor_tests.installer.base import BaseInstaller
class ApexInstaller(BaseInstaller):
node_user_name = 'heat-admin'
cm_set_script = 'set_config.py'
- cm_set_compute_script = 'set_compute_config.py'
+ nc_set_compute_script = 'set_compute_config.py'
+ cg_set_script = 'set_congress.py'
cm_restore_script = 'restore_config.py'
- cm_restore_compute_script = 'restore_compute_config.py'
+ nc_restore_compute_script = 'restore_compute_config.py'
+ cg_restore_script = 'restore_congress.py'
def __init__(self, conf, log):
super(ApexInstaller, self).__init__(conf, log)
@@ -92,30 +95,36 @@ class ApexInstaller(BaseInstaller):
def set_apply_patches(self):
self.log.info('Set apply patches start......')
- restart_cm_cmd = 'sudo systemctl restart ' \
- 'openstack-ceilometer-notification.service'
+ restart_cmd = 'sudo systemctl restart' \
+ ' openstack-ceilometer-notification.service'
+
+ set_scripts = [self.cm_set_script]
if self.conf.test_case != 'fault_management':
- restart_cm_cmd += ' openstack-nova-scheduler.service'
+ restart_cmd += ' openstack-nova-scheduler.service'
+
+ if self.conf.inspector.type == Inspector.CONGRESS:
+ restart_cmd += ' openstack-congress-server.service'
+ set_scripts.append(self.cg_set_script)
for node_ip in self.controllers:
client = SSHClient(node_ip, self.node_user_name,
key_filename=self.key_file)
self.controller_clients.append(client)
self._run_apply_patches(client,
- restart_cm_cmd,
- self.cm_set_script)
+ restart_cmd,
+ set_scripts)
if self.conf.test_case != 'fault_management':
- restart_cm_cmd = 'sudo systemctl restart ' \
- 'openstack-nova-compute.service'
+ restart_cmd = 'sudo systemctl restart' \
+ ' openstack-nova-compute.service'
for node_ip in self.computes:
client = SSHClient(node_ip, self.node_user_name,
key_filename=self.key_file)
self.compute_clients.append(client)
self._run_apply_patches(client,
- restart_cm_cmd,
- self.cm_set_compute_script)
+ restart_cmd,
+ [self.nc_set_compute_script])
if self.conf.test_case != 'fault_management':
time.sleep(10)
@@ -123,21 +132,27 @@ class ApexInstaller(BaseInstaller):
def restore_apply_patches(self):
self.log.info('restore apply patches start......')
- restart_cm_cmd = 'sudo systemctl restart ' \
- 'openstack-ceilometer-notification.service'
+ restart_cmd = 'sudo systemctl restart' \
+ ' openstack-ceilometer-notification.service'
+
+ restore_scripts = [self.cm_restore_script]
if self.conf.test_case != 'fault_management':
- restart_cm_cmd += ' openstack-nova-scheduler.service'
+ restart_cmd += ' openstack-nova-scheduler.service'
+
+ if self.conf.inspector.type == Inspector.CONGRESS:
+ restart_cmd += ' openstack-congress-server.service'
+ restore_scripts.append(self.cg_restore_script)
for client in self.controller_clients:
self._run_apply_patches(client,
- restart_cm_cmd,
- self.cm_restore_script)
+ restart_cmd,
+ restore_scripts)
if self.conf.test_case != 'fault_management':
- restart_cm_cmd = 'sudo systemctl restart ' \
- 'openstack-nova-compute.service'
+ restart_cmd = 'sudo systemctl restart' \
+ ' openstack-nova-compute.service'
for client in self.compute_clients:
self._run_apply_patches(client,
- restart_cm_cmd,
- self.cm_restore_compute_script)
+ restart_cmd,
+ [self.nc_restore_compute_script])