summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/scp.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/scp.py')
-rw-r--r--meta/lib/oeqa/runtime/cases/scp.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/scp.py b/meta/lib/oeqa/runtime/cases/scp.py
new file mode 100644
index 0000000000..f488a6175b
--- /dev/null
+++ b/meta/lib/oeqa/runtime/cases/scp.py
@@ -0,0 +1,33 @@
1import os
2from tempfile import mkstemp
3
4from oeqa.runtime.case import OERuntimeTestCase
5from oeqa.core.decorator.depends import OETestDepends
6from oeqa.core.decorator.oeid import OETestID
7
8class ScpTest(OERuntimeTestCase):
9
10 @classmethod
11 def setUpClass(cls):
12 cls.tmp_fd, cls.tmp_path = mkstemp()
13 with os.fdopen(cls.tmp_fd, 'w') as f:
14 f.seek(2 ** 22 -1)
15 f.write(os.linesep)
16
17 @classmethod
18 def tearDownClass(cls):
19 os.remove(cls.tmp_path)
20
21 @OETestID(220)
22 @OETestDepends(['ssh.SSHTest.test_ssh'])
23 def test_scp_file(self):
24 dst = '/tmp/test_scp_file'
25
26 (status, output) = self.target.copyTo(self.tmp_path, dst)
27 msg = 'File could not be copied. Output: %s' % output
28 self.assertEqual(status, 0, msg=msg)
29
30 (status, output) = self.target.run('ls -la %s' % dst)
31 self.assertEqual(status, 0, msg = 'SCP test failed')
32
33 self.target.run('rm %s' % dst)