summaryrefslogtreecommitdiffstats
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:47:20 +0100
commit3d30fd2eb06258aa2048f8fadf7b592f9844432f (patch)
tree35a809fcb02c1062d99ffdcaa3e1cecfbe66ebe3
parent5e1b0cb2e435eae226fe32a003a22e153acfff90 (diff)
downloadpoky-3d30fd2eb06258aa2048f8fadf7b592f9844432f.tar.gz
lib/oeqa/runtime: add vncserver for target test
(From OE-Core rev: 56bc5d717b34563ed36c0618305e4ec5080c3a27) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 @@
1from oeqa.oetest import oeRuntimeTest
2from oeqa.utils.decorators import *
3import re
4
5def setUpModule():
6 skipModuleUnless(oeRuntimeTest.tc.target.run('which x11vnc')[0] == 0, "No x11vnc in image")
7
8class 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)