poky/meta/lib/oeqa/runtime/cases/scp.py
Richard Purdie c7592b0147 oeqa: Drop OETestID
These IDs refer to testopia which we're no longer using. We would now use the test
names to definitively reference tests and the IDs can be dropped, along with their
supporting code.

(From OE-Core rev: 8e2d0575e4e7036b5f60e632f377a8ab2b96ead8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09 16:31:55 +01:00

34 lines
1003 B
Python

import os
from tempfile import mkstemp
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.runtime.decorator.package import OEHasPackage
class ScpTest(OERuntimeTestCase):
@classmethod
def setUpClass(cls):
cls.tmp_fd, cls.tmp_path = mkstemp()
with os.fdopen(cls.tmp_fd, 'w') as f:
f.seek(2 ** 22 -1)
f.write(os.linesep)
@classmethod
def tearDownClass(cls):
os.remove(cls.tmp_path)
@OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['openssh-scp', 'dropbear'])
def test_scp_file(self):
dst = '/tmp/test_scp_file'
(status, output) = self.target.copyTo(self.tmp_path, dst)
msg = 'File could not be copied. Output: %s' % output
self.assertEqual(status, 0, msg=msg)
(status, output) = self.target.run('ls -la %s' % dst)
self.assertEqual(status, 0, msg = 'SCP test failed')
self.target.run('rm %s' % dst)