summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2016-09-26 09:19:40 -0700
committerSean Dague <sean@dague.net>2016-09-28 13:28:55 +0000
commit6f988105ac86309c5308e2da88428ed6bff8b180 (patch)
tree24b0746514be80ba0547e05709eb37255aaa53bf /tools
parentc46385f3cfdef89849e7bed0a3e2fd579cbab3cb (diff)
downloadnova-6f988105ac86309c5308e2da88428ed6bff8b180.tar.gz
Add a post-test-hook to run the archive command
The archive_deleted_rows command in nova-manage is often-broken and not well tested by us. We can test it to some degree in functional tests, but running it against a real database with real deleted stuff in it is a good idea. This adds a post-test hook and runs the archive so that after a full test run in the gate, we'll see the output. Later, we should make a failed run of this fatal, but for now, just run it so we can see how close we are to being able to gate on it. Change-Id: I16b2e00eede6af455cb74ca4e6ca951d56fdbcbc
Diffstat (limited to 'tools')
-rw-r--r--tools/hooks/README4
-rwxr-xr-xtools/hooks/post_test_hook.sh17
2 files changed, 21 insertions, 0 deletions
diff --git a/tools/hooks/README b/tools/hooks/README
new file mode 100644
index 0000000000..b7df206546
--- /dev/null
+++ b/tools/hooks/README
@@ -0,0 +1,4 @@
+These are hooks to be used by the OpenStack infra test system. These scripts
+may be called by certain jobs at important times to do extra testing, setup,
+etc. They are really only relevant within the scope of the OpenStack infra
+system and are not expected to be useful to anyone else.
diff --git a/tools/hooks/post_test_hook.sh b/tools/hooks/post_test_hook.sh
new file mode 100755
index 0000000000..72237a1e26
--- /dev/null
+++ b/tools/hooks/post_test_hook.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -x
+
+MANAGE="/usr/local/bin/nova-manage"
+
+function archive_deleted_rows {
+ # NOTE(danms): Run this a few times to make sure that we end
+ # up with nothing more to archive
+ for i in `seq 30`; do
+ out=$($MANAGE db archive_deleted_rows --verbose --max_rows 1000)
+ echo $?
+ if [[ $out =~ "Nothing was archived" ]]; then
+ break;
+ fi
+ done
+}
+
+archive_deleted_rows