From: Deepesh Varatharajan Date: Tue, 25 Nov 2025 08:40:05 +0000 (-0800) Subject: glibc: Enable NFS local file locking for glibc tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba4cc296f8cb9d91084f0d55382bf9ee3c1dda97;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git glibc: Enable NFS local file locking for glibc tests Some glibc tests in oe-selftest were failing with error: test-container.c:837: Cannot lock testroot The issue came from test-container.c, which creates testroot.pristine/lock.fd and uses flock() to coordinate test execution. The lock file itself was created successfully, but flock() failed only on the NFS-mounted test directory, while it worked everywhere else inside QEMU. The root cause is that the default NFS mount options used by oe-selftest implicitly set local_lock=none, which disables local file locking on NFSv3. With this setting in place, every flock() call on the mounted directory failed with ENOLCK (“No locks available”). Switching the mount to use local_lock=all restores local file locking on NFS and allows flock() to work as expected. With this change, the locking-dependent glibc tests run successfully. Testing results: before after diff PASS 6943 6968 +25 XPASS 4 4 0 FAIL 66 46 -20 XFAIL 16 16 0 UNSUPPORTED 108 103 -5 Signed-off-by: Deepesh Varatharajan Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/selftest/cases/glibc.py b/meta/lib/oeqa/selftest/cases/glibc.py index bd56b2f6e7..0838e8ac33 100644 --- a/meta/lib/oeqa/selftest/cases/glibc.py +++ b/meta/lib/oeqa/selftest/cases/glibc.py @@ -79,7 +79,7 @@ class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): # setup nfs mount if qemu.run("mkdir -p \"{0}\"".format(tmpdir))[0] != 0: raise Exception("Failed to setup NFS mount directory on target") - mountcmd = "mount -o noac,nfsvers=3,port={0},mountport={1} \"{2}:{3}\" \"{3}\"".format(nfsport, mountport, qemu.server_ip, tmpdir) + mountcmd = "mount -o noac,nfsvers=3,local_lock=all,port={0},mountport={1} \"{2}:{3}\" \"{3}\"".format(nfsport, mountport, qemu.server_ip, tmpdir) status, output = qemu.run(mountcmd) if status != 0: raise Exception("Failed to setup NFS mount on target ({})".format(repr(output)))