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.f...@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

Reply via email to