summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAlexandru Palalau <alexandrux.palalau@intel.com>2013-08-20 16:20:32 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-26 11:47:20 +0100
commit0ecc510b92ac32b15860c6173751dc1d9554db74 (patch)
tree84baf33622cab0a62f255cc5782d247b3e1b582e /meta/lib
parent4ea9e94f55897a5583f4722ee9a856993088c1dc (diff)
downloadpoky-0ecc510b92ac32b15860c6173751dc1d9554db74.tar.gz
lib/oeqa/runtime: add new scp test
Copies a 5MB to target using scp, more of an network test than a scp one. (From OE-Core rev: 2ec4a0686b9a91e56dfba3fa2e574c0c531508ff) Signed-off-by: Alexandru Palalau <alexandrux.palalau@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/scp.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/scp.py b/meta/lib/oeqa/runtime/scp.py
new file mode 100644
index 0000000000..b914802095
--- /dev/null
+++ b/meta/lib/oeqa/runtime/scp.py
@@ -0,0 +1,22 @@
1import subprocess
2import unittest
3import os
4from oeqa.oetest import oeRuntimeTest
5from oeqa.utils.decorators import *
6
7def setUpModule():
8 if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh-sshd")):
9 skipModule("No ssh package in image")
10
11
12class ScpTest(oeRuntimeTest):
13
14 def setUp(self):
15 subprocess.check_call("dd if=/dev/zero of=%s bs=512k count=10" % os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True), 'test_scp_file'), shell=True)
16
17 @skipUnlessPassed('test_ssh')
18 def test_scp(self):
19 (status, output) = self.target.copy_to(os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True), 'test_scp_file'), '/tmp/test_scp_file')
20 self.assertEqual(status, 0, msg = "File could not be copied. Output: %s" % output)
21 (status, output) = self.target.run("ls -la /tmp/test_scp_file")
22 self.assertEqual(status, 0, msg = "SCP test failed")