Skip to contentSkip to conversation

”Containers” test was "TFAIL" but "PASS" is in log results

LTP Mitani 2 participants 5 messages Jul 16, 2010 – Aug 2, 2010

lore
Share & tools
lore

Mitani

author
#0 lore raw

Hi,

With RHEL5.4/5.5 systems, I noticed that "Containers" test failed but "Containers" is PASS in log results:

---<log results file>-------------
...

hangup01                       PASS       0    
Containers                     PASS       0    
BindMounts                     PASS       0    

...
----------------

---<detail in redirected file>-------------
...
check_netns_enabled 1 TFAIL : unshare syscall smoke test failed:
errno=EINVAL(22): Invalid argument
Network namespaces not enabled in kernel. Not running netns tests.
...
----------------

The source which returned with "Invalid argument" is "check_netns_enabled.c":

---<check_netns_enabled.c>-------------
main()

{
        /* Checking if the kernel supports unshare with netns capabilities.
*/
        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
                tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
failed");
        }
        tst_exit();
}

----------------

In RHEL5.4/5.5 systems, unshare() does not support the argument "CLONE_NEWNET".
But I feel strange that log results is "PASS" in spite of "TFAIL" exit.

"container_test.sh" which calls "check_netns_enabled.c" is as follows:
---<container_test.sh>-------------
...
check_netns_enabled
if [ $? -eq 0 ]; then
echo "Running netns tests."
runnetnstest.sh
else
echo "Network namespaces not enabled in kernel. Not running netns
tests."
fi
...
----------------

According to above source, "check_netns_enabled.c" is only the judgement whether "runnetnstest.sh" test can be called or not.
So, I think that "TFAIL" is not suitable for the test impossibility message.
"TCONF" is more suitable for the message than "TFAIL", I think. But, if "TCONF" is used instead of "TFAIL", "tst_exit" returns with 0. And the test shell "runnetnstest.sh" is called against intention.

I thought up two ways of solutions.
(1) Insert "exit(1)" just after "tst_resm()" of "check_netns_enabled.c"
(2) Replace "TFAIL" with "TWARN", instead of "TCONF".

But above solutions are both irregular measures, I think.

If there are other good measures, please give me advice.

In the following, I nominate a temporary patch for an example:

