summaryrefslogtreecommitdiff
path: root/gate
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2019-10-11 20:58:03 +0000
committermelanie witt <melwittt@gmail.com>2019-10-14 06:03:44 +0000
commit7c41365f193fd5b08d0174b6cd8e349ac95b7907 (patch)
treedb1e2886820d9ff98decc60b7206e53fdcde9e50 /gate
parent27818dd607936209d8d73f534d64ba74fb2dd7f0 (diff)
downloadnova-7c41365f193fd5b08d0174b6cd8e349ac95b7907.tar.gz
Add regression test for bug 1824435
This adds a regression test in our post test hook. We are not able to do a similar test in the unit or functional tests because SQLite does not provide any isolation between transactions on the same database connection [1] and the bug can only be reproduced with the isolation that is present when using a real MySQL database. Related-Bug: #1824435 [1] https://www.sqlite.org/isolation.html Change-Id: I204361d6ff7c2323bc744878d8a9fa2d20a480b1
Diffstat (limited to 'gate')
-rwxr-xr-xgate/post_test_hook.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/gate/post_test_hook.sh b/gate/post_test_hook.sh
index 3fb0595e18..cf2645574c 100755
--- a/gate/post_test_hook.sh
+++ b/gate/post_test_hook.sh
@@ -22,7 +22,10 @@ function archive_deleted_rows {
if [[ $RET -gt 1 ]]; then
echo Archiving failed with result $RET
return $RET
- elif [[ $RET -eq 0 ]]; then
+ # When i = 1, we only archive cell0 (without --all-cells), so run at
+ # least twice to ensure --all-cells are archived before considering
+ # archiving complete.
+ elif [[ $RET -eq 0 && $i -gt 1 ]]; then
echo Archiving Complete
break;
fi
@@ -250,3 +253,26 @@ if [[ "$my_key" == "" ]]; then
echo "During heal port allocation our extra key in the binding:profile was deleted."
exit 2
fi
+
+echo "Verifying online_data_migrations idempotence"
+# We will re-use the server created earlier for this test. (A server needs to
+# be present during the run of online_data_migrations and archiving).
+
+# Run the online data migrations before archiving.
+$MANAGE db online_data_migrations
+
+# We need to archive the deleted marker instance used by the
+# fill_virtual_interface_list online data migration in order to trigger
+# creation of a new deleted marker instance.
+set +e
+archive_deleted_rows
+
+# Verify whether online data migrations run after archiving will succeed.
+# See for more details: https://bugs.launchpad.net/nova/+bug/1824435
+$MANAGE db online_data_migrations
+rc=$?
+set -e
+if [[ $rc -ne 2 ]]; then
+ echo "Expected return code 2 from online_data_migrations until bug 1824435 is fixed"
+ exit 2
+fi