You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/tests/tcg
Peter Maydell 77dc9d662f tests/tcg/multiarch/linux/linux-test: Don't try to test atime update
The linux-test test includes an attempt to check the utime and stat
syscalls by setting the atime and mtime of a file to specific values,
and then calling stat() to check that the values read back correctly.

Unfortunately this is flaky, as it will fail if some other process
(for instance a virus scanner, backup program, etc) gets in and reads
the file between the utime() and stat() call, resulting in a host
syscall sequence like this:

utimensat(AT_FDCWD, "file2",
  [{tv_sec=1001, tv_nsec=0} /* 1970-01-01T01:16:41+0100 */,
   {tv_sec=1000, tv_nsec=0} /* 1970-01-01T01:16:40+0100 */], 0) = 0
# successfully set atime to 1001 and mtime to 1000
statx(AT_FDCWD, "file2", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT,
  STATX_BASIC_STATS,
  {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID,
   stx_blksize=4096, stx_attributes=0, stx_nlink=1, stx_uid=32808,
   stx_gid=32808, stx_mode=S_IFREG|0600, stx_ino=21659016,
   stx_size=100, stx_blocks=8,
   stx_attributes_mask=STATX_ATTR_COMPRESSED|STATX_ATTR_IMMUTABLE|
         STATX_ATTR_APPEND|STATX_ATTR_NODUMP|STATX_ATTR_ENCRYPTED|
         STATX_ATTR_AUTOMOUNT|STATX_ATTR_MOUNT_ROOT|STATX_ATTR_VERITY|
         STATX_ATTR_DAX,
   stx_atime={tv_sec=1760091862, tv_nsec=63509009} /* 2025-10-10T11:24:22.063509009+0100 */,
   stx_ctime={tv_sec=1760091862, tv_nsec=63509009} /* 2025-10-10T11:24:22.063509009+0100 */,
   stx_mtime={tv_sec=1000, tv_nsec=0} /* 1970-01-01T01:16:40+0100 */,
   stx_rdev_major=0, stx_rdev_minor=0, stx_dev_major=252,
   stx_dev_minor=0, stx_mnt_id=0x1f}) = 0
# but when we statx the file, we get back an mtime of 1000
# but an atime corresponding to when the other process read it

and which will cause the test program to fail with the error
message "stat time".

In theory we could defend against this by e.g.  operating on files in
a dummy loopback mount filesystem which we mounted as 'noatime', but
this isn't worth the hassle.  Just drop the check on atime.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20251016150357.876415-4-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
3 days ago
..
aarch64 tests/tcg/aarch64: Add gcsss 2 weeks ago
aarch64_be tests/tcg: enable basic testing for aarch64_be-linux-user 1 year ago
alpha tests/tcg: add a system test to check memory instrumentation 1 year ago
arm tests/tcg: Suppress compiler false-positive warning on sha1.c 8 months ago
hexagon tests/tcg/hexagon: Add cs{0,1} coverage 6 days ago
hppa tests/tcg: Remove run-test-mmap-* 2 years ago
i386 tests/tcg: enable -fwrapv for test-i386-bmi 8 months ago
loongarch64 hw/loongarch/virt: Get physical entry address with elf file 6 months ago
m68k tests/tcg: Remove run-test-mmap-* 2 years ago
minilib tests/tcg/minilib: Constify digits in print_num 1 year ago
mips tests/tcg/mips: Add tests for MIPS CRC32[c] instructions 3 months ago
multiarch tests/tcg/multiarch/linux/linux-test: Don't try to test atime update 3 days ago
openrisc target/openrisc: Rename the cpu from or32 to or1k 9 years ago
plugins qemu: Declare all load/store helper in 'qemu/bswap.h' 3 months ago
ppc64 tests/tcg: Replace -mpower8-vector with -mcpu=power8 12 months ago
ppc64le tests/tcg: unify ppc64 and ppc64le Makefiles 3 years ago
riscv64 tests/tcg/riscv64: Add test for MEPC bit masking 4 months ago
s390x tests, scripts: Don't import print_function from __future__ 1 month ago
sh4 target/sh4: Fix SUBV opcode 1 year ago
tricore tests/tcg: Reset result register after each test 2 years ago
x86_64 tests/tcg: Fix run for tests with specific plugin 3 months ago
xtensa tests/tcg/xtensa: add icount/ibreak priority test 2 years ago
xtensaeb tcg: Correct invalid mentions of 'softmmu' by 'system-mode' 2 years ago
Makefile.target tests/tcg: Fix run for tests with specific plugin 3 months ago
README tests/tcg: update README 1 year ago

README

This directory contains various interesting guest binaries for
regression testing the Tiny Code Generator doing system and user-mode
emulation.

The multiarch directory contains shared code for tests that can be
built for all guest architectures. Architecture specific code can be
found in their respective directories.

System mode tests will be under the "system" subdirectories.

GDB scripts for exercising the gdbstub on specific tests will be found
under the "gdbstb" subdirectories.

See the developer guide for more instructions on "make check-tcg"