Added files crtchild.c - Program which calls the scripts
parent.sh  - Checks the child NS is pinging from ParentNS
child.sh - Checks the Parent NS is pinging from Child NS parentns.sh - Sets up the infrastruture to create NS
childns.sh - This sets up the infra reqd from the child NS





Signed off by Veerendra C <[EMAIL PROTECTED]>
ACKed by Serge Hallyn <[EMAIL PROTECTED]>

Removed the redundant line for passing the status value .
As the status variable value would be preserved in the scripts.
--- containers.old/netns/child.sh	2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/child.sh	2008-09-10 01:06:42.000000000 +0530
@@ -18,4 +18,3 @@ export TST_TOTAL
         tst_resm TFAIL "FAIL: Unable to ping ParentNS from ChildNS"
         status=1
     fi
-    echo $status > /tmp/FIFO6

Modified to return at the end with the status value
--- containers.old/netns/childns.sh	2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/childns.sh	2008-09-10 01:06:42.000000000 +0530
@@ -3,8 +3,7 @@
 # This test scripts passes the PID of the child NS to the parent NS.
 # Also it assigns the device address and starts the sshd daemon
 # It checks for basic network connection between parent and child.
-# It renames the network device of the child 
-
+#
 # Arguments:    Accepts an argument 'script' and executes on top of this
 ################################################################################
 # set -x
@@ -58,5 +57,6 @@ status=0
     fi
     
     cleanup $sshpid $vnet1
-    debug "INFO: Done with executing child script $0"
+    debug "INFO: Done with executing child script $0, status is $status"
     
+    exit $status 
Included the headerfile for function declaration.
--- containers.old/netns/crtchild.c	2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/crtchild.c	2008-09-10 01:06:42.000000000 +0530
@@ -26,7 +26,7 @@
 *                      31/07/2008
 * =============================================================================*/
 
-extern int create_net_namespace(char *, char *);
+#include "../libclone/libclone.h"
 
 int main()
 {
Here also removed the redundant lines for passing Status value.
--- containers.old/netns/parent.sh	2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/parent.sh	2008-09-10 01:06:42.000000000 +0530
@@ -17,8 +17,3 @@ export TST_TOTAL
         tst_resm TFAIL "FAIL: Unable to ping ChildNS from ParentNS"
         status=-1
     fi
-    stat=`cat /tmp/FIFO6`
-    if [ $stat != 0 ] ; then
-        status=$stat
-    fi
-

Modified to consider the dynamic value for netdevice.
--- containers.old/netns/parentns.sh	2008-09-08 17:18:28.000000000 +0530
+++ containers/netns/parentns.sh	2008-09-10 01:06:42.000000000 +0530
@@ -28,7 +28,7 @@ status=0
     # Sets up the infrastructure for creating network NS
 
     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
@@ -58,6 +58,6 @@ status=0
         source $scrpt
     fi
 
-    debug "INFO: status is $status"
-    debug "INFO: Done executing parent script $0 "
+    debug "INFO: Done executing parent script $0, status is $status "
     exit $status
+
-------------------------------------------------------------------------
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

Reply via email to