mirror of
https://git.yoctoproject.org/poky
synced 2026-03-03 22:09:39 +01:00
These checks are unnecessary. setUpModule is run when a module is loaded and we shouldn't run commands on the target here, (plus if ssh doesn't work we error out in setup multiple times, instead of skipping the real test, which might depend on test_ssh). (From OE-Core rev: 188acd0a75e188fd7c0d2979acaf13fd18b12106) 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>
23 lines
976 B
Python
23 lines
976 B
Python
from oeqa.oetest import oeRuntimeTest
|
|
from oeqa.utils.decorators import *
|
|
import re
|
|
|
|
def setUpModule():
|
|
skipModuleUnless(oeRuntimeTest.hasPackage('x11vnc'), "No x11vnc package 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)
|