summaryrefslogtreecommitdiff
path: root/yocto-poky/meta/lib/oeqa/runtime/vnc.py
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/meta/lib/oeqa/runtime/vnc.py')
-rw-r--r--yocto-poky/meta/lib/oeqa/runtime/vnc.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/yocto-poky/meta/lib/oeqa/runtime/vnc.py b/yocto-poky/meta/lib/oeqa/runtime/vnc.py
new file mode 100644
index 000000000..f31deff30
--- /dev/null
+++ b/yocto-poky/meta/lib/oeqa/runtime/vnc.py
@@ -0,0 +1,20 @@
+from oeqa.oetest import oeRuntimeTest, skipModuleUnless
+from oeqa.utils.decorators import *
+import re
+
+def setUpModule():
+ skipModuleUnless(oeRuntimeTest.hasPackage('x11vnc'), "No x11vnc package in image")
+
+class VNCTest(oeRuntimeTest):
+
+ @testcase(213)
+ @skipUnlessPassed('test_ssh')
+ def test_vnc(self):
+ (status, output) = self.target.run('x11vnc -display :0 -bg -o x11vnc.log')
+ self.assertEqual(status, 0, msg="x11vnc server failed to start: %s" % output)
+ port = re.search('PORT=[0-9]*', output)
+ self.assertTrue(port, msg="Listening port not specified in command output: %s" %output)
+
+ vncport = port.group(0).split('=')[1]
+ (status, output) = self.target.run('netstat -ntl | grep ":%s"' % vncport)
+ self.assertEqual(status, 0, msg="x11vnc server not running on port %s\n\n%s" % (vncport, self.target.run('netstat -ntl; cat x11vnc.log')[1]))