diff options
Diffstat (limited to 'poky/meta/lib/oeqa/runtime')
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/multilib.py | 11 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/terminal.py | 18 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/weston.py | 12 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/x32lib.py | 17 |
4 files changed, 45 insertions, 13 deletions
diff --git a/poky/meta/lib/oeqa/runtime/cases/multilib.py b/poky/meta/lib/oeqa/runtime/cases/multilib.py index 62e662b01c..0d1b9ae2c9 100644 --- a/poky/meta/lib/oeqa/runtime/cases/multilib.py +++ b/poky/meta/lib/oeqa/runtime/cases/multilib.py @@ -7,6 +7,8 @@ from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.data import skipIfNotInDataVar from oeqa.runtime.decorator.package import OEHasPackage +import subprocess + class MultilibTest(OERuntimeTestCase): def archtest(self, binary, arch): @@ -14,8 +16,10 @@ class MultilibTest(OERuntimeTestCase): Check that ``binary`` has the ELF class ``arch`` (e.g. ELF32/ELF64). """ - status, output = self.target.run('readelf -h %s' % binary) - self.assertEqual(status, 0, 'Failed to readelf %s' % binary) + dest = "{}/test_binary".format(self.td.get('T', '')) + self.target.copyFrom(binary, dest) + output = subprocess.check_output("readelf -h {}".format(dest), shell=True).decode() + os.remove(dest) l = [l.split()[1] for l in output.split('\n') if "Class:" in l] if l: @@ -29,7 +33,6 @@ class MultilibTest(OERuntimeTestCase): @skipIfNotInDataVar('MULTILIBS', 'multilib:lib32', "This isn't a multilib:lib32 image") @OETestDepends(['ssh.SSHTest.test_ssh']) - @OEHasPackage(['binutils']) @OEHasPackage(['lib32-libc6']) def test_check_multilib_libc(self): """ @@ -39,6 +42,6 @@ class MultilibTest(OERuntimeTestCase): self.archtest("/lib64/libc.so.6", "ELF64") @OETestDepends(['multilib.MultilibTest.test_check_multilib_libc']) - @OEHasPackage(['lib32-connman', '!connman']) + @OEHasPackage(['lib32-connman']) def test_file_connman(self): self.archtest("/usr/sbin/connmand", "ELF32") diff --git a/poky/meta/lib/oeqa/runtime/cases/terminal.py b/poky/meta/lib/oeqa/runtime/cases/terminal.py new file mode 100644 index 0000000000..a268f26880 --- /dev/null +++ b/poky/meta/lib/oeqa/runtime/cases/terminal.py @@ -0,0 +1,18 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.runtime.decorator.package import OEHasPackage + +import threading +import time + +class TerminalTest(OERuntimeTestCase): + + @OEHasPackage(['matchbox-terminal']) + @OETestDepends(['ssh.SSHTest.test_ssh']) + def test_terminal_running(self): + t_thread = threading.Thread(target=self.target.run, args=('export DISPLAY=:0 && matchbox-terminal',)) + t_thread.start() + time.sleep(2) + status, output = self.target.run('pidof matchbox-terminal') + self.target.run('kill -9 %s' % output) + self.assertEqual(status, 0, msg='Not able to find process that runs terminal.') diff --git a/poky/meta/lib/oeqa/runtime/cases/weston.py b/poky/meta/lib/oeqa/runtime/cases/weston.py index ac29eca6e4..36b4f9e375 100644 --- a/poky/meta/lib/oeqa/runtime/cases/weston.py +++ b/poky/meta/lib/oeqa/runtime/cases/weston.py @@ -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-0 /usr/bin/weston --socket=wayland-1 --log=%s' % self.weston_log_file) + else: + self.target.run(self.get_weston_command('openvt -- weston --socket=wayland-1 --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)) diff --git a/poky/meta/lib/oeqa/runtime/cases/x32lib.py b/poky/meta/lib/oeqa/runtime/cases/x32lib.py index ddf220140e..f419c8f181 100644 --- a/poky/meta/lib/oeqa/runtime/cases/x32lib.py +++ b/poky/meta/lib/oeqa/runtime/cases/x32lib.py @@ -6,16 +6,21 @@ from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.data import skipIfNotInDataVar +import subprocess + class X32libTest(OERuntimeTestCase): @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32', 'DEFAULTTUNE is not set to x86-64-x32') @OETestDepends(['ssh.SSHTest.test_ssh']) def test_x32_file(self): - cmd = 'readelf -h /bin/ls | grep Class | grep ELF32' - status1 = self.target.run(cmd)[0] - cmd = 'readelf -h /bin/ls | grep Machine | grep X86-64' - status2 = self.target.run(cmd)[0] - msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % - self.target.run("readelf -h /bin/ls")[1]) + dest = self.td.get('T', '') + "/ls.x32test" + self.target.copyFrom("/bin/ls", dest) + cmd = 'readelf -h {} | grep Class | grep ELF32'.format(dest) + status1 = subprocess.call(cmd, shell=True) + cmd = 'readelf -h {} | grep Machine | grep X86-64'.format(dest) + status2 = subprocess.call(cmd, shell=True) + msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says:\n{}".format( + subprocess.check_output("readelf -h {}".format(dest), shell=True).decode())) + os.remove(dest) self.assertTrue(status1 == 0 and status2 == 0, msg=msg) |