summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
authorMihai Prica <mihai.prica@intel.com>2013-08-19 15:30:26 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-26 11:42:14 +0100
commit56bc5d717b34563ed36c0618305e4ec5080c3a27 (patch)
tree5a2866375464702d6302abbd501694ca29191e08 /meta/lib
parentede300f44f1770b1e3e5c59f65cf5079379a2bc1 (diff)
downloadopenembedded-core-56bc5d717b34563ed36c0618305e4ec5080c3a27.tar.gz
openembedded-core-56bc5d717b34563ed36c0618305e4ec5080c3a27.tar.bz2
openembedded-core-56bc5d717b34563ed36c0618305e4ec5080c3a27.zip
lib/oeqa/runtime: add vncserver for target test
Signed-off-by: Mihai Prica <mihai.prica@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/vnc.py22
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 @@
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+import re
+
+def setUpModule():
+ skipModuleUnless(oeRuntimeTest.tc.target.run('which x11vnc')[0] == 0, "No x11vnc in image")
+
+class VNCTest(oeRuntimeTest):
+
+ @skipUnlessPassed('test_ssh')
+ def test_vnc(self):
+ (status, output) = self.target.run('x11vnc -display :0.0 -bg -q')
+ 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)
+
+ (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [x]11vnc')
+ self.assertEqual(status, 0, msg="x11vnc process not running")
+
+ vncport = port.group(0).split('=')[1]
+ (status, output) = self.target.run('netstat -atun | grep :%s | grep LISTEN' % vncport)
+ self.assertEqual(status, 0, msg="x11vnc server not running on port %s" % vncport)