* [LTP] [PATCH] gethostid: skip test if sethostid undefined
2021-07-08 13:06 [LTP] [PATCH] gethostid: skip test if sethostid undefined Li Wang
@ 2021-07-08 12:58 ` Cyril Hrubis
2021-07-08 13:35 ` Li Wang
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2021-07-08 12:58 UTC (permalink / raw)
To: ltp
Hi!
> This is to avoid compiling error if the sethostid() is not
> implemented, e.g. build with Alpine's musl-libc.
>
> CI: https://github.com/wangli5665/ltp/runs/3019192920
>
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
> configure.ac | 1 +
> testcases/kernel/syscalls/gethostid/gethostid01.c | 6 ++++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 1a43ebea8..25c421de0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -128,6 +128,7 @@ AC_CHECK_FUNCS_ONCE([ \
> renameat2 \
> sched_getcpu \
> sendmmsg \
> + sethostid \
> setns \
> sigpending \
> splice \
> diff --git a/testcases/kernel/syscalls/gethostid/gethostid01.c b/testcases/kernel/syscalls/gethostid/gethostid01.c
> index 802604777..20e4cd307 100644
> --- a/testcases/kernel/syscalls/gethostid/gethostid01.c
> +++ b/testcases/kernel/syscalls/gethostid/gethostid01.c
> @@ -26,6 +26,8 @@
>
> #include "tst_test.h"
Shouldn't we include config.h here?
> +#ifdef HAVE_SETHOSTID
> +
> static long origin;
> static long tc[] = {0x00000000, 0x0000ffff};
>
> @@ -64,3 +66,7 @@ static struct tst_test test = {
> .needs_root = 1,
> .tcnt = ARRAY_SIZE(tc),
> };
> +
> +#else
> +TST_TEST_TCONF("sethostid is undefined.");
> +#endif
Other than that Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] gethostid: skip test if sethostid undefined
@ 2021-07-08 13:06 Li Wang
2021-07-08 12:58 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2021-07-08 13:06 UTC (permalink / raw)
To: ltp
This is to avoid compiling error if the sethostid() is not
implemented, e.g. build with Alpine's musl-libc.
CI: https://github.com/wangli5665/ltp/runs/3019192920
Signed-off-by: Li Wang <liwang@redhat.com>
---
configure.ac | 1 +
testcases/kernel/syscalls/gethostid/gethostid01.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index 1a43ebea8..25c421de0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,7 @@ AC_CHECK_FUNCS_ONCE([ \
renameat2 \
sched_getcpu \
sendmmsg \
+ sethostid \
setns \
sigpending \
splice \
diff --git a/testcases/kernel/syscalls/gethostid/gethostid01.c b/testcases/kernel/syscalls/gethostid/gethostid01.c
index 802604777..20e4cd307 100644
--- a/testcases/kernel/syscalls/gethostid/gethostid01.c
+++ b/testcases/kernel/syscalls/gethostid/gethostid01.c
@@ -26,6 +26,8 @@
#include "tst_test.h"
+#ifdef HAVE_SETHOSTID
+
static long origin;
static long tc[] = {0x00000000, 0x0000ffff};
@@ -64,3 +66,7 @@ static struct tst_test test = {
.needs_root = 1,
.tcnt = ARRAY_SIZE(tc),
};
+
+#else
+TST_TEST_TCONF("sethostid is undefined.");
+#endif
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH] gethostid: skip test if sethostid undefined
2021-07-08 12:58 ` Cyril Hrubis
@ 2021-07-08 13:35 ` Li Wang
2021-07-08 17:00 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2021-07-08 13:35 UTC (permalink / raw)
To: ltp
> > --- a/testcases/kernel/syscalls/gethostid/gethostid01.c
> > +++ b/testcases/kernel/syscalls/gethostid/gethostid01.c
> > @@ -26,6 +26,8 @@
> >
> > #include "tst_test.h"
>
> Shouldn't we include config.h here?
>
Yes, merged with including. Thanks for the quick reply.
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210708/f407eb87/attachment.htm>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] gethostid: skip test if sethostid undefined
2021-07-08 13:35 ` Li Wang
@ 2021-07-08 17:00 ` Petr Vorel
0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2021-07-08 17:00 UTC (permalink / raw)
To: ltp
Hi Li,
> > > --- a/testcases/kernel/syscalls/gethostid/gethostid01.c
> > > +++ b/testcases/kernel/syscalls/gethostid/gethostid01.c
> > > @@ -26,6 +26,8 @@
> > > #include "tst_test.h"
> > Shouldn't we include config.h here?
> Yes, merged with including. Thanks for the quick reply.
Thanks for fixing 39f341af5 ("gethostid: Rewrite with newlib and use/test sethostid")
Kind regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-08 17:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 13:06 [LTP] [PATCH] gethostid: skip test if sethostid undefined Li Wang
2021-07-08 12:58 ` Cyril Hrubis
2021-07-08 13:35 ` Li Wang
2021-07-08 17:00 ` Petr Vorel
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.