blob: 4779cd6bb4ed7734d2560371ce3c27aedb5e7fba [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005# 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
8from oeqa.runtime.case import OERuntimeTestCase
9from oeqa.core.decorator.depends import OETestDepends
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010from oeqa.core.decorator.data import skipIfDataVar
11from oeqa.runtime.decorator.package import OEHasPackage
12
13class 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 Bishop6e60e8b2018-02-01 10:27:11 -050028 @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)