@@ -99,7 +99,8 @@ CORE_IMAGE_EXTRA_INSTALL += "elfutils"
% (qemu.server_ip, port)
)
self.logger.info(f"Starting client {cmd}")
- status, output = qemu.run_serial(cmd)
+ status, output = qemu.run_serial_socket(cmd)
+ self.assertEqual(0, status)
# This should be more comprehensive
self.assertIn("/.cache/debuginfod_client/", output)
finally:
@@ -43,7 +43,8 @@ CORE_IMAGE_EXTRA_INSTALL = "gdbserver"
shutil.unpack_archive(filename, debugfs)
with runqemu("core-image-minimal", runqemuparams="nographic") as qemu:
- status, output = qemu.run_serial("kmod --help")
+ status, output = qemu.run_serial_socket("kmod --help")
+ self.assertEqual(status, 0)
self.assertIn("modprobe", output)
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
@@ -61,7 +62,7 @@ CORE_IMAGE_EXTRA_INSTALL = "gdbserver"
self.fail("Timed out connecting to gdb")
future = executor.submit(run_gdb)
- status, output = qemu.run_serial("gdbserver --once :9999 kmod --help")
- self.assertEqual(status, 1)
+ status, output = qemu.run_serial_socket("gdbserver --once :9999 kmod --help")
+ self.assertEqual(status, 0)
# The future either returns None, or raises an exception
future.result()
@@ -27,15 +27,15 @@ class LocalesTest(OESelftestTestCase):
with runqemu("core-image-minimal", ssh=False, runqemuparams='nographic') as qemu:
cmd = "locale -a"
- status, output = qemu.run_serial(cmd)
+ status, output = qemu.run_serial_socket(cmd)
# output must includes fr_FR or fr_FR.UTF-8
- self.assertEqual(status, 1, msg='locale test command failed: output: %s' % output)
+ self.assertEqual(status, 0, msg='locale test command failed: output: %s' % output)
self.assertIn("fr_FR", output, msg='locale -a test failed: output: %s' % output)
cmd = "localedef --list-archive -v"
- status, output = qemu.run_serial(cmd)
+ status, output = qemu.run_serial_socket(cmd)
# output must includes fr_FR.utf8
- self.assertEqual(status, 1, msg='localedef test command failed: output: %s' % output)
+ self.assertEqual(status, 0, msg='localedef test command failed: output: %s' % output)
self.assertIn("fr_FR.utf8", output, msg='localedef test failed: output: %s' % output)
def test_locales_on(self):
@@ -135,7 +135,8 @@ class PackageTests(OESelftestTestCase):
Check that gdb ``binary`` to read symbols from separated debug file
"""
self.logger.info("gdbtest %s" % binary)
- status, output = qemu.run_serial('/usr/bin/gdb.sh %s' % binary, timeout=60)
+ status, output = qemu.run_serial_socket('/usr/bin/gdb.sh %s' % binary, timeout=60)
+ self.assertEqual(0, status)
for l in output.split('\n'):
# Check debugging symbols exists
if '(no debugging symbols found)' in l:
@@ -166,8 +167,8 @@ class PackageTests(OESelftestTestCase):
def check_ownership(qemu, expected_gid, expected_uid, path):
self.logger.info("Check ownership of %s", path)
- status, output = qemu.run_serial('stat -c "%U %G" ' + path)
- self.assertEqual(status, 1, "stat failed: " + output)
+ status, output = qemu.run_serial_socket('stat -c "%U %G" ' + path)
+ self.assertEqual(status, 0, "stat failed: " + output)
try:
uid, gid = output.split()
self.assertEqual(uid, expected_uid)
@@ -183,7 +183,7 @@ class QemuTest(OESelftestTestCase):
# (such as the exception "Console connection closed unexpectedly")
# as qemu will disappear when we shut it down
qemu.runner.allowexit()
- qemu.run_serial("shutdown -h now")
+ qemu.run_serial_socket("shutdown -h now")
time_track = 0
try:
while True:
Prefer the new function run_serial_socket. Change calls where the modification is easy. Signed-off-by: Louis Rannou <lrannou@baylibre.com> --- meta/lib/oeqa/selftest/cases/debuginfod.py | 3 ++- meta/lib/oeqa/selftest/cases/gdbserver.py | 7 ++++--- meta/lib/oeqa/selftest/cases/locales.py | 8 ++++---- meta/lib/oeqa/selftest/cases/package.py | 7 ++++--- meta/lib/oeqa/selftest/cases/runqemu.py | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-)