summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/weston.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/weston.py')
-rw-r--r--meta/lib/oeqa/runtime/cases/weston.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/meta/lib/oeqa/runtime/cases/weston.py b/meta/lib/oeqa/runtime/cases/weston.py
index a1c7183213..ee4d336482 100644
--- a/meta/lib/oeqa/runtime/cases/weston.py
+++ b/meta/lib/oeqa/runtime/cases/weston.py
@@ -1,4 +1,6 @@
1# 1#
2# Copyright OpenEmbedded Contributors
3#
2# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
3# 5#
4 6
@@ -10,7 +12,7 @@ import threading
10import time 12import time
11 13
12class WestonTest(OERuntimeTestCase): 14class WestonTest(OERuntimeTestCase):
13 weston_log_file = '/tmp/weston.log' 15 weston_log_file = '/tmp/weston-2.log'
14 16
15 @classmethod 17 @classmethod
16 def tearDownClass(cls): 18 def tearDownClass(cls):
@@ -31,13 +33,13 @@ class WestonTest(OERuntimeTestCase):
31 return output.split(" ") 33 return output.split(" ")
32 34
33 def get_weston_command(self, cmd): 35 def get_weston_command(self, cmd):
34 return 'export XDG_RUNTIME_DIR=/run/user/0; export WAYLAND_DISPLAY=wayland-0; %s' % cmd 36 return 'export XDG_RUNTIME_DIR=/run/user/`id -u weston`; export WAYLAND_DISPLAY=wayland-1; %s' % cmd
35 37
36 def run_weston_init(self): 38 def run_weston_init(self):
37 if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']: 39 if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']:
38 self.target.run('systemd-run --collect --unit=weston-ptest.service --uid=0 -p PAMName=login -p TTYPath=/dev/tty6 -E XDG_RUNTIME_DIR=/tmp -E WAYLAND_DISPLAY=wayland-0 /usr/bin/weston --socket=wayland-1 --log=%s' % self.weston_log_file) 40 self.target.run('systemd-run --collect --unit=weston-ptest.service --uid=0 -p PAMName=login -p TTYPath=/dev/tty6 -E XDG_RUNTIME_DIR=/tmp -E WAYLAND_DISPLAY=wayland-0 /usr/bin/weston --socket=wayland-1 --log=%s' % self.weston_log_file)
39 else: 41 else:
40 self.target.run(self.get_weston_command('openvt -- weston --socket=wayland-1 --log=%s' % self.weston_log_file)) 42 self.target.run(self.get_weston_command('openvt -- weston --socket=wayland-2 --log=%s' % self.weston_log_file))
41 43
42 def get_new_wayland_processes(self, existing_wl_processes): 44 def get_new_wayland_processes(self, existing_wl_processes):
43 try_cnt = 0 45 try_cnt = 0
@@ -53,7 +55,11 @@ class WestonTest(OERuntimeTestCase):
53 55
54 @OEHasPackage(['wayland-utils']) 56 @OEHasPackage(['wayland-utils'])
55 def test_wayland_info(self): 57 def test_wayland_info(self):
56 status, output = self.target.run(self.get_weston_command('wayland-info')) 58 if 'systemd' in self.tc.td['VIRTUAL-RUNTIME_init_manager']:
59 command = 'XDG_RUNTIME_DIR=/run wayland-info'
60 else:
61 command = self.get_weston_command('wayland-info')
62 status, output = self.target.run(command)
57 self.assertEqual(status, 0, msg='wayland-info error: %s' % output) 63 self.assertEqual(status, 0, msg='wayland-info error: %s' % output)
58 64
59 @OEHasPackage(['weston']) 65 @OEHasPackage(['weston'])
@@ -73,3 +79,11 @@ class WestonTest(OERuntimeTestCase):
73 self.target.run('kill -9 %s' % w) 79 self.target.run('kill -9 %s' % w)
74 __, weston_log = self.target.run('cat %s' % self.weston_log_file) 80 __, weston_log = self.target.run('cat %s' % self.weston_log_file)
75 self.assertTrue(new_wl_processes, msg='Could not get new weston-desktop-shell processes (%s, try_cnt:%s) weston log: %s' % (new_wl_processes, try_cnt, weston_log)) 81 self.assertTrue(new_wl_processes, msg='Could not get new weston-desktop-shell processes (%s, try_cnt:%s) weston log: %s' % (new_wl_processes, try_cnt, weston_log))
82
83 @skipIfNotFeature('x11', 'Test requires x11 to be in DISTRO_FEATURES')
84 @OEHasPackage(['weston'])
85 def test_weston_supports_xwayland(self):
86 cmd ='cat %s | grep "xserver listening on display"' % self.weston_log_file
87 status, output = self.target.run(cmd)
88 msg = ('xwayland does not appear to be running')
89 self.assertEqual(status, 0, msg=msg)