diff options
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/skeletoninit.py')
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/skeletoninit.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/skeletoninit.py b/meta/lib/oeqa/runtime/cases/skeletoninit.py new file mode 100644 index 0000000000..4fdcf033a3 --- /dev/null +++ b/meta/lib/oeqa/runtime/cases/skeletoninit.py | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284 | ||
| 2 | # testcase. Image under test must have meta-skeleton layer in bblayers and | ||
| 3 | # IMAGE_INSTALL_append = " service" in local.conf | ||
| 4 | from oeqa.runtime.case import OERuntimeTestCase | ||
| 5 | from oeqa.core.decorator.depends import OETestDepends | ||
| 6 | from oeqa.core.decorator.oeid import OETestID | ||
| 7 | from oeqa.core.decorator.data import skipIfDataVar | ||
| 8 | from oeqa.runtime.decorator.package import OEHasPackage | ||
| 9 | |||
| 10 | class SkeletonBasicTest(OERuntimeTestCase): | ||
| 11 | |||
| 12 | @OETestDepends(['ssh.SSHTest.test_ssh']) | ||
| 13 | @OEHasPackage(['service']) | ||
| 14 | @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd', | ||
| 15 | 'Not appropiate for systemd image') | ||
| 16 | def test_skeleton_availability(self): | ||
| 17 | status, output = self.target.run('ls /etc/init.d/skeleton') | ||
| 18 | msg = 'skeleton init script not found. Output:\n%s' % output | ||
| 19 | self.assertEqual(status, 0, msg=msg) | ||
| 20 | |||
| 21 | status, output = self.target.run('ls /usr/sbin/skeleton-test') | ||
| 22 | msg = 'skeleton-test not found. Output:\n%s' % output | ||
| 23 | self.assertEqual(status, 0, msg=msg) | ||
| 24 | |||
| 25 | @OETestID(284) | ||
| 26 | @OETestDepends(['skeletoninit.SkeletonBasicTest.test_skeleton_availability']) | ||
| 27 | def test_skeleton_script(self): | ||
| 28 | output1 = self.target.run("/etc/init.d/skeleton start")[1] | ||
| 29 | cmd = '%s | grep [s]keleton-test' % self.tc.target_cmds['ps'] | ||
| 30 | status, output2 = self.target.run(cmd) | ||
| 31 | msg = ('Skeleton script could not be started:' | ||
| 32 | '\n%s\n%s' % (output1, output2)) | ||
| 33 | self.assertEqual(status, 0, msg=msg) | ||
