oeqa/weston: Fix tests to run with systemd
PATCH 1/2 oeqa/weston: Fix tests to run with systemd
Currently, weston tests fail when using systemd, fix it by providing transient unit file and inject it via systemd-run, which generates a service file automatically and launches another weston instance to test if it can launch a nested instance. Use systemctl stop to end the service and cleanup, instead of brutal kill
--- meta/lib/oeqa/runtime/cases/weston.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
meta/lib/oeqa/runtime/cases/weston.py +9 -3
@@ -34,7 +34,10 @@ class WestonTest(OERuntimeTestCase): return 'export XDG_RUNTIME_DIR=/run/user/0; export WAYLAND_DISPLAY=wayland-0; %s' % cmd def run_weston_init(self): - self.target.run(self.get_weston_command('weston --log=%s' % self.weston_log_file)) + if 'systemd' in self.tc.td['DISTRO_FEATURES']: + 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-1 /usr/bin/weston --socket=wayland-1 --log=%s' % self.weston_log_file) + else: + self.target.run(self.get_weston_command('weston --log=%s' % self.weston_log_file)) def get_new_wayland_processes(self, existing_wl_processes): try_cnt = 0
@@ -63,7 +66,10 @@ class WestonTest(OERuntimeTestCase): new_wl_processes, try_cnt = self.get_new_wayland_processes(existing_wl_processes) existing_and_new_weston_processes = self.get_processes_of('weston', 'existing and new') new_weston_processes = [x for x in existing_and_new_weston_processes if x not in existing_weston_processes] - for w in new_weston_processes: - self.target.run('kill -9 %s' % w) + if 'systemd' in self.tc.td['DISTRO_FEATURES']: + self.target.run('systemctl stop weston-ptest.service') + else: + for w in new_weston_processes: + self.target.run('kill -9 %s' % w) __, weston_log = self.target.run('cat %s' % self.weston_log_file) 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))
Signature · 1 line
2.28.0
PATCH 2/2 core-image-weston: Bump qemu memory to 512M
It needs openGL and launching two weston instances during weston ptest needs > 256M ram to work
--- meta/recipes-graphics/images/core-image-weston.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-graphics/images/core-image-weston.bb +2 -0
@@ -10,3 +10,5 @@ REQUIRED_DISTRO_FEATURES = "wayland" CORE_IMAGE_BASE_INSTALL += "weston weston-init weston-examples gtk+3-demo clutter-1.0-examples" CORE_IMAGE_BASE_INSTALL += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)}" + +QB_MEM = "-m 512"
Signature · 1 line
2.28.0
Re: [OE-core] [PATCH 2/2] core-image-weston: Bump qemu memory to 512M
Hi Khem,
Quoted 20 lines · Khem Raj
It needs openGL and launching two weston instances during weston ptest
needs > 256M ram to workSigned-off-by Khem Raj <[email protected]>--- meta/recipes-graphics/images/core-image-weston.bb | 2 ++ 1 file changed, 2 insertions(+)meta/recipes-graphics/images/core-image-weston.bb +0
-0@@ -10,3 +10,5 @@ REQUIRED_DISTRO_FEATURES = "wayland" CORE_IMAGE_BASE_INSTALL += "weston weston-init weston-examplesgtk+3-demo clutter-1.0-examples"
CORE_IMAGE_BASE_INSTALL+= "${@bb.utils.contains('DISTRO_FEATURES',
'x11', 'weston-xwayland matchbox-terminal', '', d)}"
meta/recipes-graphics/images/core-image-weston.bb REQUIRED_DISTRO_FEATURES = "wayland" · line 14
Quoted 2 lines
meta/recipes-graphics/images/core-image-weston.bb +2
-0+ +QB_MEM = "-m 512"
One of the weston patches seems to be causing:
https://autobuilder.yoctoproject.org/typhoon/#/builders/40/builds/2458
(no-x11 build)
Cheers,
Richard