From 204b5421a14e077dd5358bbe408709160b131b2e Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Thu, 6 Apr 2017 11:01:58 +0800 Subject: test-runner: set test case relative path for remoet exec only 'tc_relative_dir' is used for partial file copy to target. It splits realpath to yaml file by test kind parameter and assumes tests are from 'automated' or 'manual' folder. Local exec copy the whole repo. It doesn't have the above assumption. Moving the 'tc_relative_dir' related lines to remote exec only. Change-Id: I95415fa93a94ddf654681ada704e4b2a5c12f061 Signed-off-by: Chase Qi --- automated/utils/test-runner.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/automated/utils/test-runner.py b/automated/utils/test-runner.py index 6bea92b..13087e0 100755 --- a/automated/utils/test-runner.py +++ b/automated/utils/test-runner.py @@ -632,12 +632,12 @@ def main(): if args.target is not None and '-o' not in sys.argv: test['output'] = os.path.join(test['output'], args.target) test['test_path'] = os.path.join(test['output'], test['test_uuid']) - # Get relative directory path of yaml file for file copy. - # '-d' takes any relative paths to the yaml file, so get the realpath first. - tc_realpath = os.path.realpath(test['path']) - tc_dirname = os.path.dirname(tc_realpath) - test['tc_relative_dir'] = '%s%s' % (args.kind, tc_dirname.split(args.kind)[1]) if args.target is not None: + # Get relative directory path of yaml file for partial file copy. + # '-d' takes any relative paths to the yaml file, so get the realpath first. + tc_realpath = os.path.realpath(test['path']) + tc_dirname = os.path.dirname(tc_realpath) + test['tc_relative_dir'] = '%s%s' % (args.kind, tc_dirname.split(args.kind)[1]) target_user_home_cmd = '%s "echo $HOME"' % args.target target_user_home = call_ssh(target_user_home_cmd) test['target_test_path'] = '%s/output/%s' % (target_user_home, test['test_uuid']) -- cgit v1.2.3