Here are fixes for two bugs found while running integration tests under Beaker.

--
PetrĀ³
From c568f9c83eaf6e579efaf03fc9580ae46cf0b61c Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Thu, 24 Oct 2013 13:55:47 +0200
Subject: [PATCH] Tests: mkdir_recursive: Don't fail when top-level directory
 doesn't exist

When the directory directly under root (e.g. /etc) did not exist,
mkdir_recursive failed.
Fix the issue.
---
 ipatests/test_integration/transport.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipatests/test_integration/transport.py b/ipatests/test_integration/transport.py
index a0bd3700ac4e9887804f021d1a2fb4eb050457d3..9b3dd5be5fc4df7b235f52e2f5dcdb9fc608ad23 100644
--- a/ipatests/test_integration/transport.py
+++ b/ipatests/test_integration/transport.py
@@ -87,10 +87,10 @@ def start_shell(self, argv, log_stdout=True):
 
     def mkdir_recursive(self, path):
         """`mkdir -p` on the remote host"""
-        if not path or path == '/':
-            raise ValueError('Invalid path')
-        if not self.file_exists(path or '/'):
-            self.mkdir_recursive(os.path.dirname(path))
+        if not self.file_exists(path):
+            parent_path = os.path.dirname(path)
+            if path != parent_path:
+                self.mkdir_recursive(parent_path)
             self.mkdir(path)
 
     def get_file(self, remotepath, localpath):
-- 
1.8.3.1

From f32b4a582974e36d63913ddefdcd29965bee5848 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Wed, 23 Oct 2013 14:05:39 +0200
Subject: [PATCH] beakerlib plugin: Don't try to submit logs if they are
 missing

---
 ipatests/beakerlib_plugin.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ipatests/beakerlib_plugin.py b/ipatests/beakerlib_plugin.py
index 45f34c6a6460f52fa0b5b9fb9b8e8bb2975ccafa..71c1df537fb98ae49b159bd1e80381a37dc8a51f 100644
--- a/ipatests/beakerlib_plugin.py
+++ b/ipatests/beakerlib_plugin.py
@@ -116,6 +116,7 @@ def collect_logs(self, logs_to_collect):
                                     raiseonerr=False)
             if cmd.returncode:
                 self.log.warn('Could not collect all requested logs')
+                return
 
             # Copy and unpack on the local side
             topdirname = tempfile.mkdtemp()
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to