summaryrefslogtreecommitdiffstats
path: root/doctor_tests/installer
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2020-02-10 12:22:31 +0200
committerTomi Juvonen <tomi.juvonen@nokia.com>2020-03-11 08:32:49 +0000
commit6ff11513a0d3728c79033af623c79dd6df7c621e (patch)
tree13cddc5776dc82648c771f4b2bf12ac8cdebd56c /doctor_tests/installer
parent34b4083b4d2d579f6dbd334df06fe9394453680a (diff)
VNFM against Fenix API schema validation fix
-Small API changes as Fenix validates API schema -Bug fixes in building Fenix service and container -Need to wait container ready before testing Related: https://review.opendev.org/#/c/706775/ Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com> Change-Id: I8b88865d6b8569c6660513974955f7cd65619a33
Diffstat (limited to 'doctor_tests/installer')
-rw-r--r--doctor_tests/installer/common/set_fenix.sh15
-rw-r--r--doctor_tests/installer/mcp.py22
2 files changed, 21 insertions, 16 deletions
diff --git a/doctor_tests/installer/common/set_fenix.sh b/doctor_tests/installer/common/set_fenix.sh
index 68bb4a6c..bd1eae47 100644
--- a/doctor_tests/installer/common/set_fenix.sh
+++ b/doctor_tests/installer/common/set_fenix.sh
@@ -22,14 +22,15 @@ apt-get install -y docker-ce docker-ce-cli containerd.io
dpkg -r --force-depends golang-docker-credential-helpers
}
-docker ps | grep fenix >/dev/null && {
-REMOTE=`docker exec -ti fenix git rev-parse origin/master`
-LOCAL=`docker exec -ti fenix git rev-parse @`
-if [ $LOCAL = $REMOTE ]; then
- echo "Fenix start: Already running latest"
+docker ps | grep fenix -q && {
+REMOTE=`git ls-remote https://opendev.org/x/fenix HEAD | awk '{ print $1}'`
+LOCAL=`docker exec -t fenix git rev-parse @`
+if [[ "$LOCAL" =~ "$REMOTE" ]]; then
+ # Difference in above string ending marks, so cannot compare equal
+ echo "Fenix start: Already running latest $LOCAL equals $REMOTE"
exit 0
else
- echo "Fenix container needs to be recreated..."
+ echo "Fenix container needs to be recreated $LOCAL not $REMOTE"
# Remove previous container
for img in `docker image list | grep "^fenix" | awk '{print $1}'`; do
for dock in `docker ps --all -f "ancestor=$img" | grep "$img" | awk '{print $1}'`; do
@@ -75,7 +76,7 @@ echo "password = $OS_PASSWORD" >> fenix-api.conf
echo "username = $OS_USERNAME" >> fenix-api.conf
echo "cafile = /opt/stack/data/ca-bundle.pem" >> fenix-api.conf
-openstack service list | grep maintenance | {
+openstack service list | grep -q maintenance || {
openstack service create --name fenix --enable maintenance
openstack endpoint create --region $OS_REGION_NAME --enable fenix public http://localhost:12347/v1
}
diff --git a/doctor_tests/installer/mcp.py b/doctor_tests/installer/mcp.py
index f8f33c83..7659c9e2 100644
--- a/doctor_tests/installer/mcp.py
+++ b/doctor_tests/installer/mcp.py
@@ -129,8 +129,8 @@ class McpInstaller(BaseInstaller):
def set_apply_patches(self):
self.log.info('Set apply patches start......')
fenix_files = None
-
set_scripts = [self.cm_set_script]
+ thrs = []
restart_cmd = 'sudo systemctl restart' \
' ceilometer-agent-notification.service'
@@ -152,10 +152,10 @@ class McpInstaller(BaseInstaller):
'admin_tool/fenix',
fenix_file)
client.scp(src_file, fenix_file)
- self._run_apply_patches(client,
- restart_cmd,
- set_scripts,
- python=self.python)
+ thrs.append(self._run_apply_patches(client,
+ restart_cmd,
+ set_scripts,
+ python=self.python))
time.sleep(5)
self.log.info('Set apply patches start......')
@@ -165,11 +165,15 @@ class McpInstaller(BaseInstaller):
for node_ip in self.computes:
client = SSHClient(node_ip, self.node_user_name,
key_filename=self.key_file)
- self._run_apply_patches(client,
- restart_cmd,
- [self.nc_set_compute_script],
- python=self.python)
+ thrs.append(self._run_apply_patches(
+ client,
+ restart_cmd,
+ [self.nc_set_compute_script],
+ python=self.python))
time.sleep(5)
+ # If Fenix container ir build, it needs to be ready before continue
+ for thr in thrs:
+ thr.join()
def restore_apply_patches(self):
self.log.info('restore apply patches start......')