This patch consists changes required to address the below files, if
required.
This patch consists of the files
childipv6.sh - Tests the IPv6 connection from child NS to parent NS
par_chld_ipv6.c - Basic program to create the namespaces
paripv6.sh - Tests the IPv6 connection from parent NS to child NS
Signed off by Veerendra C <[EMAIL PROTECTED]>
ACKed by Serge Hallyn <[EMAIL PROTECTED]>
Modified to exit with the proper Status value.
--- containers.old/netns/childipv6.sh 2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/childipv6.sh 2008-09-10 01:06:42.000000000 +0530
@@ -55,4 +55,4 @@ status=0
echo $status > /tmp/FIFO6
debug "INFO: Done with executing child script $0"
cleanup $sshpid $vnet1
-
+ exit $status
Modified to print more clear message on unshare error.
Also now evaluating the status value after waitpid call.
--- containers.old/netns/par_chld_ipv6.c 2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/par_chld_ipv6.c 2008-09-10 21:48:37.000000000 +0530
@@ -42,15 +42,6 @@
#include <sys/wait.h>
#include <test.h>
-#ifdef NO_LTP
-#define TFAIL "FAILURE: "
-#define TPASS "PASS: "
-#define TINFO "INFO: "
-#define TWARN "WARN: "
-#define tst_resm(x, format, arg...) printf("%s:" format, x, ## arg)
-#define tst_exit() exit(1)
-#endif
-
char *TCID = "netns_ipv6";
int TST_TOTAL=1;
@@ -102,6 +93,7 @@ ltproot);
ret = unshare(flags);
if (ret < 0) {
perror("unshare");
+ tst_resm(TFAIL, "Error:Unshare syscall failed for network namespace\n");
return 1;
}
return crtchild(child);
@@ -111,7 +103,7 @@ ltproot);
//parent
ret = system(par);
status = WEXITSTATUS(ret);
- if (status != 0) {
+ if (ret == -1 || status != 0) {
tst_resm(TFAIL, "Error: While running the IPv6 tests between \
parent & child NS\n");
fflush(stdout);
@@ -120,7 +112,8 @@ parent & child NS\n");
fflush(stdout);
ret = waitpid(pid, &status, __WALL);
- if (status != 0 || ret < 0){
+ status = WEXITSTATUS(status);
+ if (status != 0 || ret == -1){
tst_resm(TFAIL, "waitpid() returns %d, errno %d\n", ret, errno);
status = errno;
}
Modified to include the netdevice in place of eth0
--- containers.old/netns/paripv6.sh 2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/paripv6.sh 2008-09-10 01:06:42.000000000 +0530
@@ -22,7 +22,7 @@ status=0
# Sets up the infrastructure for creating network NS
# By defining the veth pair $vnet0 and $vnet1
echo 1 > /proc/sys/net/ipv4/ip_forward
- echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
+ echo 1 > /proc/sys/net/ipv4/conf/$netdev/proxy_arp
create_veth
vnet0=$dev0
vnet1=$dev1
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list