From: Anuj Mittal Date: Wed, 26 Jul 2023 16:22:08 +0000 (+0800) Subject: oeqa/utils/nfs: allow requesting non-udp ports X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~280 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1ff9b9a3b7f7924aea67d2024581bea2e916036;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa/utils/nfs: allow requesting non-udp ports Allows setting up NFS over TCP as well. Signed-off-by: Anuj Mittal Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/utils/nfs.py b/meta/lib/oeqa/utils/nfs.py index b66ed42a582..903469bfeec 100644 --- a/meta/lib/oeqa/utils/nfs.py +++ b/meta/lib/oeqa/utils/nfs.py @@ -12,7 +12,7 @@ from oeqa.utils.commands import bitbake, get_bb_var, Command from oeqa.utils.network import get_free_port @contextlib.contextmanager -def unfs_server(directory, logger = None): +def unfs_server(directory, logger = None, udp = True): unfs_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "unfs3-native") if not os.path.exists(os.path.join(unfs_sysroot, "usr", "bin", "unfsd")): # build native tool @@ -26,7 +26,7 @@ def unfs_server(directory, logger = None): exports.write("{0} (rw,no_root_squash,no_all_squash,insecure)\n".format(directory).encode()) # find some ports for the server - nfsport, mountport = get_free_port(udp = True), get_free_port(udp = True) + nfsport, mountport = get_free_port(udp), get_free_port(udp) nenv = dict(os.environ) nenv['PATH'] = "{0}/sbin:{0}/usr/sbin:{0}/usr/bin:".format(unfs_sysroot) + nenv.get('PATH', '')