Currently, cmdparser.py will setup a tmp dir for site_tests in the dir
where you run the autotest, like client/tests/sleeptest/tmp/site_tests,
when run the sleeptest the the sleeptest dir, and it is no need for
none site_tests, at the same time it makes the tests dir not 'read-only'.
To avoid this, move site_tests to client/tmp/.

Signed-off-by: Mike Qiu <[email protected]>
---
 client/cmdparser.py |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/client/cmdparser.py b/client/cmdparser.py
index 674040d..a1ffc5f 100644
--- a/client/cmdparser.py
+++ b/client/cmdparser.py
@@ -16,12 +16,17 @@ GLOBALDIRTEST = GLOBAL_CONFIG.get_config_value('COMMON',
                                                'test_dir',
                                                 default="")
 
-tmpdir = os.path.abspath(os.path.join('.', 'tmp'))
-
-FETCHDIRTEST = GLOBAL_CONFIG.get_config_value('COMMON',
-                                               'test_output_dir',
-                                                default=tmpdir)
-FETCHDIRTEST = os.path.join(FETCHDIRTEST, 'site_tests')
+try:
+    autodir = os.path.abspath(os.environ['AUTODIR'])
+except KeyError:
+    autodir = GLOBAL_CONFIG.get_config_value('COMMON',
+                                             'autotest_top_path')
+tmpdir = os.path.join(autodir, 'tmp')
+
+output_dir = GLOBAL_CONFIG.get_config_value('COMMON',
+                                            'test_output_dir',
+                                             default=tmpdir)
+FETCHDIRTEST = os.path.join(output_dir, 'site_tests')
 
 if not os.path.isdir(FETCHDIRTEST):
     os.makedirs(FETCHDIRTEST)
@@ -106,12 +111,7 @@ class CommandParser(object):
             name = ""
 
         logging.info("Fetching file %s:%s", url, name)
-        autodir = os.path.abspath(os.environ['AUTODIR'])
-        tmpdir = os.path.join(autodir, 'tmp')
-        tests_out_dir = GLOBAL_CONFIG.get_config_value('COMMON',
-                                                       'test_output_dir',
-                                                       default=tmpdir)
-        pkg_dir = os.path.join(tests_out_dir, 'packages')
+        pkg_dir = os.path.join(output_dir, 'packages')
         install_dir = os.path.join(FETCHDIRTEST, name)
 
         pkgmgr = packages.PackageManager(tests_out_dir,
-- 
1.7.7.6

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

Reply via email to