Hello,
This should fix a bug in integration tests. See commit message.

--
Petr³
From bef311329726c4625b61d003c3632538dbb15691 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <[email protected]>
Date: Thu, 20 Mar 2014 11:45:13 +0100
Subject: [PATCH] test_integration.tasks: Do not fail cleanup if backup directory does not exist

If the test backup directory was never created (for example if
there was an early failure, or install was never run),
we don't want the test to fail.
Do not restore if the backup dir is not there.
---
 ipatests/test_integration/tasks.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index b785f28190ed39a0ac45ff5b69e3b474e2634278..0d916ca469ecb8aa2f85161d1747dfa586865468 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -133,7 +133,8 @@ def restore_files(host):
         "/sbin/restorecon -v" % (backupname, sed_remove_backupdir))
 
     # Prepare command for actual restoring of the backed up files
-    copyfiles_command = 'cp -arvf %s/* /' % ipautil.shell_quote(backupname)
+    copyfiles_command = 'if [ -d %(dir)s/ ]; then cp -arvf %(dir)s/* /; fi' % {
+        'dir': ipautil.shell_quote(backupname)}
 
     # Run both commands in one session. For more information, see:
     # https://fedorahosted.org/freeipa/ticket/4133
-- 
1.8.5.3

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to