From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: Martin Doucha <martin.doucha@suse.com>,
Yongcheng Yang <yoyang@redhat.com>,
ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] statx07: Skip test if NFS server is never enabled
Date: Tue, 11 Feb 2025 18:20:19 +0100 [thread overview]
Message-ID: <20250211172019.GA1906142@pevik> (raw)
In-Reply-To: <20250211032457.7396-1-liwang@redhat.com>
Hi Li, all,
> The statx07 test requires an active NFS server, as it relies on
> exportfs, which reads from '/var/lib/nfs/etab'. By default, etab
> file does not exist unless the NFS server is started at least once
> (since new version nfs-utils-2.5.4-32.el9).
> This causing the test to fail when etab is missing:
> tst_test.c:1722: TINFO: Overall timeout per run is 0h 00m 30s
> tst_buffers.c:57: TINFO: Test is using guarded buffers
> exportfs: can't open /var/lib/nfs/etab for reading
> statx07.c:136: TBROK: failed to exportfs
> This patch adds a check using access("/var/lib/nfs/etab", F_OK)
> before running the test. If the file does not exist, the test
> is skipped (TCONF) instead of failing, preventing misleading
> test failures.
> Signed-off-by: Li Wang <liwang@redhat.com>
> Cc: Yongcheng Yang <yoyang@redhat.com>
> ---
> testcases/kernel/syscalls/statx/statx07.c | 3 +++
> 1 file changed, 3 insertions(+)
> diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
> index 968174330..bc8e6fd65 100644
> --- a/testcases/kernel/syscalls/statx/statx07.c
> +++ b/testcases/kernel/syscalls/statx/statx07.c
> @@ -115,6 +115,9 @@ static void setup(void)
> int ret;
> char server_path[BUFF_SIZE];
> + if (access("/var/lib/nfs/etab", F_OK) < 0)
> + tst_brk(TCONF, "nfs-server might not set up");
On Tumbleweed with nfs-client-2.8.1-44.2.x86_64:
# systemctl stop nfs-server.service
# ./statx07
...
tst_test.c:1904: TINFO: Tested kernel: 6.13.0-2.g0127a37-default #1 SMP PREEMPT_DYNAMIC Thu Jan 23 11:21:55 UTC 2025 (0127a37) x86_64
...
statx07.c:141: TCONF: nfs server not set up?: EOPNOTSUPP (95)
$ ls -la /var/lib/nfs/etab
The same behavior is on older systems (I checked SLE15-SP4 with 5.14 based
kernel and nfs-client-2.1.1).
There is a working detection. I wonder what is different on the system you test.
OTOH fortunately this patch would not break SLES/openSUSE (it would just not
help to detect), therefore I'm not against it.
Kind regards,
Petr
> +
> mode_t old_umask = umask(0);
> SAFE_MKDIR(SERV_PATH, DEFAULT_MODE);
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-02-11 17:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 3:24 [LTP] [PATCH] statx07: Skip test if NFS server is never enabled Li Wang
2025-02-11 17:20 ` Petr Vorel [this message]
2025-02-12 1:07 ` Yongcheng Yang
2025-02-12 1:44 ` Li Wang
2025-02-14 3:41 ` Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250211172019.GA1906142@pevik \
--to=pvorel@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
--cc=martin.doucha@suse.com \
--cc=yoyang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.