Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | # This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284 |
| 6 | # testcase. Image under test must have meta-skeleton layer in bblayers and |
| 7 | # IMAGE_INSTALL_append = " service" in local.conf |
| 8 | from oeqa.runtime.case import OERuntimeTestCase |
| 9 | from oeqa.core.decorator.depends import OETestDepends |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | from oeqa.core.decorator.data import skipIfDataVar |
| 11 | from oeqa.runtime.decorator.package import OEHasPackage |
| 12 | |
| 13 | class SkeletonBasicTest(OERuntimeTestCase): |
| 14 | |
| 15 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
| 16 | @OEHasPackage(['service']) |
| 17 | @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd', |
| 18 | 'Not appropiate for systemd image') |
| 19 | def test_skeleton_availability(self): |
| 20 | status, output = self.target.run('ls /etc/init.d/skeleton') |
| 21 | msg = 'skeleton init script not found. Output:\n%s' % output |
| 22 | self.assertEqual(status, 0, msg=msg) |
| 23 | |
| 24 | status, output = self.target.run('ls /usr/sbin/skeleton-test') |
| 25 | msg = 'skeleton-test not found. Output:\n%s' % output |
| 26 | self.assertEqual(status, 0, msg=msg) |
| 27 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | @OETestDepends(['skeletoninit.SkeletonBasicTest.test_skeleton_availability']) |
| 29 | def test_skeleton_script(self): |
| 30 | output1 = self.target.run("/etc/init.d/skeleton start")[1] |
| 31 | cmd = '%s | grep [s]keleton-test' % self.tc.target_cmds['ps'] |
| 32 | status, output2 = self.target.run(cmd) |
| 33 | msg = ('Skeleton script could not be started:' |
| 34 | '\n%s\n%s' % (output1, output2)) |
| 35 | self.assertEqual(status, 0, msg=msg) |