From 278ef6f8297c2a8055b8a5e27092662a85f5d0cc Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Tue, 22 Sep 2020 17:58:06 +0200 Subject: [PATCH] Fix tempest init logic The tempest init was checking if the workspace/etc directory exists, and were creating a new workspace without pass a name, the default is workspace, but passing a --name ensure it won't break if tempest decides to change it. Also, the rename command only change the name in the $HOME/.tempest/workspace.yml, it doesn't change the path for the particular workspace. The same happens with the move command, it just update the path on the workspace.yml file. With this patch, the tempest workspace is being moved properly to a workspace_$CURDATE, all the files are copied to the new workspace, delete the old workspace directory, and call tempest init properly. Also adding tripleo upgrade job as nv for now, since this issue only happen in upgrade jobs. Change-Id: I8a3b79352819f5e980eaea7482cd6b1f1bfc47be Closes-Bug: #1896126 --- tasks/tempest_post_install.yml | 20 ++++++++++++-------- zuul.d/project.yaml | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tasks/tempest_post_install.yml b/tasks/tempest_post_install.yml index 38581655..2ea87619 100644 --- a/tasks/tempest_post_install.yml +++ b/tasks/tempest_post_install.yml @@ -97,15 +97,19 @@ # breakage when we are upgrade from rocky to stein as the workspace # path has been change between these two releases if tempest workspace list | grep ' workspace '; then - if ! tempest workspace list | grep ' workspace ' | grep -w {{ tempest_workspace }}; then - # Init not working on existing entry. Renme old workspace instead and init new. - export CURDATE=$(date +"%d%^b%g_%H%M%S%Z") - tempest workspace rename --old-name workspace --new-name workspace_${CURDATE} - tempest init {{ tempest_workspace }} - fi + # Init not working on existing entry. Renme old workspace instead and init new. + export CURDATE=$(date +"%d%^b%g_%H%M%S%Z") + WSPATH=$(dirname $(tempest workspace list | awk '{if($2 == "workspace"){print $4}}')) + + tempest workspace rename --old-name workspace --new-name workspace_${CURDATE} + + mv ${WSPATH}/workspace ${WSPATH}/workspace_${CURDATE} + tempest workspace move --name workspace_${CURDATE} --path ${WSPATH}/workspace_${CURDATE}/ + tempest init ${CURWORKSPACE} + else + tempest init --name workspace {{ tempest_workspace }} + exit 3 fi - tempest init {{ tempest_workspace }} - exit 3 fi args: executable: /bin/bash diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 0cdd0900..8b6783c1 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -30,6 +30,8 @@ tox_environment: PYTEST_REQPASS: 1 - tripleo-ci-centos-8-standalone + - tripleo-ci-centos-8-standalone-upgrade: + voting: false gate: jobs: - openstack-ansible-deploy-aio_distro_metal_tempestconf-centos-8