diff options
author | Adrian Freihofer <adrian.freihofer@siemens.com> | 2025-07-12 14:50:42 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-14 17:49:48 +0100 |
commit | 873430cecaa512bb2055c79d69733f8601523049 (patch) | |
tree | d0565541b996beeda036f9f01126175dce14e546 /meta/lib/oeqa/utils | |
parent | ad5df78c55481fccdae18f4303e5c04bea491467 (diff) | |
download | poky-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.py | 16 |
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 | ||
404 | def 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 | |||
404 | def updateEnv(env_file): | 420 | def updateEnv(env_file): |
405 | """ | 421 | """ |
406 | Source a file and update environment. | 422 | Source a file and update environment. |