xref: /OK3568_Linux_fs/yocto/poky/meta-selftest/lib/oeqa/runtime/cases/virgl.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunfrom oeqa.runtime.case import OERuntimeTestCase
2*4882a593Smuzhiyunfrom oeqa.core.decorator.depends import OETestDepends
3*4882a593Smuzhiyunimport subprocess
4*4882a593Smuzhiyunimport oe.lsb
5*4882a593Smuzhiyun
6*4882a593Smuzhiyunclass VirglTest(OERuntimeTestCase):
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    @OETestDepends(['ssh.SSHTest.test_ssh'])
9*4882a593Smuzhiyun    def test_kernel_driver(self):
10*4882a593Smuzhiyun        status, output = self.target.run('dmesg|grep virgl')
11*4882a593Smuzhiyun        self.assertEqual(status, 0, "Checking for virgl driver in dmesg returned non-zero: %d\n%s" % (status, output))
12*4882a593Smuzhiyun        self.assertIn("features: +virgl", output, "virgl acceleration seems to be disabled:\n%s" %(output))
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun    @OETestDepends(['virgl.VirglTest.test_kernel_driver'])
15*4882a593Smuzhiyun    def test_kmscube(self):
16*4882a593Smuzhiyun        status, output = self.target.run('kmscube')
17*4882a593Smuzhiyun        self.assertEqual(status, 0, "kmscube exited with non-zero status %d and output:\n%s" %(status, output))
18*4882a593Smuzhiyun        self.assertIn('renderer: "virgl"', output, "kmscube does not seem to use virgl:\n%s" %(output))
19