diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2017-01-19 12:38:06 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:05:21 +0000 |
commit | 6cea270c544ceb14cbd44f4e5f4e51c3a3dcb143 (patch) | |
tree | e2ebab9929dce7ad2f22d8266d31ea4702ce7e4a /meta-selftest/lib | |
parent | 46ce0b5ef3ee623cc9d366f83030363b470ed11e (diff) | |
download | poky-6cea270c544ceb14cbd44f4e5f4e51c3a3dcb143.tar.gz |
selftest/runtime-test.py: Adapt test to use new runtime framework
This adapt the current runtime selftest to use the new runtime
framework.
(From OE-Core rev: cfeec8a59ba03f98944fd3dca1a67d80e7edb4c9)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest/lib')
-rw-r--r-- | meta-selftest/lib/oeqa/runtime/cases/selftest.json (renamed from meta-selftest/lib/oeqa/runtime/selftest.json) | 0 | ||||
-rw-r--r-- | meta-selftest/lib/oeqa/runtime/cases/selftest.py (renamed from meta-selftest/lib/oeqa/runtime/selftest.py) | 34 |
2 files changed, 5 insertions, 29 deletions
diff --git a/meta-selftest/lib/oeqa/runtime/selftest.json b/meta-selftest/lib/oeqa/runtime/cases/selftest.json index e5ae46ecd4..e5ae46ecd4 100644 --- a/meta-selftest/lib/oeqa/runtime/selftest.json +++ b/meta-selftest/lib/oeqa/runtime/cases/selftest.json | |||
diff --git a/meta-selftest/lib/oeqa/runtime/selftest.py b/meta-selftest/lib/oeqa/runtime/cases/selftest.py index a7e58ab3d5..329470f153 100644 --- a/meta-selftest/lib/oeqa/runtime/selftest.py +++ b/meta-selftest/lib/oeqa/runtime/cases/selftest.py | |||
@@ -1,13 +1,9 @@ | |||
1 | import os | 1 | from oeqa.runtime.case import OERuntimeTestCase |
2 | from oeqa.core.decorator.depends import OETestDepends | ||
2 | 3 | ||
3 | from oeqa.oetest import oeRuntimeTest, skipModule | 4 | class Selftest(OERuntimeTestCase): |
4 | from oeqa.utils.commands import runCmd | ||
5 | from oeqa.utils.decorators import * | ||
6 | 5 | ||
7 | class Selftest(oeRuntimeTest): | 6 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
8 | |||
9 | @skipUnlessPassed("test_ssh") | ||
10 | @tag("selftest_package_install") | ||
11 | def test_install_package(self): | 7 | def test_install_package(self): |
12 | """ | 8 | """ |
13 | Summary: Check basic package installation functionality. | 9 | Summary: Check basic package installation functionality. |
@@ -21,8 +17,7 @@ class Selftest(oeRuntimeTest): | |||
21 | (status, output) = self.target.run("socat -V") | 17 | (status, output) = self.target.run("socat -V") |
22 | self.assertEqual(status, 0, msg="socat is not installed") | 18 | self.assertEqual(status, 0, msg="socat is not installed") |
23 | 19 | ||
24 | @skipUnlessPassed("test_install_package") | 20 | @OETestDepends(['selftest.Selftest.test_install_package']) |
25 | @tag("selftest_package_install") | ||
26 | def test_verify_unistall(self): | 21 | def test_verify_unistall(self): |
27 | """ | 22 | """ |
28 | Summary: Check basic package installation functionality. | 23 | Summary: Check basic package installation functionality. |
@@ -34,22 +29,3 @@ class Selftest(oeRuntimeTest): | |||
34 | 29 | ||
35 | (status, output) = self.target.run("socat -V") | 30 | (status, output) = self.target.run("socat -V") |
36 | self.assertNotEqual(status, 0, msg="socat is still installed") | 31 | self.assertNotEqual(status, 0, msg="socat is still installed") |
37 | |||
38 | @tag("selftest_sdk") | ||
39 | def test_sdk(self): | ||
40 | |||
41 | result = runCmd("env -0") | ||
42 | sdk_path = search_sdk_path(result.output) | ||
43 | self.assertTrue(sdk_path, msg="Can't find SDK path") | ||
44 | |||
45 | tar_cmd = os.path.join(sdk_path, "tar") | ||
46 | result = runCmd("%s --help" % tar_cmd) | ||
47 | |||
48 | def search_sdk_path(env): | ||
49 | for line in env.split("\0"): | ||
50 | (key, _, value) = line.partition("=") | ||
51 | if key == "PATH": | ||
52 | for path in value.split(":"): | ||
53 | if "pokysdk" in path: | ||
54 | return path | ||
55 | return "" | ||