Currently, the src dir may be removed when the test version has changed. Just to check to make and copy the src if it has been removed.
Signed-off-by: Mike Qiu <[email protected]> --- client/shared/base_utils.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/shared/base_utils.py b/client/shared/base_utils.py index 363a6a2..d8630b5 100644 --- a/client/shared/base_utils.py +++ b/client/shared/base_utils.py @@ -767,9 +767,14 @@ def update_version(srcdir, preserve_srcdir, new_version, install, if install_needed: if not preserve_srcdir and os.path.exists(srcdir): shutil.rmtree(srcdir) + if not os.path.isdir(srcdir): + source_code_dir = srcdir.replace('/tmp/','/tests/') + if os.path.isdir(source_code_dir): + shutil.copytree(source_code_dir, srcdir) + else: + os.makedirs(srcdir) install(*args, **dargs) - if os.path.exists(srcdir): - pickle.dump(new_version, open(versionfile, 'w')) + pickle.dump(new_version, open(versionfile, 'w')) def get_stderr_level(stderr_is_expected): -- 1.7.7.6 _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
