Skip to contentSkip to conversation

sigpending: Use 3 variants via test_multiplex()

PATCH New Petr Vorel 2 participants 5 messages Mar 25, 2019 – Mar 26, 2019

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 sigpending: Use 3 variants via test_multiplex()

We're now testing sigpending() libc wrapper, __NR_sigpending and __NR_rt_sigpending syscalls.

This brings again testing libc sigpending() implementation, which was removed in
63f8a3f77 ("sigpending: use direct syscall")

and removes sharing code and directory rt_sigpending introduced in b03885fff ("rt_sigpending02: reuse code from sigpending02")

+ removed unused headers.

---
Hi,

this patch expects Cyril's multiplex function [1] be merged.

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/list/?series=98725&state=*

---
 runtest/syscalls                              |  1 -
 .../kernel/syscalls/rt_sigpending/.gitignore  |  1 -
 .../kernel/syscalls/rt_sigpending/Makefile    | 15 ----
 .../kernel/syscalls/sigpending/sigpending02.c | 74 +++++++++++--------
 4 files changed, 44 insertions(+), 47 deletions(-)
 delete mode 100644 testcases/kernel/syscalls/rt_sigpending/.gitignore
 delete mode 100644 testcases/kernel/syscalls/rt_sigpending/Makefile
runtest/syscalls +0 -1
index a13d51918..e52f80bef 100644
@@ -1001,7 +1001,6 @@ rmdir03A symlink01 -T rmdir03
 rt_sigaction01 rt_sigaction01
 rt_sigaction02 rt_sigaction02
 rt_sigaction03 rt_sigaction03
-rt_sigpending02 rt_sigpending02
 rt_sigprocmask01 rt_sigprocmask01
 rt_sigprocmask02 rt_sigprocmask02
 rt_sigqueueinfo01 rt_sigqueueinfo01
testcases/kernel/syscalls/rt_sigpending/.gitignore deleted +0 -1
deleted file mode 100644
index 85905fc83..000000000
@@ -1 +0,0 @@
-/rt_sigpending02
testcases/kernel/syscalls/rt_sigpending/Makefile deleted +0 -15
deleted file mode 100644
index 57ba3dac2..000000000
@@ -1,15 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) 2019, Linux Test Project
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-CPPFLAGS += -DTEST_RT_SIGPENDING
-
-rt_sigpending02: $(abs_srcdir)/../sigpending/sigpending02.c
-	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION)
-
-MAKE_TARGETS := rt_sigpending02
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/sigpending/sigpending02.c +44 -30

122 lines not on this page · raw message

Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 sigpending: Use 3 variants via test_multiplex()

Hi!

testcases/kernel/syscalls/sigpending/sigpending02.c static void test_efault_on_invalid_sigset(void) · line 162

Quoted 12 lines

static void run(void)
{

testcases/kernel/syscalls/sigpending/sigpending02.c +3 -1
+	sigpending_info();
 	test_sigpending();
 	test_efault_on_invalid_sigset();
 }
 
 static struct tst_test test = {
-	.test_all = run
+	.test_all = run,
+	.test_variants = 3,
 };

I would rather see .setup = singpending_info, here so that we don't spam the output that much, otherwise it looks good.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 sigpending: Use 3 variants via test_multiplex()

Hi Cyril,

Quoted 8 lines

Hi!

Quoted 6 lines

static void run(void)
{

testcases/kernel/syscalls/sigpending/sigpending02.c +1 -0
+	sigpending_info();
 	test_sigpending();
 	test_efault_on_invalid_sigset();
 }
Quoted 8 lines

testcases/kernel/syscalls/sigpending/sigpending02.c static void test_efault_on_invalid_sigset(void) · line 162

Quoted 5 lines

static struct tst_test test = {

testcases/kernel/syscalls/sigpending/sigpending02.c +2 -1
-	.test_all = run
+	.test_all = run,
+	.test_variants = 3,
 };

I would rather see .setup = singpending_info, here so that we don't spam the output that much, otherwise it looks good.

No problem, but with the following diff is the output the same. Am I missing something?

Kind regards,
Petr

+++ testcases/kernel/syscalls/sigpending/sigpending02.c
@@ -151,12 +151,12 @@ static void test_efault_on_invalid_sigset(void)

static void run(void)
{
- sigpending_info();
test_sigpending();
test_efault_on_invalid_sigset();
}

static struct tst_test test = {
+ .setup = sigpending_info,
.test_all = run,
.test_variants = 3,
};

---
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s sigpending02.c:24: INFO: Testing libc sigpending() sigpending02.c:113: PASS: basic sigpending test successful sigpending02.c:143: PASS: expected failure: EFAULT tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s sigpending02.c:27: INFO: Testing __NR_sigpending syscall sigpending02.c:42: CONF: syscall(-1) __NR_sigpending not supported tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s sigpending02.c:30: INFO: Testing __NR_rt_sigpending syscall sigpending02.c:113: PASS: basic sigpending test successful sigpending02.c:143: PASS: expected failure: EFAULT

Summary:

passed   4
failed   0
skipped  0

warnings 0

#3 lore raw

PATCH 1/1 sigpending: Use 3 variants via test_multiplex()

Hi!

Quoted 11 lines
Quoted 8 lines

testcases/kernel/syscalls/sigpending/sigpending02.c static void test_efault_on_invalid_sigset(void) · line 162

Quoted 5 lines

static struct tst_test test = {

testcases/kernel/syscalls/sigpending/sigpending02.c +2 -1
-	.test_all = run
+	.test_all = run,
+	.test_variants = 3,
 };

I would rather see .setup = singpending_info, here so that we don't spam the output that much, otherwise it looks good.

No problem, but with the following diff is the output the same. Am I missing something?

Ah, my bad, we are using test_all instead of test function, so indeed the output is the same. I blame it on ENOCOFFEE error my brain reported in the morning.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#4 lore raw

PATCH 1/1 sigpending: Use 3 variants via test_multiplex()

Hi Cyril,

Quoted 9 lines
Quoted 8 lines
Quoted 8 lines

testcases/kernel/syscalls/sigpending/sigpending02.c static void test_efault_on_invalid_sigset(void) · line 162

Quoted 5 lines

static struct tst_test test = {

testcases/kernel/syscalls/sigpending/sigpending02.c +2 -1
-	.test_all = run
+	.test_all = run,
+	.test_variants = 3,
 };

I would rather see .setup = singpending_info, here so that we don't spam the output that much, otherwise it looks good.

Quoted 6 lines
Quoted 2 lines

No problem, but with the following diff is the output the same. Am I missing something?

Ah, my bad, we are using test_all instead of test function, so indeed the output is the same. I blame it on ENOCOFFEE error my brain reported in the morning.

OK, pushed the original variant. At least you have good error checking :).

Kind regards,
Petr