From: xuyang2018.jy@fujitsu.com <xuyang2018.jy@fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/semctl09: Skip libc test if SEM_STAT_ANY not defined
Date: Fri, 19 Mar 2021 08:44:33 +0000 [thread overview]
Message-ID: <60546464.1090002@fujitsu.com> (raw)
In-Reply-To: <YFRgzbKPtVBK/l5d@pevik>
Hi Petr
> Hi Xu,
>
>>>> + if (tst_variant == 1)
>>>> + tst_brk(TCONF, "libc does not support semctl(SEM_STAT_ANY)");
>>>> +#endif
>>> Although I understand why you want to quit only tests with root
>>> (only these fail), it's a bit confusing to test with user nobody
>>> and then quit the same testing with root.
>
>> I don't get this. Martin only wants to skip libc test when undefined and it
>> doesn't matter which user we use.
>
> if (tst_variant == 1)
> tst_brk(TCONF, "libc does not support semctl(SEM_STAT_ANY)");
>
> means:
>
> # /semctl09
> tst_test.c:1289: TINFO: Timeout per run is 0h 05m 00s
> semctl09.c:76: TINFO: Test SYS_semctl syscall
> semctl09.c:141: TINFO: Test SEM_STAT_ANY with nobody user
> semctl09.c:163: TPASS: SEM_INFO returned valid index 19 to semid 19
> semctl09.c:173: TPASS: Counted used = 1
> semctl09.c:121: TPASS: semset_cnt = 1
> semctl09.c:128: TPASS: sen_cnt = 2
> semctl09.c:141: TINFO: Test SEM_STAT_ANY with root user
> semctl09.c:163: TPASS: SEM_INFO returned valid index 19 to semid 19
> semctl09.c:173: TPASS: Counted used = 1
> semctl09.c:121: TPASS: semset_cnt = 1
> semctl09.c:128: TPASS: sen_cnt = 2
> tst_test.c:1289: TINFO: Timeout per run is 0h 05m 00s
> semctl09.c:191: TCONF: libc does not support semctl(SEM_STAT_ANY)
>
> i.e. run first test with user nobody and skip the second.
> It's a bit confusing to test anything with SEM_STAT_ANY and then state
> TCONF: libc does not support semctl(SEM_STAT_ANY) :)
Thanks. I got it.
I guess we can move this check into test_info as below:
--- a/testcases/kernel/syscalls/ipc/semctl/semctl09.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl09.c
@@ -77,6 +77,9 @@ static void test_info(void)
break;
case 1:
tst_res(TINFO, "Test libc semctl()");
+#ifndef HAVE_DECL_SEM_STAT_ANY
+ tst_brk(TCONF, "libc does not support
semctl(SEM_STAT_ANY)");
+#endif
break;
Then output as below:
# ./semctl09
tst_test.c:1291: TINFO: Timeout per run is 0h 05m 00s
semctl09.c:76: TINFO: Test SYS_semctl syscall
semctl09.c:144: TINFO: Test SEM_STAT_ANY with nobody user
semctl09.c:167: TPASS: SEM_INFO returned valid index 34 to semid 34
semctl09.c:176: TPASS: Counted used = 1
semctl09.c:124: TPASS: semset_cnt = 1
semctl09.c:131: TPASS: sen_cnt = 2
semctl09.c:144: TINFO: Test SEM_STAT_ANY with root user
semctl09.c:167: TPASS: SEM_INFO returned valid index 34 to semid 34
semctl09.c:176: TPASS: Counted used = 1
semctl09.c:124: TPASS: semset_cnt = 1
semctl09.c:131: TPASS: sen_cnt = 2
tst_test.c:1291: TINFO: Timeout per run is 0h 05m 00s
semctl09.c:79: TINFO: Test libc semctl()
semctl09.c:81: TCONF: libc does not support semctl(SEM_STAT_ANY)
>
> Kind regards,
> Petr
>
next prev parent reply other threads:[~2021-03-19 8:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 16:24 [LTP] [PATCH] syscalls/semctl09: Skip libc test if SEM_STAT_ANY not defined Martin Doucha
2021-03-18 18:30 ` Petr Vorel
2021-03-19 2:56 ` Yang Xu
2021-03-19 8:29 ` Petr Vorel
2021-03-19 8:44 ` xuyang2018.jy [this message]
2021-03-19 9:49 ` Martin Doucha
2021-03-19 11:22 ` Petr Vorel
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=60546464.1090002@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=ltp@lists.linux.it \
/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.