xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/runtime/cases/xorg.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
2# SPDX-License-Identifier: MIT
3#
4
5from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
7from oeqa.core.decorator.data import skipIfNotFeature
8from oeqa.runtime.decorator.package import OEHasPackage
9
10class XorgTest(OERuntimeTestCase):
11
12    @skipIfNotFeature('x11-base',
13                      'Test requires x11 to be in IMAGE_FEATURES')
14    @OETestDepends(['ssh.SSHTest.test_ssh'])
15    @OEHasPackage(['xserver-nodm-init'])
16    def test_xorg_running(self):
17        cmd ='%s | grep -v xinit | grep [X]org' % self.tc.target_cmds['ps']
18        status, output = self.target.run(cmd)
19        msg = ('Xorg does not appear to be running %s' %
20              self.target.run(self.tc.target_cmds['ps'])[1])
21        self.assertEqual(status, 0, msg=msg)
22