===(1)=========
--- a/testcases/kernel/containers/netns/check_netns_enabled.c 2010-07-12
02:01:45.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c 2010-07-16
11:58:14.000000000 +0900
@@ -43,7 +43,8 @@
{
/* Checking if the kernel supports unshare with netns capabilities.
*/

         if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {

- tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
failed");
+ tst_resm (TCONF | TERRNO, "unshare syscall smoke test
failed");
+ exit (1);
}
tst_exit();
}
============

===(2)=========
--- a/testcases/kernel/containers/netns/check_netns_enabled.c 2010-07-12
02:01:45.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c 2010-07-16
11:56:47.000000000 +0900
@@ -43,7 +43,7 @@
{
/* Checking if the kernel supports unshare with netns capabilities.
*/

         if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {

- tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
failed");
+ tst_resm (TWARN | TERRNO, "unshare syscall smoke test
failed");
}
tst_exit();
}
============

Regards--

-Tomonori Mitani

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 111 lines · Mitani

Hi,

With RHEL5.4/5.5 systems, I noticed that "Containers" test failed but "Containers" is PASS in log results:

---<log results file>-------------
...
hangup01                       PASS       0
Containers                     PASS       0
BindMounts                     PASS       0
...
----------------

---<detail in redirected file>-------------
...
check_netns_enabled    1  TFAIL  :  unshare syscall smoke test failed:
errno=EINVAL(22): Invalid argument
Network namespaces not enabled in kernel.  Not running netns tests.
...
----------------

The source which returned with "Invalid argument" is "check_netns_enabled.c":

---<check_netns_enabled.c>-------------
main()
{
       /* Checking if the kernel supports unshare with netns capabilities. */
       if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) { tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
       }
       tst_exit();
}
----------------

In RHEL5.4/5.5 systems, unshare() does not support the argument "CLONE_NEWNET".
But I feel strange that log results is "PASS" in spite of "TFAIL" exit.

"container_test.sh" which calls "check_netns_enabled.c" is as follows:
---<container_test.sh>-------------
...
check_netns_enabled
if [ $? -eq 0 ]; then
       echo "Running netns tests."
       runnetnstest.sh
else
       echo "Network namespaces not enabled in kernel.  Not running netns tests."
fi
...
----------------

According to above source, "check_netns_enabled.c" is only the judgement whether "runnetnstest.sh" test can be called or not.
So, I think that "TFAIL" is not suitable for the test impossibility message.
"TCONF" is more suitable for the message than "TFAIL", I think. But, if "TCONF" is used instead of "TFAIL", "tst_exit" returns with 0. And the test shell "runnetnstest.sh" is called against intention.

I thought up two ways of solutions.
(1) Insert "exit(1)" just after "tst_resm()" of "check_netns_enabled.c"
(2) Replace "TFAIL" with "TWARN", instead of "TCONF".

But above solutions are both irregular measures, I think.

If there are other good measures, please give me advice.

In the following, I nominate a temporary patch for an example:

===(1)=========
--- a/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-12 02:01:45.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-16 11:58:14.000000000 +0900

(quoted diff) +2 -1
@@ -43,7 +43,8 @@
  {
        /* Checking if the kernel supports unshare with netns capabilities.
 */
         if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
 failed");
+               tst_resm (TCONF | TERRNO, "unshare syscall smoke test
 failed");
+               exit (1);

       }
       tst_exit();
 }
============

===(2)=========
--- a/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-12 02:01:45.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-16 11:56:47.000000000 +0900

(quoted diff) +1 -1
@@ -43,7 +43,7 @@
  {
        /* Checking if the kernel supports unshare with netns capabilities.
 */
         if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
 failed");
+               tst_resm (TWARN | TERRNO, "unshare syscall smoke test
 failed");
Quoted 4 lines

       }
       tst_exit();
 }
============

Uh, that would introduce a more serious problem because the netns tests are keyed on whether or not that script passes or fails.

If you can provide a more stable means of detecting whether or not CLONE_* is available with netns, and integrate that into the tests, that would be a better idea.

Thanks,
-Garrett

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 111 lines · Garrett Cooper
Quoted 110 lines · Mitani

Hi,

With RHEL5.4/5.5 systems, I noticed that "Containers" test failed but "Containers" is PASS in log results:

---<log results file>-------------
...
hangup01                       PASS       0
Containers                     PASS       0
BindMounts                     PASS       0
...
----------------

---<detail in redirected file>-------------
...
check_netns_enabled    1  TFAIL  :  unshare syscall smoke test failed:
errno=EINVAL(22): Invalid argument
Network namespaces not enabled in kernel.  Not running netns tests.
...
----------------

The source which returned with "Invalid argument" is "check_netns_enabled.c":

---<check_netns_enabled.c>-------------
main()
{
       /* Checking if the kernel supports unshare with netns capabilities. */
       if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) { tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
       }
       tst_exit();
}
----------------

In RHEL5.4/5.5 systems, unshare() does not support the argument "CLONE_NEWNET".
But I feel strange that log results is "PASS" in spite of "TFAIL" exit.

"container_test.sh" which calls "check_netns_enabled.c" is as follows:
---<container_test.sh>-------------
...
check_netns_enabled
if [ $? -eq 0 ]; then
       echo "Running netns tests."
       runnetnstest.sh
else
       echo "Network namespaces not enabled in kernel.  Not running netns tests."
fi
...
----------------

