Files
poky/meta/lib/oeqa/runtime/vnc.py
Lucian Musat 8e26ab7d52 oeqa/rutime: Added testcase decorators for automated runtime tests. Also added LogResults decorator for oeTest class in oetest.py
(From OE-Core rev: 95b83084487d0712362ade8ac487999c3274bb96)

Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 16:54:42 +01:00

21 lines
910 B
Python

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]))