summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-07-26 09:38:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-04 15:22:23 +0100
commit37f1e0c154cf542dee2af143760730b53b749d61 (patch)
treeb5a4ddfb06f46a9b2fe963ebbc71d2e408e0ef38 /meta/lib/oeqa
parent65459f5b6d39f9fb2cdf66ba4f01b7889e41df16 (diff)
downloadpoky-37f1e0c154cf542dee2af143760730b53b749d61.tar.gz
oeqa/utils/sshcontrol.py: Allows to copy symlinks to target
Currently when copying a symlink to the target it will fail throwing an exception. This will recreate symlinks from the system performing the tests to the device under tests. [YOCTO #9932] (From OE-Core rev: 5705b7a55bc300e14c34b0530f4d49df101edd3c) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/utils/sshcontrol.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index f5d46e03cc..da485ee408 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -147,8 +147,13 @@ class SSHControl(object):
147 return self._internal_run(command, timeout, self.ignore_status) 147 return self._internal_run(command, timeout, self.ignore_status)
148 148
149 def copy_to(self, localpath, remotepath): 149 def copy_to(self, localpath, remotepath):
150 command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] 150 if os.path.islink(localpath):
151 return self._internal_run(command, ignore_status=False) 151 link = os.readlink(localpath)
152 dst_dir, dst_base = os.path.split(remotepath)
153 return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base))
154 else:
155 command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
156 return self._internal_run(command, ignore_status=False)
152 157
153 def copy_from(self, remotepath, localpath): 158 def copy_from(self, remotepath, localpath):
154 command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath] 159 command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]