According to above source, "check_netns_enabled.c" is only the judgement whether "runnetnstest.sh" test can be called or not.
So, I think that "TFAIL" is not suitable for the test impossibility message.
"TCONF" is more suitable for the message than "TFAIL", I think. But, if "TCONF" is used instead of "TFAIL", "tst_exit" returns with 0. And the test shell "runnetnstest.sh" is called against intention.

I thought up two ways of solutions.
(1) Insert "exit(1)" just after "tst_resm()" of "check_netns_enabled.c"
(2) Replace "TFAIL" with "TWARN", instead of "TCONF".

But above solutions are both irregular measures, I think.

If there are other good measures, please give me advice.

In the following, I nominate a temporary patch for an example:

===(1)=========
--- a/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-12 02:01:45.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-16 11:58:14.000000000 +0900

(quoted diff) +2 -1
@@ -43,7 +43,8 @@
  {
        /* Checking if the kernel supports unshare with netns capabilities.
 */
         if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
 failed");
+               tst_resm (TCONF | TERRNO, "unshare syscall smoke test
 failed");
+               exit (1);

       }
       tst_exit();
 }
============

===(2)=========
--- a/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-12 02:01:45.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-16 11:56:47.000000000 +0900

(quoted diff) +1 -1
@@ -43,7 +43,7 @@
  {
        /* Checking if the kernel supports unshare with netns capabilities.
 */
         if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke test
 failed");
+               tst_resm (TWARN | TERRNO, "unshare syscall smoke test
Quoted 8 lines
Quoted 5 lines
(quoted diff) +0 -0
 failed");

       }
       tst_exit();
 }
============

Uh, that would introduce a more serious problem because the netns tests are keyed on whether or not that script passes or fails.

s/script/app/

Quoted 3 lines

If you can provide a more stable means of detecting whether or not CLONE_* is available with netns, and integrate that into the tests, that would be a better idea.

Thanks,
-Garrett

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#3 lore raw
Quoted 157 lines

-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Saturday, July 17, 2010 7:51 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] ”Containers” test was "TFAIL" but "PASS" is in log results

Quoted 4 lines · Garrett Cooper
Quoted 3 lines · Mitani

Hi,

With RHEL5.4/5.5 systems, I noticed that "Containers" test failed

but

Quoted 10 lines
Quoted 10 lines

"Containers" is PASS in log results:

---<log results file>-------------
...

hangup01                       PASS       0
Containers                     PASS       0
BindMounts                     PASS       0

...
----------------

Quoted 3 lines
Quoted 3 lines

---<detail in redirected file>-------------
...
check_netns_enabled 1 TFAIL : unshare syscall smoke test

failed:

Quoted 5 lines
Quoted 5 lines

errno=EINVAL(22): Invalid argument
Network namespaces not enabled in kernel. Not running netns tests.
...
----------------

Quoted 7 lines
Quoted 7 lines

The source which returned with "Invalid argument" is "check_netns_enabled.c":

---<check_netns_enabled.c>-------------
main()

{
       /* Checking if the kernel supports unshare with netns

capabilities.

Quoted 2 lines
Quoted 2 lines

*/
if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0)

{

Quoted 1 line
Quoted 1 line

tst_resm (TFAIL | TERRNO, "unshare syscall smoke

test

Quoted 9 lines
Quoted 9 lines
failed");
       }
       tst_exit();
}

----------------

In RHEL5.4/5.5 systems, unshare() does not support the argument "CLONE_NEWNET".
But I feel strange that log results is "PASS" in spite of "TFAIL"

exit.

Quoted 2 lines
Quoted 2 lines

"container_test.sh" which calls "check_netns_enabled.c" is as

follows:

Quoted 8 lines
Quoted 8 lines

---<container_test.sh>-------------
...
check_netns_enabled
if [ $? -eq 0 ]; then
echo "Running netns tests."
runnetnstest.sh
else
echo "Network namespaces not enabled in kernel. Not

running netns

Quoted 6 lines
Quoted 6 lines

