diff options
Diffstat (limited to 'poky/meta/lib/oeqa/runtime')
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-mipsarch.txt | 6 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-qemuall.txt | 8 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/parselogs.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/scp.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/ssh.py | 31 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/systemd.py | 17 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/context.py | 12 |
7 files changed, 62 insertions, 16 deletions
diff --git a/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-mipsarch.txt b/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-mipsarch.txt index 2c0bd9a247..9c2677c4cf 100644 --- a/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-mipsarch.txt +++ b/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-mipsarch.txt @@ -1,2 +1,8 @@ # These should be reviewed to see if they are still needed cacheinfo: Failed to find cpu0 device node + +# 6.10 restructures sysctl registration such that mips +# registers an empty table and generates harmless warnings: +# failed when register_sysctl_sz sched_fair_sysctls to kernel +# failed when register_sysctl_sz sched_core_sysctls to kernel +failed when register_sysctl_sz sched diff --git a/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-qemuall.txt b/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-qemuall.txt index b0c0fc9ddf..143db40d63 100644 --- a/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-qemuall.txt +++ b/poky/meta/lib/oeqa/runtime/cases/parselogs-ignores-qemuall.txt @@ -13,6 +13,14 @@ FBIOPUT_VSCREENINFO failed, double buffering disabled # pci 0000:00:00.0: [Firmware Bug]: reg 0x20: invalid BAR (can't size) # pci 0000:00:00.0: [Firmware Bug]: reg 0x24: invalid BAR (can't size) invalid BAR (can't size) +# 6.10+ the invalid BAR warnings are of this format: +# pci 0000:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size +# pci 0000:00:00.0: [Firmware Bug]: BAR 1: invalid; can't size +# pci 0000:00:00.0: [Firmware Bug]: BAR 2: invalid; can't size +# pci 0000:00:00.0: [Firmware Bug]: BAR 3: invalid; can't size +# pci 0000:00:00.0: [Firmware Bug]: BAR 4: invalid; can't size +# pci 0000:00:00.0: [Firmware Bug]: BAR 5: invalid; can't size +invalid; can't size # These should be reviewed to see if they are still needed wrong ELF class diff --git a/poky/meta/lib/oeqa/runtime/cases/parselogs.py b/poky/meta/lib/oeqa/runtime/cases/parselogs.py index 6966923c94..47c77fccd5 100644 --- a/poky/meta/lib/oeqa/runtime/cases/parselogs.py +++ b/poky/meta/lib/oeqa/runtime/cases/parselogs.py @@ -34,7 +34,7 @@ class ParseLogsTest(OERuntimeTestCase): log_locations = ["/var/log/", "/var/log/dmesg", "/tmp/dmesg_output.log"] # The keywords that identify error messages in the log files - errors = ["error", "cannot", "can't", "failed"] + errors = ["error", "cannot", "can't", "failed", "---[ cut here ]---", "No irq handler for vector"] # A list of error messages that should be ignored ignore_errors = [] diff --git a/poky/meta/lib/oeqa/runtime/cases/scp.py b/poky/meta/lib/oeqa/runtime/cases/scp.py index ee97b8ef66..364264369a 100644 --- a/poky/meta/lib/oeqa/runtime/cases/scp.py +++ b/poky/meta/lib/oeqa/runtime/cases/scp.py @@ -25,7 +25,7 @@ class ScpTest(OERuntimeTestCase): os.remove(cls.tmp_path) @OETestDepends(['ssh.SSHTest.test_ssh']) - @OEHasPackage(['openssh-scp']) + @OEHasPackage({'openssh-scp', 'openssh-sftp-server'}) def test_scp_file(self): dst = '/tmp/test_scp_file' diff --git a/poky/meta/lib/oeqa/runtime/cases/ssh.py b/poky/meta/lib/oeqa/runtime/cases/ssh.py index cdbef59500..89d64430e5 100644 --- a/poky/meta/lib/oeqa/runtime/cases/ssh.py +++ b/poky/meta/lib/oeqa/runtime/cases/ssh.py @@ -4,6 +4,9 @@ # SPDX-License-Identifier: MIT # +import time +import signal + from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.runtime.decorator.package import OEHasPackage @@ -13,12 +16,22 @@ class SSHTest(OERuntimeTestCase): @OETestDepends(['ping.PingTest.test_ping']) @OEHasPackage(['dropbear', 'openssh-sshd']) def test_ssh(self): - (status, output) = self.target.run('sleep 20', timeout=2) - msg='run() timed out but return code was zero.' - self.assertNotEqual(status, 0, msg=msg) - (status, output) = self.target.run('uname -a') - self.assertEqual(status, 0, msg='SSH Test failed: %s' % output) - (status, output) = self.target.run('cat /etc/controllerimage') - msg = "This isn't the right image - /etc/controllerimage " \ - "shouldn't be here %s" % output - self.assertEqual(status, 1, msg=msg) + for i in range(5): + status, output = self.target.run("uname -a", timeout=30) + if status == 0: + break + elif status == 255 or status == -signal.SIGTERM: + # ssh returns 255 only if a ssh error occurs. This could + # be an issue with "Connection refused" because the port + # isn't open yet, and this could check explicitly for that + # here. However, let's keep it simple and just retry for + # all errors a limited amount of times with a sleep to + # give it time for the port to open. + # We sometimes see -15 (SIGTERM) on slow emulation machines too, likely + # from boot/init not being 100% complete, retry for these too. + time.sleep(5) + continue + else: + self.fail("uname failed with \"%s\" (exit code %s)" % (output, status)) + if status != 0: + self.fail("ssh failed with \"%s\" (exit code %s)" % (output, status)) diff --git a/poky/meta/lib/oeqa/runtime/cases/systemd.py b/poky/meta/lib/oeqa/runtime/cases/systemd.py index 80fdae240a..640f28abe9 100644 --- a/poky/meta/lib/oeqa/runtime/cases/systemd.py +++ b/poky/meta/lib/oeqa/runtime/cases/systemd.py @@ -150,12 +150,21 @@ class SystemdServiceTests(SystemdTest): t_thread.start() time.sleep(1) - status, output = self.target.run('pidof sleep') + status, sleep_pid = self.target.run('pidof sleep') # cause segfault on purpose - self.target.run('kill -SEGV %s' % output) - self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output) + self.target.run('kill -SEGV %s' % sleep_pid) + self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % sleep_pid) - (status, output) = self.target.run('coredumpctl info') + # Give some time to systemd-coredump@.service to process the coredump + for x in range(20): + status, output = self.target.run('coredumpctl list %s' % sleep_pid) + if status == 0: + break + time.sleep(1) + else: + self.fail("Timed out waiting for coredump creation") + + (status, output) = self.target.run('coredumpctl info %s' % sleep_pid) self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output) self.assertEqual('sleep_for_duration (busybox.nosuid' in output or 'xnanosleep (sleep.coreutils' in output, True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output) diff --git a/poky/meta/lib/oeqa/runtime/context.py b/poky/meta/lib/oeqa/runtime/context.py index cb7227a8df..daabc44910 100644 --- a/poky/meta/lib/oeqa/runtime/context.py +++ b/poky/meta/lib/oeqa/runtime/context.py @@ -8,6 +8,7 @@ import os import sys from oeqa.core.context import OETestContext, OETestContextExecutor +from oeqa.core.target.serial import OESerialTarget from oeqa.core.target.ssh import OESSHTarget from oeqa.core.target.qemu import OEQemuTarget @@ -60,7 +61,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): runtime_group = self.parser.add_argument_group('runtime options') runtime_group.add_argument('--target-type', action='store', - default=self.default_target_type, choices=['simpleremote', 'qemu'], + default=self.default_target_type, choices=['simpleremote', 'qemu', 'serial'], help="Target type of device under test, default: %s" \ % self.default_target_type) runtime_group.add_argument('--target-ip', action='store', @@ -108,6 +109,8 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): target = OESSHTarget(logger, target_ip, server_ip, **kwargs) elif target_type == 'qemu': target = OEQemuTarget(logger, server_ip, **kwargs) + elif target_type == 'serial': + target = OESerialTarget(logger, target_ip, server_ip, **kwargs) else: # XXX: This code uses the old naming convention for controllers and # targets, the idea it is to leave just targets as the controller @@ -203,8 +206,15 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): super(OERuntimeTestContextExecutor, self)._process_args(logger, args) + td = self.tc_kwargs['init']['td'] + target_kwargs = {} + target_kwargs['machine'] = td.get("MACHINE") or None target_kwargs['qemuboot'] = args.qemu_boot + target_kwargs['serialcontrol_cmd'] = td.get("TEST_SERIALCONTROL_CMD") or None + target_kwargs['serialcontrol_extra_args'] = td.get("TEST_SERIALCONTROL_EXTRA_ARGS") or "" + target_kwargs['serialcontrol_ps1'] = td.get("TEST_SERIALCONTROL_PS1") or None + target_kwargs['serialcontrol_connect_timeout'] = td.get("TEST_SERIALCONTROL_CONNECT_TIMEOUT") or None self.tc_kwargs['init']['target'] = \ OERuntimeTestContextExecutor.getTarget(args.target_type, |