diff mbox series

[v1,08/10] Remove check_newuser from userns testing suite

Message ID 20230215101615.27534-9-andrea.cervesato@suse.com
State Accepted
Headers show
Series Remove libclone support from userns testing suite | expand

Commit Message

Andrea Cervesato Feb. 15, 2023, 10:16 a.m. UTC
CLONE_NEWUSER is supported from kernel 3.8 and LTP supports all
kernels >= 3.10. For this reason, we can remove any check for
CLONE_NEWUSER support and to make userns common.h a bit simpler.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 testcases/kernel/containers/userns/common.h | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/testcases/kernel/containers/userns/common.h b/testcases/kernel/containers/userns/common.h
index 635d0f190..9b3a47b69 100644
--- a/testcases/kernel/containers/userns/common.h
+++ b/testcases/kernel/containers/userns/common.h
@@ -8,35 +8,17 @@ 
 #define COMMON_H
 
 #include "tst_test.h"
-#include "lapi/sched.h"
 
 #define UID_MAP 0
 #define GID_MAP 1
 
-static int dummy_child(void *v)
-{
-	(void)v;
-	return 0;
-}
-
-static inline void check_newuser(void)
-{
-	int pid, status;
-
-	pid = ltp_clone_quick(CLONE_NEWUSER | SIGCHLD, dummy_child, NULL);
-	if (pid == -1)
-		tst_brk(TCONF | TTERRNO, "CLONE_NEWUSER not supported");
-
-	SAFE_WAIT(&status);
-}
-
 static inline void updatemap(int cpid, int type, int idnum, int parentmappid)
 {
 	char path[BUFSIZ];
 	char content[BUFSIZ];
 	int fd;
 
-	switch(type) {
+	switch (type) {
 	case UID_MAP:
 		sprintf(path, "/proc/%d/uid_map", cpid);
 		break;