tests."
fi
...
----------------

According to above source, "check_netns_enabled.c" is only the

judgement

Quoted 5 lines
Quoted 5 lines

whether "runnetnstest.sh" test can be called or not.
So, I think that "TFAIL" is not suitable for the test impossibility message.
"TCONF" is more suitable for the message than "TFAIL", I think. But, if "TCONF" is used instead of "TFAIL", "tst_exit" returns with

0.

Quoted 5 lines
Quoted 5 lines

And the test shell "runnetnstest.sh" is called against intention.

I thought up two ways of solutions.
(1) Insert "exit(1)" just after "tst_resm()" of

"check_netns_enabled.c"

Quoted 7 lines
Quoted 7 lines

(2) Replace "TFAIL" with "TWARN", instead of "TCONF".

But above solutions are both irregular measures, I think.

If there are other good measures, please give me advice.

Quoted 6 lines
Quoted 6 lines

In the following, I nominate a temporary patch for an example:

===(1)=========
---

a/testcases/kernel/containers/netns/check_netns_enabled.c 2010-
07-12

Quoted 2 lines
Quoted 2 lines

02:01:45.000000000 +0900
+++

b/testcases/kernel/containers/netns/check_netns_enabled.c 2010-
07-16

Quoted 4 lines

Review line 44

Quoted 4 lines

11:58:14.000000000 +0900

(quoted diff) +0 -0
@@ -43,7 +43,8 @@
 {
       /* Checking if the kernel supports unshare with netns

capabilities.

Quoted 2 lines

Review line 46

Quoted 2 lines
(quoted diff) +0 -0
 */
        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) <

0) {

Quoted 1 line

Review line 47

Quoted 1 line
(quoted diff) +0 -1
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke

test

Quoted 2 lines

Review line 48

Quoted 2 lines
(quoted diff) +1 -0
 failed");
+               tst_resm (TCONF | TERRNO, "unshare syscall smoke

test

Quoted 9 lines
Quoted 9 lines
(quoted diff) +1 -0
 failed");
+               exit (1);
       }
       tst_exit();

}
============

===(2)=========
---

a/testcases/kernel/containers/netns/check_netns_enabled.c 2010-
07-12

Quoted 2 lines
Quoted 2 lines

02:01:45.000000000 +0900
+++

b/testcases/kernel/containers/netns/check_netns_enabled.c 2010-
07-16

Quoted 4 lines

Review line 44

Quoted 4 lines

11:56:47.000000000 +0900

(quoted diff) +0 -0
@@ -43,7 +43,7 @@
 {
       /* Checking if the kernel supports unshare with netns

capabilities.

Quoted 2 lines

Review line 46

Quoted 2 lines
(quoted diff) +0 -0
 */
        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) <

0) {

Quoted 1 line

Review line 47

Quoted 1 line
(quoted diff) +0 -1
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke

test

Quoted 2 lines

Review line 48

Quoted 2 lines
(quoted diff) +1 -0
 failed");
+               tst_resm (TWARN | TERRNO, "unshare syscall smoke

test

Quoted 8 lines
Quoted 5 lines
(quoted diff) +0 -0
 failed");
       }
       tst_exit();

}
============

Uh, that would introduce a more serious problem because the netns tests are keyed on whether or not that script passes or fails.

Quoted 8 lines

s/script/app/

Quoted 3 lines

If you can provide a more stable means of detecting whether or not CLONE_* is available with netns, and integrate that into the tests, that would be a better idea.

Thanks,
-Garrett

Sorry for my late answer.

I considered how to judge detecting whether or not CLONE_* is available. However, I hit only about errno judgment.

============

testcases/kernel/containers/netns/check_netns_enabled.c +6 -2
@@ -42,8 +42,12 @@
 main()
 {
 	/* Checking if the kernel supports unshare with netns capabilities. */
-        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
-		tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
+	if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
+		if (errno == EINVAL) {
+			tst_resm (TWARN | TERRNO, "unshare syscall not support CLONE_NEWNET or CLONE_NEWNS");
+		} else {
+			tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
+		}
 	}
 	tst_exit();
 }

