summaryrefslogtreecommitdiff
path: root/meta
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:05:47 +0100
commit5705b7a55bc300e14c34b0530f4d49df101edd3c (patch)
treeac752086ea92002d774039474f34b69b2295a029 /meta
parent0338f66c0d246c3b8d94ac68d60fbc4c314e500b (diff)
downloadopenembedded-core-5705b7a55bc300e14c34b0530f4d49df101edd3c.tar.gz
openembedded-core-5705b7a55bc300e14c34b0530f4d49df101edd3c.tar.bz2
openembedded-core-5705b7a55bc300e14c34b0530f4d49df101edd3c.zip
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-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):
return self._internal_run(command, timeout, self.ignore_status)
def copy_to(self, localpath, remotepath):
- command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
- return self._internal_run(command, ignore_status=False)
+ if os.path.islink(localpath):
+ link = os.readlink(localpath)
+ dst_dir, dst_base = os.path.split(remotepath)
+ return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base))
+ else:
+ command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
+ return self._internal_run(command, ignore_status=False)
def copy_from(self, remotepath, localpath):
command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]