Module: check_mk
Branch: master
Commit: c41c5869ee0934c86e7299af37b2038d333783de
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c41c5869ee0934…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 11 13:05:22 2019 +0100
Backup restore tests: Recover from stopped sites on failures
Change-Id: Iaf1d1cd434f994d097403c2cc059d7d3ed087b39
---
tests/integration/bin/test_mkbackup.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tests/integration/bin/test_mkbackup.py
b/tests/integration/bin/test_mkbackup.py
index 1cfcbc7..bbd89c9 100644
--- a/tests/integration/bin/test_mkbackup.py
+++ b/tests/integration/bin/test_mkbackup.py
@@ -133,9 +133,16 @@ def _execute_restore(site, backup_id, env=None):
stderr=subprocess.PIPE,
env=env)
stdout, stderr = p.communicate()
- assert "Restore completed" in stdout, "Invalid output: %r" %
stdout
- assert stderr == ""
- assert p.wait() == 0
+
+ try:
+ assert "Restore completed" in stdout, "Invalid output:
%r" % stdout
+ assert stderr == ""
+ assert p.wait() == 0
+ except Exception:
+ # Bring back the site in case the restore test fails which may leave the
+ # site in a stopped state
+ site.start()
+ raise
#.