Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | # This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284 testcase |
| 2 | # Note that the image under test must have meta-skeleton layer in bblayers and IMAGE_INSTALL_append = " service" in local.conf |
| 3 | |
| 4 | import unittest |
| 5 | from oeqa.oetest import oeRuntimeTest, skipModule |
| 6 | from oeqa.utils.decorators import * |
| 7 | |
| 8 | def setUpModule(): |
| 9 | if not oeRuntimeTest.hasPackage("service"): |
| 10 | skipModule("No service package in image") |
| 11 | |
| 12 | |
| 13 | class SkeletonBasicTest(oeRuntimeTest): |
| 14 | |
| 15 | @skipUnlessPassed('test_ssh') |
| 16 | @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image") |
| 17 | def test_skeleton_availability(self): |
| 18 | (status, output) = self.target.run('ls /etc/init.d/skeleton') |
| 19 | self.assertEqual(status, 0, msg = "skeleton init script not found. Output:\n%s " % output) |
| 20 | (status, output) = self.target.run('ls /usr/sbin/skeleton-test') |
| 21 | self.assertEqual(status, 0, msg = "skeleton-test not found. Output:\n%s" % output) |
| 22 | |
| 23 | @testcase(284) |
| 24 | @skipUnlessPassed('test_skeleton_availability') |
| 25 | @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image") |
| 26 | def test_skeleton_script(self): |
| 27 | output1 = self.target.run("/etc/init.d/skeleton start")[1] |
| 28 | (status, output2) = self.target.run(oeRuntimeTest.pscmd + ' | grep [s]keleton-test') |
| 29 | self.assertEqual(status, 0, msg = "Skeleton script could not be started:\n%s\n%s" % (output1, output2)) |