diff options
| -rw-r--r-- | meta/lib/oeqa/runtime/vnc.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/vnc.py b/meta/lib/oeqa/runtime/vnc.py new file mode 100644 index 0000000000..9476184080 --- /dev/null +++ b/meta/lib/oeqa/runtime/vnc.py | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | from oeqa.oetest import oeRuntimeTest | ||
| 2 | from oeqa.utils.decorators import * | ||
| 3 | import re | ||
| 4 | |||
| 5 | def setUpModule(): | ||
| 6 | skipModuleUnless(oeRuntimeTest.tc.target.run('which x11vnc')[0] == 0, "No x11vnc in image") | ||
| 7 | |||
| 8 | class VNCTest(oeRuntimeTest): | ||
| 9 | |||
| 10 | @skipUnlessPassed('test_ssh') | ||
| 11 | def test_vnc(self): | ||
| 12 | (status, output) = self.target.run('x11vnc -display :0.0 -bg -q') | ||
| 13 | self.assertEqual(status, 0, msg="x11vnc server failed to start: %s" % output) | ||
| 14 | port = re.search('PORT=[0-9]*', output) | ||
| 15 | self.assertTrue(port, msg="Listening port not specified in command output: %s" %output) | ||
| 16 | |||
| 17 | (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [x]11vnc') | ||
| 18 | self.assertEqual(status, 0, msg="x11vnc process not running") | ||
| 19 | |||
| 20 | vncport = port.group(0).split('=')[1] | ||
| 21 | (status, output) = self.target.run('netstat -atun | grep :%s | grep LISTEN' % vncport) | ||
| 22 | self.assertEqual(status, 0, msg="x11vnc server not running on port %s" % vncport) | ||
