]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
glibc: Enable NFS local file locking for glibc tests
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Tue, 25 Nov 2025 08:40:05 +0000 (00:40 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Dec 2025 14:45:36 +0000 (14:45 +0000)
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 <Deepesh.Varatharajan@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/glibc.py

index bd56b2f6e77d91bcad808daa0ebeb00abe678655..0838e8ac33c6c01fecc123b7f2837f46774f2552 100644 (file)
@@ -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)))