This patch fixes some of the errors that I found in network namespace creation
library.

A file test on an unset vriable will give a pass, so the current test fails.
(var scrpt may not have been set before calling :))This patch fixes that error.

Signed-off-by: Sudhir Kumar <sku...@linux.vnet.ibm.com>

Index: ltp-full-20081130/testcases/kernel/containers/libclone/libnetns.c
===================================================================
--- ltp-full-20081130.orig/testcases/kernel/containers/libclone/libnetns.c
+++ ltp-full-20081130/testcases/kernel/containers/libclone/libnetns.c
@@ -47,7 +47,7 @@ extern pid_t getsid(pid_t pid);
 
 int crtchild(char *s1 , char *s2)
 {
-    char *cmd[] = { "/bin/bash", s1, s2, (char *)0 };
+    char *cmd[] = { "--", s1, s2, (char *)0 };
     execve("/bin/bash", cmd, __environ);
     printf("The code would not reach here on success\n");
     perror("execve");
Index: ltp-full-20081130/testcases/kernel/containers/netns/parentns.sh
===================================================================
--- ltp-full-20081130.orig/testcases/kernel/containers/netns/parentns.sh
+++ ltp-full-20081130/testcases/kernel/containers/netns/parentns.sh
@@ -77,7 +77,7 @@ status=0
     echo $vnet1 > /tmp/FIFO2
 
     # Executes the script if it is passed as an argument.
-    if [ -f $scrpt ] ;  then
+    if [ ! -z $scrpt ] && [ -f $scrpt ] ;  then
         . $scrpt
     fi
 



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

Reply via email to