summaryrefslogtreecommitdiff
path: root/gate
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2019-08-21 19:15:59 +0000
committermelanie witt <melwittt@gmail.com>2019-08-21 19:21:55 +0000
commitf32671359edc7f87c9f77e58d81e0b4d88bffdbe (patch)
tree0c56ce56bd8793120aca35b7847e16d6575a2512 /gate
parent6ddfad59354d3a7cb77319e378922c35f6c769d9 (diff)
downloadnova-f32671359edc7f87c9f77e58d81e0b4d88bffdbe.tar.gz
Make a failure to purge_db fail in post_test_hook.sh
Currently, the 'purge_db' call occurs before 'set -e', so if and when the database purge fails (return non-zero) it does not cause the script to exit with a failure. This moves the call after 'set -e' to make the script exit with a failure if the database purge step fails. Closes-Bug: #1840967 Change-Id: I6ae27c4e11acafdc0bba8813f47059d084758b4e
Diffstat (limited to 'gate')
-rwxr-xr-xgate/post_test_hook.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/gate/post_test_hook.sh b/gate/post_test_hook.sh
index fd439b8eb5..b338573ec9 100755
--- a/gate/post_test_hook.sh
+++ b/gate/post_test_hook.sh
@@ -43,10 +43,17 @@ cell_conf=$(conductor_conf 1)
# take precedence.
conf="--config-file $NOVA_CONF --config-file $cell_conf"
+# This needs to go before 'set -e' because otherwise the intermediate runs of
+# 'nova-manage db archive_deleted_rows' returning 1 (normal and expected) would
+# cause this script to exit and fail.
archive_deleted_rows $conf
-purge_db
set -e
+
+# This needs to go after 'set -e' because otherwise a failure to purge the
+# database would not cause this script to exit and fail.
+purge_db
+
# We need to get the admin credentials to run the OSC CLIs for Placement.
set +x
source $BASE/devstack/openrc admin