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