public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: "Mitani" <mitani@ryobi.co.jp>
To: 'Garrett Cooper' <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net, "當座 健市" <toza@ryobi.co.jp>
Subject: Re: [LTP] ”Containers” test was "TFAIL" but "PASS" is in log results
Date: Mon, 2 Aug 2010 13:36:45 +0900	[thread overview]
Message-ID: <000601cb31fc$50629a30$f127ce90$@co.jp> (raw)
In-Reply-To: <AANLkTinaYGjU8MGQZ_ccN1bfuduDzs0KsFPXi638278T@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6214 bytes --]

> -----Original Message-----
> From: Garrett Cooper [mailto:yanegomi@gmail.com]
> Sent: Saturday, July 17, 2010 7:51 AM
> To: Mitani
> Cc: ltp-list@lists.sourceforge.net
> Subject: Re: [LTP] ”Containers” test was "TFAIL" but "PASS"
> is in log results
> 
> On Fri, Jul 16, 2010 at 3:50 PM, Garrett Cooper <yanegomi@gmail.com>
> wrote:
> > On Thu, Jul 15, 2010 at 9:19 PM, Mitani <mitani@ryobi.co.jp> wrote:
> >> 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:
> >>
> >> Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>
> >>
> >> ===(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();
> >>  }
> >> ============
> >
> > 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/
> 
> > 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.

Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>

============
--- a/testcases/kernel/containers/netns/check_netns_enabled.c	2010-07-30 02:23:32.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c	2010-08-02 10:38:31.000000000 +0900
@@ -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

[-- Attachment #2: check_netns_enabled.patch --]
[-- Type: application/octet-stream, Size: 738 bytes --]

--- a/testcases/kernel/containers/netns/check_netns_enabled.c	2010-07-30 02:23:32.000000000 +0900
+++ b/testcases/kernel/containers/netns/check_netns_enabled.c	2010-08-02 10:38:31.000000000 +0900
@@ -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();
 }

[-- Attachment #3: Type: text/plain, Size: 311 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2010-08-02  5:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16  4:19 [LTP] ”Containers” test was "TFAIL" but "PASS" is in log results Mitani
2010-07-16 22:50 ` Garrett Cooper
2010-07-16 22:50   ` Garrett Cooper
2010-08-02  4:36     ` Mitani [this message]
2010-08-02  6:31       ` Garrett Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000601cb31fc$50629a30$f127ce90$@co.jp' \
    --to=mitani@ryobi.co.jp \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=toza@ryobi.co.jp \
    --cc=yanegomi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox