public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] containers: fix exit status in netns_netlink.c
@ 2014-11-06  7:24 Xing Gu
  2014-11-06  8:24 ` Cyril Hrubis
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Xing Gu @ 2014-11-06  7:24 UTC (permalink / raw)
  To: ltp-list

In iproute2 whose version is earlier than v2.6.29-1,
ip command doesn't support tuntap object. This leads
to the case (netns_netlink.c) failure with TFAIL status.
It is not suitable, so fix this case' exit status with
TCONF in the above condition.

Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
---
 testcases/kernel/containers/netns/netns_netlink.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/testcases/kernel/containers/netns/netns_netlink.c b/testcases/kernel/containers/netns/netns_netlink.c
index 08caa98..ae57ecd 100644
--- a/testcases/kernel/containers/netns/netns_netlink.c
+++ b/testcases/kernel/containers/netns/netns_netlink.c
@@ -126,6 +126,16 @@ static void test(void)
 {
 	pid_t pid;
 	int status;
+	int ret;
+
+	/* check if ip command supports tuntap object */
+	ret = WEXITSTATUS(system("ip help 2>&1 | grep -w tuntap &>/dev/null"));
+	if (ret == -1)
+		tst_brkm(TBROK | TERRNO, cleanup, "system failed");
+	if (ret == 1) {
+		tst_resm(TCONF, "ip command doesn't support tuntap object");
+		return;
+	}
 
 	/* unshares the network namespace */
 	if (unshare(CLONE_NEWNET) == -1)
-- 
1.9.3


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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-17 14:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06  7:24 [LTP] [PATCH] containers: fix exit status in netns_netlink.c Xing Gu
2014-11-06  8:24 ` Cyril Hrubis
2014-11-10  8:46 ` [LTP] [PATCH v2 1/2] containers: change check_iproute() behavior in netns/netns_helper.h Xing Gu
2014-11-10  8:46   ` [LTP] [PATCH v2 2/2] containers: fix exit status in netns/netns_netlink.c Xing Gu
2014-11-11 13:16   ` [LTP] [PATCH v2 1/2] containers: change check_iproute() behavior in netns/netns_helper.h Cyril Hrubis
     [not found]     ` <5462BC16.7090709@cn.fujitsu.com>
2014-12-02 14:12       ` Cyril Hrubis
2014-12-05  7:00 ` [LTP] [PATCH v3 " Xing Gu
2014-12-05  7:00   ` [LTP] [PATCH v3 2/2] containers: fix exit status in netns/netns_netlink.c Xing Gu
2014-12-17 14:36   ` [LTP] [PATCH v3 1/2] containers: change check_iproute() behavior in netns/netns_helper.h Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox