Adding test for detcting unexpected GL context in boosters.

pull/1/head
Marek Ruszczak 14 years ago
parent 68f8f65fb8
commit 2833953f28

@ -46,6 +46,22 @@
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_wm_class_q</step> <step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_launched_app_wm_class_q</step>
</case> </case>
<case name="applauncherd__test_q_booster_dont_have_GL_context" type="Functional" description="Test that q-booster don't have GL context" timeout="100" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_q_booster_dont_have_GL_context</step>
</case>
<case name="applauncherd__test_m_booster_dont_have_GL_context" type="Functional" description="Test that m-booster don't have GL context" timeout="100" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_m_booster_dont_have_GL_context</step>
</case>
<case name="applauncherd__test_e_booster_dont_have_GL_context" type="Functional" description="Test that e-booster don't have GL context" timeout="100" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_e_booster_dont_have_GL_context</step>
</case>
<case name="applauncherd__test_d_booster_dont_have_GL_context" type="Functional" description="Test that d-booster don't have GL context" timeout="100" level="System" insignificant="true">
<step expected_result="0">source /tmp/session_bus_address.user; DISPLAY=:0 `pyversions -d` /usr/share/applauncherd-testscripts/test-func-launcher.py test_d_booster_dont_have_GL_context</step>
</case>
<environments> <environments>
<scratchbox>true</scratchbox> <scratchbox>true</scratchbox>
<hardware>true</hardware> <hardware>true</hardware>

@ -67,6 +67,15 @@ class daemon_handling (unittest.TestCase):
def start_daemons(self): def start_daemons(self):
start_daemons() start_daemons()
def has_GL_context(processId):
processMapsFile = open("/proc/" + processId + "/maps")
processMapsLines = processMapsFile.readlines()
for i in processMapsLines :
if "/dev/pvrsrvkm" in i :
return True
return False
class launcher_tests (unittest.TestCase): class launcher_tests (unittest.TestCase):
def setUp(self): def setUp(self):
if daemons_running(): if daemons_running():
@ -897,6 +906,28 @@ class launcher_tests (unittest.TestCase):
for property in xProperties: for property in xProperties:
self.assert_(op1 == wm_class_xproperty_string,'Application WM_CLASS 1 is incorrect: %s' %property) self.assert_(op1 == wm_class_xproperty_string,'Application WM_CLASS 1 is incorrect: %s' %property)
def test_q_booster_dont_have_GL_context(self):
qpid = get_pid('booster-q')
self.assert_(qpid != None, "Process 'booster-q' is not running")
self.assert_(not has_GL_context(qpid), "booster-q has GL context!")
def test_m_booster_dont_have_GL_context(self):
mpid = get_pid('booster-m')
self.assert_(mpid != None, "Process 'booster-m' is not running")
self.assert_(not has_GL_context(mpid), "booster-m has GL context!")
def test_e_booster_dont_have_GL_context(self):
epid = get_pid('booster-e')
self.assert_(epid != None, "Process 'booster-e' is not running")
self.assert_(not has_GL_context(epid), "booster-e has GL context!")
def test_d_booster_dont_have_GL_context(self):
dpid = get_pid('booster-d')
self.assert_(dpid != None, "Process 'booster-d' is not running")
self.assert_(not has_GL_context(dpid), "booster-d has GL context!")
# main # main
if __name__ == '__main__': if __name__ == '__main__':
# When run with testrunner, for some reason the PATH doesn't include # When run with testrunner, for some reason the PATH doesn't include

Loading…
Cancel
Save