From: Don Zickus <[email protected]> In order to allow the package manager to install test modules from http or git, move site_tests dir to the autotest test output area. This area is guaranteed to be writable by autotest in all use cases, since all test locations so far are read-only.
Signed-off-by: Don Zickus <[email protected]> Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- client/job.py | 5 ++++- client/shared/base_job.py | 2 +- client/shared/base_job_unittest.py | 4 ++-- client/shared/test.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/job.py b/client/job.py index 203ab03..42f5688 100644 --- a/client/job.py +++ b/client/job.py @@ -296,8 +296,11 @@ class base_client_job(base_job.base_job): """ Perform the packages support initialization. """ + tmpdir = GLOBAL_CONFIG.get_config_value('COMMON', + 'test_output_dir', + default=self.autodir) self.pkgmgr = packages.PackageManager( - self.autodir, run_function_dargs={'timeout':3600}) + tmpdir, run_function_dargs={'timeout':3600}) def _init_cmdline(self, extra_copy_cmdline): diff --git a/client/shared/base_job.py b/client/shared/base_job.py index 3c1d290..192390b 100644 --- a/client/shared/base_job.py +++ b/client/shared/base_job.py @@ -1056,7 +1056,7 @@ class base_job(object): # Now tests are read-only modules self._testdir = readonly_dir(root, 'tests') - self._site_testdir = readonly_dir(root, 'site_tests') + self._site_testdir = readwrite_dir(tests_out_dir, 'site_tests') # various server-specific directories if self.serverdir: diff --git a/client/shared/base_job_unittest.py b/client/shared/base_job_unittest.py index a12a000..8545cee 100755 --- a/client/shared/base_job_unittest.py +++ b/client/shared/base_job_unittest.py @@ -182,10 +182,10 @@ class test_initialize_dir_properties(unittest.TestCase): # check all the context-specifc dir properties self.assert_(self.cjob.tmpdir.startswith(os.environ['AUTODIR'])) self.assert_(self.cjob.testdir.startswith('/atest/client')) - self.assert_(self.cjob.site_testdir.startswith('/atest/client')) + self.assert_(self.cjob.site_testdir.startswith(os.environ['AUTODIR'])) self.assert_(self.sjob.tmpdir.startswith(os.environ['AUTODIR'])) self.assert_(self.sjob.testdir.startswith('/atest/server')) - self.assert_(self.sjob.site_testdir.startswith('/atest/server')) + self.assert_(self.sjob.site_testdir.startswith(os.environ['AUTODIR'])) class test_execution_context(unittest.TestCase): diff --git a/client/shared/test.py b/client/shared/test.py index e5435a6..8012087 100644 --- a/client/shared/test.py +++ b/client/shared/test.py @@ -880,7 +880,7 @@ def runtest(job, url, tag, args, dargs, # 'install_pkg' method will be present only if it's a client side job. if hasattr(job, 'install_pkg'): try: - bindir = os.path.join(job.testdir, testname) + bindir = os.path.join(job.site_testdir, testname) job.install_pkg(testname, 'test', bindir) except error.PackageInstallError: # continue as a fall back mechanism and see if the test code -- 1.7.10.4 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
