Merge "Add a post-test-hook to run the archive command"
This commit is contained in:
4
tools/hooks/README
Normal file
4
tools/hooks/README
Normal file
@@ -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.
|
||||
17
tools/hooks/post_test_hook.sh
Executable file
17
tools/hooks/post_test_hook.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user