============

Thanks--

-Tomonori Mitani

testcases/kernel/containers/netns/check_netns_enabled.c +6 -2
@@ -42,8 +42,12 @@
 main()
 {
 	/* Checking if the kernel supports unshare with netns capabilities. */
-        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
-		tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
+	if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
+		if (errno == EINVAL) {
+			tst_resm (TWARN | TERRNO, "unshare syscall not support CLONE_NEWNET or CLONE_NEWNS");
+		} else {
+			tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
+		}
 	}
 	tst_exit();
 }

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw
Quoted 182 lines · Mitani
Quoted 157 lines

-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Saturday, July 17, 2010 7:51 AM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] ”Containers” test was "TFAIL" but "PASS" is in log results

Quoted 4 lines · Garrett Cooper
Quoted 3 lines · Mitani

Hi,

With RHEL5.4/5.5 systems, I noticed that "Containers" test failed

but

Quoted 10 lines
Quoted 10 lines

"Containers" is PASS in log results:

---<log results file>-------------
...
hangup01                       PASS       0
Containers                     PASS       0
BindMounts                     PASS       0
...
----------------

Quoted 3 lines
Quoted 3 lines

---<detail in redirected file>-------------
...
check_netns_enabled    1  TFAIL  :  unshare syscall smoke test

failed:

Quoted 5 lines
Quoted 5 lines

errno=EINVAL(22): Invalid argument
Network namespaces not enabled in kernel.  Not running netns tests.
...
----------------

Quoted 7 lines
Quoted 7 lines

The source which returned with "Invalid argument" is "check_netns_enabled.c":

---<check_netns_enabled.c>-------------
main()
{
       /* Checking if the kernel supports unshare with netns

capabilities.

Quoted 2 lines
Quoted 2 lines

*/
       if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0)

{

Quoted 1 line
Quoted 1 line

               tst_resm (TFAIL | TERRNO, "unshare syscall smoke

test

Quoted 9 lines
Quoted 9 lines

failed");
       }
       tst_exit();
}
----------------

In RHEL5.4/5.5 systems, unshare() does not support the argument "CLONE_NEWNET".
But I feel strange that log results is "PASS" in spite of "TFAIL"

exit.

Quoted 2 lines
Quoted 2 lines

"container_test.sh" which calls "check_netns_enabled.c" is as

follows:

Quoted 8 lines
Quoted 8 lines

---<container_test.sh>-------------
...
check_netns_enabled
if [ $? -eq 0 ]; then
       echo "Running netns tests."
       runnetnstest.sh
else
       echo "Network namespaces not enabled in kernel.  Not

running netns

Quoted 6 lines
Quoted 6 lines

tests."
fi
...
----------------

According to above source, "check_netns_enabled.c" is only the

judgement

Quoted 5 lines
Quoted 5 lines

whether "runnetnstest.sh" test can be called or not.
So, I think that "TFAIL" is not suitable for the test impossibility message.
"TCONF" is more suitable for the message than "TFAIL", I think. But, if "TCONF" is used instead of "TFAIL", "tst_exit" returns with

0.

Quoted 5 lines
Quoted 5 lines

And the test shell "runnetnstest.sh" is called against intention.

I thought up two ways of solutions.
(1) Insert "exit(1)" just after "tst_resm()" of

"check_netns_enabled.c"

Quoted 7 lines
Quoted 7 lines

(2) Replace "TFAIL" with "TWARN", instead of "TCONF".

But above solutions are both irregular measures, I think.

If there are other good measures, please give me advice.

Quoted 6 lines
Quoted 6 lines

In the following, I nominate a temporary patch for an example:

===(1)=========
---

a/testcases/kernel/containers/netns/check_netns_enabled.c   2010- 07-12

