diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2020-05-26 20:25:03 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2020-05-26 20:25:03 +0300 |
commit | 35a774200999ac2fca48693c1c169bf99d2f63ea (patch) | |
tree | 0b2f65ce3a90f41d1c2542d0fd20b1604fd83fe5 /poky/meta/lib/oeqa/runtime/cases/weston.py | |
parent | 497a23ef6661ad6ca7b75009e48a592c1620d46c (diff) | |
download | openbmc-2.8.0-rc1.tar.xz |
Reset the following subtrees on HEAD:
poky: ed3bdd7fbc(dunfell)
meta-raspberrypi: 8066fac91d(dunfell)
meta-security: d83f7cb0c9(dunfell)
meta-openembedded: e413c1ef62(dunfell)
Change-Id: Ifd3228663b08911c890d7631310294cccb3dd232
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/lib/oeqa/runtime/cases/weston.py')
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/weston.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/poky/meta/lib/oeqa/runtime/cases/weston.py b/poky/meta/lib/oeqa/runtime/cases/weston.py index ac29eca6e4..f32599afc3 100644 --- a/poky/meta/lib/oeqa/runtime/cases/weston.py +++ b/poky/meta/lib/oeqa/runtime/cases/weston.py @@ -6,15 +6,8 @@ from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.data import skipIfNotFeature from oeqa.runtime.decorator.package import OEHasPackage -import threading -import time class WestonTest(OERuntimeTestCase): - weston_log_file = '/tmp/weston.log' - - @classmethod - def tearDownClass(cls): - cls.tc.target.run('rm %s' % cls.weston_log_file) @OETestDepends(['ssh.SSHTest.test_ssh']) @OEHasPackage(['weston']) @@ -24,46 +17,3 @@ class WestonTest(OERuntimeTestCase): msg = ('Weston does not appear to be running %s' % self.target.run(self.tc.target_cmds['ps'])[1]) self.assertEqual(status, 0, msg=msg) - - def get_processes_of(self, target, error_msg): - status, output = self.target.run('pidof %s' % target) - self.assertEqual(status, 0, msg='Retrieve %s (%s) processes error: %s' % (target, error_msg, output)) - return output.split(" ") - - def get_weston_command(self, cmd): - 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)) - - def get_new_wayland_processes(self, existing_wl_processes): - try_cnt = 0 - while try_cnt < 5: - time.sleep(5 + 5*try_cnt) - try_cnt += 1 - wl_processes = self.get_processes_of('weston-desktop-shell', 'existing and new') - new_wl_processes = [x for x in wl_processes if x not in existing_wl_processes] - if new_wl_processes: - return new_wl_processes, try_cnt - - return new_wl_processes, try_cnt - - @OEHasPackage(['weston']) - def test_weston_info(self): - status, output = self.target.run(self.get_weston_command('weston-info')) - self.assertEqual(status, 0, msg='weston-info error: %s' % output) - - @OEHasPackage(['weston']) - def test_weston_can_initialize_new_wayland_compositor(self): - existing_wl_processes = self.get_processes_of('weston-desktop-shell', 'existing') - existing_weston_processes = self.get_processes_of('weston', 'existing') - - weston_thread = threading.Thread(target=self.run_weston_init) - weston_thread.start() - 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) - __, 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)) |