This patch had a lot of mistakes. I've fixed them, sent a new version
to the mailing list, pushed to next, thanks.

On Tue, Sep 4, 2012 at 11:24 AM, Mike Qiu <[email protected]> wrote:
> 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/.

This commit message is rather confusing, I just rewrote it.

> 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'])

This env variable is only available on that scope if you change the
order of the env variable setting and the cmdparse import

> +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,

Here, you remove tests_out_dir, but yet PackageManager references it.
The reference had to be updated.

> --
> 1.7.7.6
>



-- 
Lucas

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

Reply via email to