Quoted 2 lines
Quoted 2 lines

02:01:45.000000000 +0900
+++

b/testcases/kernel/containers/netns/check_netns_enabled.c   2010- 07-16

Quoted 4 lines

Review line 44

Quoted 4 lines

11:58:14.000000000 +0900

(quoted diff) +0 -0
@@ -43,7 +43,8 @@
  {
        /* Checking if the kernel supports unshare with netns

capabilities.

Quoted 2 lines
Quoted 2 lines
(quoted diff) +0 -0
 */

        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) <

0) {

Quoted 1 line
Quoted 1 line

-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke

test

Quoted 2 lines
Quoted 2 lines

failed");
+               tst_resm (TCONF | TERRNO, "unshare syscall smoke

test

Quoted 9 lines
Quoted 9 lines

failed");
+               exit (1);
       }
       tst_exit();
 }
============

===(2)=========
---

a/testcases/kernel/containers/netns/check_netns_enabled.c   2010- 07-12

Quoted 2 lines
Quoted 2 lines

02:01:45.000000000 +0900
+++

b/testcases/kernel/containers/netns/check_netns_enabled.c   2010- 07-16

Quoted 4 lines

Review line 44

Quoted 4 lines

11:56:47.000000000 +0900

(quoted diff) +0 -0
@@ -43,7 +43,7 @@
  {
        /* Checking if the kernel supports unshare with netns

capabilities.

Quoted 2 lines
Quoted 2 lines
(quoted diff) +0 -0
 */

        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) <

0) {

Quoted 1 line
Quoted 1 line

-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke

test

Quoted 2 lines
Quoted 2 lines

failed");
+               tst_resm (TWARN | TERRNO, "unshare syscall smoke

test

Quoted 8 lines
Quoted 5 lines

failed");
       }
       tst_exit();
 }
============

Uh, that would introduce a more serious problem because the netns tests are keyed on whether or not that script passes or fails.

Quoted 8 lines

s/script/app/

Quoted 3 lines

If you can provide a more stable means of detecting whether or not CLONE_* is available with netns, and integrate that into the tests, that would be a better idea.

Thanks,
-Garrett

Sorry for my late answer.

I considered how to judge detecting whether or not CLONE_* is available. However, I hit only about errno judgment.

============

testcases/kernel/containers/netns/check_netns_enabled.c   2010-08-02 10:38:31.000000000 +0900 renamed from testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-30 02:23:32.000000000 +0900 +0 -1
@@ -42,8 +42,12 @@
  main()
  {
        /* Checking if the kernel supports unshare with netns capabilities. */
-        if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {

testcases/kernel/containers/netns/check_netns_enabled.c   2010-08-02 10:38:31.000000000 +0900 line 53

Quoted 10 lines
testcases/kernel/containers/netns/check_netns_enabled.c   2010-08-02 10:38:31.000000000 +0900 renamed from testcases/kernel/containers/netns/check_netns_enabled.c   2010-07-30 02:23:32.000000000 +0900 +6 -1
-               tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
+       if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) < 0) {
+               if (errno == EINVAL) {
+                       tst_resm (TWARN | TERRNO, "unshare syscall not support CLONE_NEWNET or CLONE_NEWNS");
+               } else {
+                       tst_resm (TFAIL | TERRNO, "unshare syscall smoke test failed");
+               }
        }
        tst_exit();
  }

There are only 3 errors allowed for unshare(2), according to the manpage:

EPERM

flags specified CLONE_NEWNS but the calling process was not privileged (did not have the CAP_SYS_ADMIN capability).

ENOMEM

Cannot allocate sufficient memory to copy parts of caller's context that need to be unshared.

EINVAL

An invalid bit was specified in flags.

Given that TWARN will show up as an error, I suppose this is ok.. but it seems silly to single out only that case.

Committed anyhow :P.
-Garrett

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list