diff options
author | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
---|---|---|
committer | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
commit | 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch) | |
tree | b4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/poky/meta/lib/oeqa/runtime/cases/scp.py | |
parent | 706ad73eb02caf8532deaf5d38995bd258725cb8 (diff) |
agl-basesystem
Diffstat (limited to 'external/poky/meta/lib/oeqa/runtime/cases/scp.py')
-rw-r--r-- | external/poky/meta/lib/oeqa/runtime/cases/scp.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/external/poky/meta/lib/oeqa/runtime/cases/scp.py b/external/poky/meta/lib/oeqa/runtime/cases/scp.py new file mode 100644 index 00000000..8f895da9 --- /dev/null +++ b/external/poky/meta/lib/oeqa/runtime/cases/scp.py @@ -0,0 +1,35 @@ +import os +from tempfile import mkstemp + +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.core.decorator.oeid import OETestID +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) + + @OETestID(220) + @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) |