summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2025-07-12 14:50:42 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-14 17:49:48 +0100
commit873430cecaa512bb2055c79d69733f8601523049 (patch)
treed0565541b996beeda036f9f01126175dce14e546 /meta/lib/oeqa/utils
parentad5df78c55481fccdae18f4303e5c04bea491467 (diff)
downloadpoky-873430cecaa512bb2055c79d69733f8601523049.tar.gz
oe-selftest: devtool: split tap detection into function
Make the check for tap devices available as a function which can be used by other tests as well. (From OE-Core rev: ad8f3a8d959a245301118cf7b850f1a0ab567f01) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/commands.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index b60a6e6c38..e049e1ee68 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -401,6 +401,22 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
401 targetlogger.removeHandler(handler) 401 targetlogger.removeHandler(handler)
402 qemu.stop() 402 qemu.stop()
403 403
404def runqemu_check_taps():
405 """Check if tap devices for runqemu are available"""
406 if not os.path.exists('/etc/runqemu-nosudo'):
407 return False
408 result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ip tuntap show', ignore_status=True)
409 if result.status != 0:
410 result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ifconfig -a', ignore_status=True)
411 if result.status != 0:
412 return False
413 for line in result.output.splitlines():
414 if line.startswith('tap'):
415 break
416 else:
417 return False
418 return True
419
404def updateEnv(env_file): 420def updateEnv(env_file):
405 """ 421 """
406 Source a file and update environment. 422 Source a file and update environment.