blob: 75951beda96a1a61cbadea266ca1983eaab0c3e7 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: MIT
5#
6
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284
8# testcase. Image under test must have meta-skeleton layer in bblayers and
Patrick Williams213cb262021-08-07 19:21:33 -05009# IMAGE_INSTALL:append = " service" in local.conf
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010from oeqa.runtime.case import OERuntimeTestCase
11from oeqa.core.decorator.depends import OETestDepends
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012from oeqa.core.decorator.data import skipIfDataVar
13from oeqa.runtime.decorator.package import OEHasPackage
14
15class SkeletonBasicTest(OERuntimeTestCase):
16
17 @OETestDepends(['ssh.SSHTest.test_ssh'])
18 @OEHasPackage(['service'])
19 @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
20 'Not appropiate for systemd image')
21 def test_skeleton_availability(self):
22 status, output = self.target.run('ls /etc/init.d/skeleton')
23 msg = 'skeleton init script not found. Output:\n%s' % output
24 self.assertEqual(status, 0, msg=msg)
25
26 status, output = self.target.run('ls /usr/sbin/skeleton-test')
27 msg = 'skeleton-test not found. Output:\n%s' % output
28 self.assertEqual(status, 0, msg=msg)
29
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030 @OETestDepends(['skeletoninit.SkeletonBasicTest.test_skeleton_availability'])
31 def test_skeleton_script(self):
32 output1 = self.target.run("/etc/init.d/skeleton start")[1]
33 cmd = '%s | grep [s]keleton-test' % self.tc.target_cmds['ps']
34 status, output2 = self.target.run(cmd)
35 msg = ('Skeleton script could not be started:'
36 '\n%s\n%s' % (output1, output2))
37 self.assertEqual(status, 0, msg=msg)