mirror of
https://git.yoctoproject.org/poky
synced 2026-03-06 23:39:40 +01:00
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>
23 lines
931 B
Python
23 lines
931 B
Python
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")
|