diff mbox series

[2/2] glibc: Enable NFS local file locking for glibc tests

Message ID 20251125084005.3939139-2-Deepesh.Varatharajan@windriver.com
State New
Headers show
Series [1/2] glibc: Drop 0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch | expand

Commit Message

Deepesh Varatharajan Nov. 25, 2025, 8:40 a.m. UTC
From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>

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>
---
 meta/lib/oeqa/selftest/cases/glibc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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)))