summaryrefslogtreecommitdiff
path: root/gate
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2018-03-06 09:10:27 -0800
committerDan Smith <dansmith@redhat.com>2018-03-07 10:35:32 -0800
commitae241cc68fb8261ca2805a0050171d4596ce546a (patch)
treef1593ad4681a5cc504c0adb362becafb9a2c2eef /gate
parent64635ba18d76057fdc81a459a9a5366044f7441a (diff)
downloadnova-ae241cc68fb8261ca2805a0050171d4596ce546a.tar.gz
Add simple db purge command
This adds a simple purge command to nova-manage. It either deletes all shadow archived data, or data older than a date if provided. This also adds a post-test hook to run purge after archive to validate that it at least works on data generated by a gate run. Related to blueprint purge-db Change-Id: I6f87cf03d49be6bfad2c5e6f0c8accf0fab4e6ee
Diffstat (limited to 'gate')
-rwxr-xr-xgate/post_test_hook.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/gate/post_test_hook.sh b/gate/post_test_hook.sh
index 320c839db5..c56e15569f 100755
--- a/gate/post_test_hook.sh
+++ b/gate/post_test_hook.sh
@@ -18,6 +18,17 @@ function archive_deleted_rows {
done
}
+function purge_db {
+ $MANAGE $* db purge --all --verbose
+ RET=$?
+ if [[ $RET -eq 0 ]]; then
+ echo Purge successful
+ else
+ echo Purge failed with result $RET
+ return $RET
+ fi
+}
+
BASE=${BASE:-/opt/stack}
source ${BASE}/new/devstack/functions-common
source ${BASE}/new/devstack/lib/nova
@@ -29,6 +40,7 @@ cell_conf=$(conductor_conf 1)
conf="--config-file $NOVA_CONF --config-file $cell_conf"
archive_deleted_rows $conf
+purge_db $conf
set -e
# We need to get the admin credentials to run the OSC CLIs for Placement.