Commit cbfb3803 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Improve ERP5 resiliency test

parent 0252a737
......@@ -211,6 +211,7 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
try:
out = subprocess.check_output((mysql_bin, 'erp5', '-e', query), universal_newlines=True)
except subprocess.CalledProcessError:
print("DEBUG: query into erp5.catalog failed before restoration")
out = ''
self.assertNotIn(self._erp5_new_title, out)
......@@ -223,6 +224,15 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
print("Restore mariadb from backup")
subprocess.check_call(mariadb_restore_script)
# Check that the mariadb catalog was properly restored for debugging purposes
try:
out = subprocess.check_output((mysql_bin, 'erp5', '-e', query), universal_newlines=True)
self.assertIn(self._erp5_new_title, out, 'Mariadb catalog is not properly restored')
except subprocess.CalledProcessError:
print("DEBUG: query into erp5.catalog failed after restoration")
except AssertionError:
print("DEBUG: erp5.catalog doesn't contain expected changes after restoration")
# Check that the test instance is properly redeployed after restoring mariadb
# This restarts the services and checks the promises of the test instance
# Process twice to propagate state change
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment