diff options
author | Alexandru Palalau <alexandrux.palalau@intel.com> | 2013-08-20 16:20:32 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-26 11:42:13 +0100 |
commit | 2ec4a0686b9a91e56dfba3fa2e574c0c531508ff (patch) | |
tree | c78014b046e0ddbcc658478063c1e6b5ec554bc9 /meta | |
parent | 06c7914e3354ff4e430a6b664f40e5a71e212761 (diff) | |
download | openembedded-core-2ec4a0686b9a91e56dfba3fa2e574c0c531508ff.tar.gz openembedded-core-2ec4a0686b9a91e56dfba3fa2e574c0c531508ff.tar.bz2 openembedded-core-2ec4a0686b9a91e56dfba3fa2e574c0c531508ff.zip |
lib/oeqa/runtime: add new scp test
Copies a 5MB to target using scp, more of an
network test than a scp one.
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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/runtime/scp.py | 22 |
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 @@ +import subprocess +import unittest +import os +from oeqa.oetest import oeRuntimeTest +from oeqa.utils.decorators import * + +def setUpModule(): + if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh-sshd")): + skipModule("No ssh package in image") + + +class ScpTest(oeRuntimeTest): + + def setUp(self): + 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) + + @skipUnlessPassed('test_ssh') + def test_scp(self): + (status, output) = self.target.copy_to(os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True), 'test_scp_file'), '/tmp/test_scp_file') + self.assertEqual(status, 0, msg = "File could not be copied. Output: %s" % output) + (status, output) = self.target.run("ls -la /tmp/test_scp_file") + self.assertEqual(status, 0, msg = "SCP test failed") |