A bunch of autotest tests do rely on using patch files
to fix/tweak an upstream shipped test tarball. With the
new schema 'test module read only', a series of expectations
of the tests (patch file located on parent of test.srcdir)
is being broken. So copy each patch file found on the test
module to the test tmp area, parent of srcdir.

This patch fixes tests such as bonnie, that rely on such
patches for proper test suite execution.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/shared/test.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/client/shared/test.py b/client/shared/test.py
index 4d98380..281291a 100644
--- a/client/shared/test.py
+++ b/client/shared/test.py
@@ -17,6 +17,7 @@
 #       tmpdir          eg. tmp/<tempname>_<testname.tag>
 
 import fcntl, getpass, os, re, sys, shutil, tempfile, time, traceback, logging
+import glob
 
 from autotest.client.shared import error, global_config
 from autotest.client import utils
@@ -59,6 +60,12 @@ class base_test(object):
                 shutil.copytree(source_code_dir, self.srcdir)
         if not os.path.isdir(self.srcdir):
             os.makedirs(self.srcdir)
+        patch_file_list = glob.glob(os.path.join(self.bindir, "*.patch"))
+        for patch_src in patch_file_list:
+            print patch_src
+            patch_dst = os.path.join(os.path.dirname(self.srcdir),
+                                     os.path.basename(patch_src))
+            shutil.copyfile(patch_src, patch_dst)
         self.tmpdir = tempfile.mkdtemp("_" + self.tagged_testname,
                                        dir=job.tmpdir)
         self._keyvals = []
-- 
1.7.11.2

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to