File tree Expand file tree Collapse file tree 6 files changed +36
-2
lines changed
testcases/kernel/syscalls/ioctl Expand file tree Collapse file tree 6 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ static void test_ns_get_parent(void)
40
40
fd = SAFE_OPEN ("/proc/self/ns/pid" , O_RDONLY );
41
41
parent_fd = ioctl (fd , NS_GET_PARENT );
42
42
if (parent_fd == -1 ) {
43
+ if (errno == ENOTTY )
44
+ tst_brk (TCONF , "ioctl(NS_GET_PARENT) not implemented" );
45
+
43
46
if (errno == EPERM )
44
47
tst_res (TPASS , "NS_GET_PARENT fails with EPERM" );
45
48
else
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ static void run(void)
32
32
fd = SAFE_OPEN ("/proc/self/ns/uts" , O_RDONLY );
33
33
parent_fd = ioctl (fd , NS_GET_PARENT );
34
34
if (parent_fd == -1 ) {
35
+ if (errno == ENOTTY )
36
+ tst_brk (TCONF , "ioctl(NS_GET_PARENT) not implemented" );
37
+
35
38
if (errno == EINVAL )
36
39
tst_res (TPASS , "NS_GET_PARENT fails with EINVAL" );
37
40
else
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ static void run(void)
33
33
34
34
owner_fd = ioctl (fd , NS_GET_OWNER_UID , & uid );
35
35
if (owner_fd == -1 ) {
36
+ if (errno == ENOTTY ) {
37
+ tst_brk (TCONF ,
38
+ "ioctl(NS_GET_OWNER_UID) not implemented" );
39
+ }
40
+
36
41
if (errno == EINVAL )
37
42
tst_res (TPASS , "NS_GET_OWNER_UID fails, UTS namespace" );
38
43
else
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ static void run(void)
31
31
fd = SAFE_OPEN ("/proc/self/ns/user" , O_RDONLY );
32
32
parent_fd = ioctl (fd , NS_GET_USERNS );
33
33
if (parent_fd == -1 ) {
34
+ if (errno == ENOTTY )
35
+ tst_brk (TCONF , "ioctl(NS_GET_USERNS) not implemented" );
36
+
34
37
if (errno == EPERM )
35
38
tst_res (TPASS , "NS_GET_USERNS fails with EPERM" );
36
39
else
Original file line number Diff line number Diff line change @@ -53,7 +53,18 @@ static void run(void)
53
53
sprintf (child_namespace , "/proc/%i/ns/pid" , pid );
54
54
my_fd = SAFE_OPEN ("/proc/self/ns/pid" , O_RDONLY );
55
55
child_fd = SAFE_OPEN (child_namespace , O_RDONLY );
56
- parent_fd = SAFE_IOCTL (child_fd , NS_GET_PARENT );
56
+ parent_fd = ioctl (child_fd , NS_GET_PARENT );
57
+
58
+ if (parent_fd == -1 ) {
59
+ TST_CHECKPOINT_WAKE (0 );
60
+
61
+ if (errno == ENOTTY ) {
62
+ tst_res (TCONF , "ioctl(NS_GET_PARENT) not implemented" );
63
+ return ;
64
+ }
65
+
66
+ tst_brk (TBROK | TERRNO , "ioctl(NS_GET_PARENT) failed" );
67
+ }
57
68
58
69
struct stat my_stat , child_stat , parent_stat ;
59
70
Original file line number Diff line number Diff line change @@ -50,7 +50,16 @@ static void run(void)
50
50
51
51
my_fd = SAFE_OPEN ("/proc/self/ns/user" , O_RDONLY );
52
52
child_fd = SAFE_OPEN (child_namespace , O_RDONLY );
53
- parent_fd = SAFE_IOCTL (child_fd , NS_GET_USERNS );
53
+ parent_fd = ioctl (child_fd , NS_GET_USERNS );
54
+
55
+ if (parent_fd == -1 ) {
56
+ TST_CHECKPOINT_WAKE (0 );
57
+
58
+ if (errno == ENOTTY )
59
+ tst_brk (TCONF , "ioctl(NS_GET_USERNS) not implemented" );
60
+
61
+ tst_brk (TBROK | TERRNO , "ioctl(NS_GET_USERNS) failed" );
62
+ }
54
63
55
64
struct stat my_stat , child_stat , parent_stat ;
56
65
You can’t perform that action at this time.
0 commit comments