Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | from oeqa.runtime.case import OERuntimeTestCase |
| 2 | from oeqa.core.decorator.depends import OETestDepends |
| 3 | import subprocess |
| 4 | import oe.lsb |
| 5 | |
| 6 | class VirglTest(OERuntimeTestCase): |
| 7 | |
| 8 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
| 9 | def test_kernel_driver(self): |
| 10 | status, output = self.target.run('dmesg|grep virgl') |
| 11 | self.assertEqual(status, 0, "Checking for virgl driver in dmesg returned non-zero: %d\n%s" % (status, output)) |
| 12 | self.assertIn("virgl 3d acceleration enabled", output, "virgl acceleration seems to be disabled:\n%s" %(output)) |
| 13 | |
| 14 | @OETestDepends(['virgl.VirglTest.test_kernel_driver']) |
| 15 | def test_kmscube(self): |
| 16 | |
| 17 | distro = oe.lsb.distro_identifier() |
| 18 | if distro and distro == 'centos-7': |
| 19 | self.skipTest('kmscube is not working when centos 7 is the host OS') |
| 20 | |
| 21 | status, output = self.target.run('kmscube', timeout=30) |
| 22 | self.assertEqual(status, 0, "kmscube exited with non-zero status %d and output:\n%s" %(status, output)) |
| 23 | self.assertIn('renderer: "virgl"', output, "kmscube does not seem to use virgl:\n%s" %(output)) |