* [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
* Re: [LTP] [PATCH] containers: fix exit status in netns_netlink.c
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-12-05 7:00 ` [LTP] [PATCH v3 " Xing Gu
2 siblings, 0 replies; 9+ messages in thread
From: Cyril Hrubis @ 2014-11-06 8:24 UTC (permalink / raw)
To: Xing Gu; +Cc: ltp-list
Hi!
> 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.
It would be better to compare the iproute version instead of relying on
the output that may change in the future. Have a look at the
netns_helper.h at testcases/kernel/containers/netns/netns_helper.h
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 9+ messages in thread
* [LTP] [PATCH v2 1/2] containers: change check_iproute() behavior in netns/netns_helper.h
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 ` 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
2014-12-05 7:00 ` [LTP] [PATCH v3 " Xing Gu
2 siblings, 2 replies; 9+ messages in thread
From: Xing Gu @ 2014-11-10 8:46 UTC (permalink / raw)
To: ltp-list
Change check_iproute() behavior in order to improve
its expansibility.
Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
---
testcases/kernel/containers/netns/netns_crtchild.c | 7 ++++-
.../containers/netns/netns_crtchild_delchild.c | 7 ++++-
testcases/kernel/containers/netns/netns_helper.h | 31 +++++++++++++++++-----
.../kernel/containers/netns/netns_par_chld_ftp.c | 7 ++++-
.../kernel/containers/netns/netns_par_chld_ipv6.c | 7 ++++-
.../containers/netns/netns_two_children_ns.c | 7 ++++-
6 files changed, 54 insertions(+), 12 deletions(-)
diff --git a/testcases/kernel/containers/netns/netns_crtchild.c b/testcases/kernel/containers/netns/netns_crtchild.c
index 3b5a696..a6da669 100644
--- a/testcases/kernel/containers/netns/netns_crtchild.c
+++ b/testcases/kernel/containers/netns/netns_crtchild.c
@@ -29,12 +29,17 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
const char *TCID = "netns_crtchild";
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ if (check_iproute(IPROUTE_MIN_VER) == -1) {
+ tst_brkm(TCONF, NULL,
+ "iproute tools do not support setting network namespaces");
+ }
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_crtchild_delchild.c b/testcases/kernel/containers/netns/netns_crtchild_delchild.c
index 3235990..b2aa7cc 100644
--- a/testcases/kernel/containers/netns/netns_crtchild_delchild.c
+++ b/testcases/kernel/containers/netns/netns_crtchild_delchild.c
@@ -33,12 +33,17 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
const char *TCID = "netns_crtchild_delchild";
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ if (check_iproute(IPROUTE_MIN_VER) == -1) {
+ tst_brkm(TCONF, NULL,
+ "iproute tools do not support setting network namespaces");
+ }
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_helper.h b/testcases/kernel/containers/netns/netns_helper.h
index 7f301ce..bd0a88d 100644
--- a/testcases/kernel/containers/netns/netns_helper.h
+++ b/testcases/kernel/containers/netns/netns_helper.h
@@ -33,25 +33,42 @@
#define CLONE_NEWNS -1
#endif
-#define IPROUTE_MIN_VER 80725
-
-static void check_iproute(void)
+/*
+ * Check whether the current iproute version matches specified iproute.
+ *
+ * Returns:
+ * -1 - cur_ipver is less than spe_ipver
+ * 0 - cur_ipver is equal to spe_ipver
+ * 1 - cur_ipver is greater than spe_ipver
+ */
+static int check_iproute(int spe_ipver)
{
FILE *ipf;
int n;
- unsigned int ipver = 0;
+ unsigned int cur_ipver = 0;
+ int ret;
ipf = popen("ip -V", "r");
if (ipf == NULL)
tst_brkm(TCONF, NULL,
"Failed while opening pipe for iproute check");
- n = fscanf(ipf, "ip utility, iproute2-ss%u", &ipver);
- if (n < 1 || ipver < IPROUTE_MIN_VER)
+ n = fscanf(ipf, "ip utility, iproute2-ss%u", &cur_ipver);
+ if (n < 1) {
+ pclose(ipf);
tst_brkm(TCONF, NULL,
- "iproute tools do not support setting network namespaces");
+ "Failed while obtaining version for iproute check");
+ } else {
+ if (cur_ipver < spe_ipver)
+ ret = -1;
+ else if (cur_ipver == spe_ipver)
+ ret = 0;
+ else
+ ret = 1;
+ }
pclose(ipf);
+ return ret;
}
static void check_netns(void)
diff --git a/testcases/kernel/containers/netns/netns_par_chld_ftp.c b/testcases/kernel/containers/netns/netns_par_chld_ftp.c
index 97411f7..20ab179 100644
--- a/testcases/kernel/containers/netns/netns_par_chld_ftp.c
+++ b/testcases/kernel/containers/netns/netns_par_chld_ftp.c
@@ -30,12 +30,17 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
const char *TCID = "netns_par_chld_ftp";
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ if (check_iproute(IPROUTE_MIN_VER) == -1) {
+ tst_brkm(TCONF, NULL,
+ "iproute tools do not support setting network namespaces");
+ }
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_par_chld_ipv6.c b/testcases/kernel/containers/netns/netns_par_chld_ipv6.c
index 1e50f24..c68e7ab 100644
--- a/testcases/kernel/containers/netns/netns_par_chld_ipv6.c
+++ b/testcases/kernel/containers/netns/netns_par_chld_ipv6.c
@@ -47,6 +47,8 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
char *TCID = "netns_ipv6";
int TST_TOTAL = 1;
@@ -56,7 +58,10 @@ int TST_TOTAL = 1;
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ if (check_iproute(IPROUTE_MIN_VER) == -1) {
+ tst_brkm(TCONF, NULL,
+ "iproute tools do not support setting network namespaces");
+ }
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_two_children_ns.c b/testcases/kernel/containers/netns/netns_two_children_ns.c
index 0a032d0..2446200 100644
--- a/testcases/kernel/containers/netns/netns_two_children_ns.c
+++ b/testcases/kernel/containers/netns/netns_two_children_ns.c
@@ -49,13 +49,18 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
char *TCID = "netns_2children";
int TST_TOTAL = 1;
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ if (check_iproute(IPROUTE_MIN_VER) == -1) {
+ tst_brkm(TCONF, NULL,
+ "iproute tools do not support setting network namespaces");
+ }
check_netns();
}
--
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
* [LTP] [PATCH v2 2/2] containers: fix exit status in netns/netns_netlink.c
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 ` Xing Gu
2014-11-11 13:16 ` [LTP] [PATCH v2 1/2] containers: change check_iproute() behavior in netns/netns_helper.h Cyril Hrubis
1 sibling, 0 replies; 9+ messages in thread
From: Xing Gu @ 2014-11-10 8:46 UTC (permalink / raw)
To: ltp-list
In iproute2 whose version is earlier than v2.6.34,
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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/testcases/kernel/containers/netns/netns_netlink.c b/testcases/kernel/containers/netns/netns_netlink.c
index 08caa98..d271124 100644
--- a/testcases/kernel/containers/netns/netns_netlink.c
+++ b/testcases/kernel/containers/netns/netns_netlink.c
@@ -47,6 +47,8 @@
#define MAX_TRIES 1000
+#define IP_TUNTAP_MIN_VER 100519
+
char *TCID = "netns_netlink";
int TST_TOTAL = 1;
struct tst_checkpoint checkpoint;
@@ -60,6 +62,10 @@ static void cleanup(void)
static void setup(void)
{
tst_require_root(NULL);
+ if (check_iproute(IP_TUNTAP_MIN_VER) == -1) {
+ tst_brkm(TCONF, NULL,
+ "ip command in iproute tools do not support tuntap object");
+ }
check_netns();
tst_tmpdir();
TST_CHECKPOINT_CREATE(&checkpoint);
--
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
* Re: [LTP] [PATCH v2 1/2] containers: change check_iproute() behavior in netns/netns_helper.h
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 ` Cyril Hrubis
[not found] ` <5462BC16.7090709@cn.fujitsu.com>
1 sibling, 1 reply; 9+ messages in thread
From: Cyril Hrubis @ 2014-11-11 13:16 UTC (permalink / raw)
To: Xing Gu; +Cc: ltp-list
Hi!
> +static int check_iproute(int spe_ipver)
> {
> FILE *ipf;
> int n;
> - unsigned int ipver = 0;
> + unsigned int cur_ipver = 0;
> + int ret;
>
> ipf = popen("ip -V", "r");
> if (ipf == NULL)
> tst_brkm(TCONF, NULL,
> "Failed while opening pipe for iproute check");
>
> - n = fscanf(ipf, "ip utility, iproute2-ss%u", &ipver);
> - if (n < 1 || ipver < IPROUTE_MIN_VER)
> + n = fscanf(ipf, "ip utility, iproute2-ss%u", &cur_ipver);
> + if (n < 1) {
> + pclose(ipf);
> tst_brkm(TCONF, NULL,
> - "iproute tools do not support setting network namespaces");
> + "Failed while obtaining version for iproute check");
> + } else {
> + if (cur_ipver < spe_ipver)
> + ret = -1;
> + else if (cur_ipver == spe_ipver)
> + ret = 0;
> + else
> + ret = 1;
> + }
Again why bother with return value when all the testcases just needs to
know if ip is newer than some version?
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v2 1/2] containers: change check_iproute() behavior in netns/netns_helper.h
[not found] ` <5462BC16.7090709@cn.fujitsu.com>
@ 2014-12-02 14:12 ` Cyril Hrubis
0 siblings, 0 replies; 9+ messages in thread
From: Cyril Hrubis @ 2014-12-02 14:12 UTC (permalink / raw)
To: gux.fnst; +Cc: ltp-list
Hi!
> >> + } else {
> >> + if (cur_ipver < spe_ipver)
> >> + ret = -1;
> >> + else if (cur_ipver == spe_ipver)
> >> + ret = 0;
> >> + else
> >> + ret = 1;
> >> + }
> >
> > Again why bother with return value when all the testcases just needs to
> > know if ip is newer than some version?
> >
>
> I do this in order to provide more choices for users, like tst_kvercmp.
> Is it necessary? If it is not, I will send a new patch. Thanks!
Sorry, I've forgot to answer this one.
I would stick to the simpler version unless there is a need for the more
complex interface. Generally we should do things as simple as possible.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 9+ messages in thread
* [LTP] [PATCH v3 1/2] containers: change check_iproute() behavior in netns/netns_helper.h
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-12-05 7:00 ` 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
2 siblings, 2 replies; 9+ messages in thread
From: Xing Gu @ 2014-12-05 7:00 UTC (permalink / raw)
To: ltp-list
Change check_iproute() behavior in order to improve
its expansibility.
Signed-off-by: Xing Gu <gux.fnst@cn.fujitsu.com>
---
testcases/kernel/containers/netns/netns_crtchild.c | 4 +++-
testcases/kernel/containers/netns/netns_crtchild_delchild.c | 4 +++-
testcases/kernel/containers/netns/netns_helper.h | 13 ++++++++-----
testcases/kernel/containers/netns/netns_par_chld_ftp.c | 4 +++-
testcases/kernel/containers/netns/netns_par_chld_ipv6.c | 3 ++-
testcases/kernel/containers/netns/netns_two_children_ns.c | 4 +++-
6 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/testcases/kernel/containers/netns/netns_crtchild.c b/testcases/kernel/containers/netns/netns_crtchild.c
index 3b5a696..8d9b68f 100644
--- a/testcases/kernel/containers/netns/netns_crtchild.c
+++ b/testcases/kernel/containers/netns/netns_crtchild.c
@@ -29,12 +29,14 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
const char *TCID = "netns_crtchild";
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ check_iproute(IPROUTE_MIN_VER);
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_crtchild_delchild.c b/testcases/kernel/containers/netns/netns_crtchild_delchild.c
index 3235990..f46f2b3 100644
--- a/testcases/kernel/containers/netns/netns_crtchild_delchild.c
+++ b/testcases/kernel/containers/netns/netns_crtchild_delchild.c
@@ -33,12 +33,14 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
const char *TCID = "netns_crtchild_delchild";
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ check_iproute(IPROUTE_MIN_VER);
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_helper.h b/testcases/kernel/containers/netns/netns_helper.h
index 7f301ce..3399a2f 100644
--- a/testcases/kernel/containers/netns/netns_helper.h
+++ b/testcases/kernel/containers/netns/netns_helper.h
@@ -33,9 +33,7 @@
#define CLONE_NEWNS -1
#endif
-#define IPROUTE_MIN_VER 80725
-
-static void check_iproute(void)
+static void check_iproute(int spe_ipver)
{
FILE *ipf;
int n;
@@ -47,9 +45,14 @@ static void check_iproute(void)
"Failed while opening pipe for iproute check");
n = fscanf(ipf, "ip utility, iproute2-ss%u", &ipver);
- if (n < 1 || ipver < IPROUTE_MIN_VER)
+ if (n < 1) {
tst_brkm(TCONF, NULL,
- "iproute tools do not support setting network namespaces");
+ "Failed while obtaining version for iproute check");
+ }
+ if (ipver < spe_ipver) {
+ tst_brkm(TCONF, NULL, "The commands in iproute tools do "
+ "not support required objects");
+ }
pclose(ipf);
}
diff --git a/testcases/kernel/containers/netns/netns_par_chld_ftp.c b/testcases/kernel/containers/netns/netns_par_chld_ftp.c
index 97411f7..d88780c 100644
--- a/testcases/kernel/containers/netns/netns_par_chld_ftp.c
+++ b/testcases/kernel/containers/netns/netns_par_chld_ftp.c
@@ -30,12 +30,14 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
const char *TCID = "netns_par_chld_ftp";
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ check_iproute(IPROUTE_MIN_VER);
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_par_chld_ipv6.c b/testcases/kernel/containers/netns/netns_par_chld_ipv6.c
index 1e50f24..96d00c5 100644
--- a/testcases/kernel/containers/netns/netns_par_chld_ipv6.c
+++ b/testcases/kernel/containers/netns/netns_par_chld_ipv6.c
@@ -50,13 +50,14 @@
char *TCID = "netns_ipv6";
int TST_TOTAL = 1;
+#define IPROUTE_MIN_VER 80725
#define PARENT_SCRIPT "netns_paripv6.sh"
#define CHILD_SCRIPT "netns_childipv6.sh"
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ check_iproute(IPROUTE_MIN_VER);
check_netns();
}
diff --git a/testcases/kernel/containers/netns/netns_two_children_ns.c b/testcases/kernel/containers/netns/netns_two_children_ns.c
index 0a032d0..a8a36d2 100644
--- a/testcases/kernel/containers/netns/netns_two_children_ns.c
+++ b/testcases/kernel/containers/netns/netns_two_children_ns.c
@@ -49,13 +49,15 @@
#include "common.h"
#include "netns_helper.h"
+#define IPROUTE_MIN_VER 80725
+
char *TCID = "netns_2children";
int TST_TOTAL = 1;
static void setup(void)
{
tst_require_root(NULL);
- check_iproute();
+ check_iproute(IPROUTE_MIN_VER);
check_netns();
}
--
1.9.3
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
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
* [LTP] [PATCH v3 2/2] containers: fix exit status in netns/netns_netlink.c
2014-12-05 7:00 ` [LTP] [PATCH v3 " Xing Gu
@ 2014-12-05 7:00 ` Xing Gu
2014-12-17 14:36 ` [LTP] [PATCH v3 1/2] containers: change check_iproute() behavior in netns/netns_helper.h Cyril Hrubis
1 sibling, 0 replies; 9+ messages in thread
From: Xing Gu @ 2014-12-05 7:00 UTC (permalink / raw)
To: ltp-list
In iproute2 whose version is earlier than v2.6.34,
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 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/testcases/kernel/containers/netns/netns_netlink.c b/testcases/kernel/containers/netns/netns_netlink.c
index 08caa98..29b7488 100644
--- a/testcases/kernel/containers/netns/netns_netlink.c
+++ b/testcases/kernel/containers/netns/netns_netlink.c
@@ -47,6 +47,8 @@
#define MAX_TRIES 1000
+#define IP_TUNTAP_MIN_VER 100519
+
char *TCID = "netns_netlink";
int TST_TOTAL = 1;
struct tst_checkpoint checkpoint;
@@ -60,6 +62,7 @@ static void cleanup(void)
static void setup(void)
{
tst_require_root(NULL);
+ check_iproute(IP_TUNTAP_MIN_VER);
check_netns();
tst_tmpdir();
TST_CHECKPOINT_CREATE(&checkpoint);
--
1.9.3
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
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
* Re: [LTP] [PATCH v3 1/2] containers: change check_iproute() behavior in netns/netns_helper.h
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 ` Cyril Hrubis
1 sibling, 0 replies; 9+ messages in thread
From: Cyril Hrubis @ 2014-12-17 14:36 UTC (permalink / raw)
To: Xing Gu; +Cc: ltp-list
Hi!
> +static void check_iproute(int spe_ipver)
^
Changed this to unsigned in order to fix
signed vs unsigned comparsion warning
And pushed both patches, thanks.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [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