NETNS tests from containers fails to execute with following message

Running netns tests.
--: childns.sh '/opt/ltp': No such file or directory

LTP infrastructure fails to locate the childns.sh script. Fix this.
There were few hardcoded paths within various tests which are not available
during runtime.

eg : %s/testcases/kernel/containers/netns/paripv6.sh

Fix those occurences by specifying proper paths (%s/testcases/bin/paripv6.sh)

The following patch allows the test to be executed properly on my Fedora 12
system.

Signed-off-by : Sachin Sant <[email protected]>
---
diff -Naurp 1/testcases/kernel/containers/netns/common.c 
2/testcases/kernel/containers/netns/common.c
--- 1/testcases/kernel/containers/netns/common.c        2010-03-31 
14:14:06.000000000 +0530
+++ 2/testcases/kernel/containers/netns/common.c        2010-04-01 
11:00:15.000000000 +0530
@@ -92,7 +92,7 @@ int create_net_namespace(char *p1, char 
        }
 
        /* We need to pass the child pid to the parentns.sh script */
-       sprintf(par, "parentns.sh '%s' %s %" PRId32 , ltproot, p1, pid);
+       sprintf(par, "%s/testcases/bin/parentns.sh %s %" PRId32 , ltproot, p1, 
pid);
 
        ret = system(par);
        status = WEXITSTATUS(ret);
@@ -141,7 +141,7 @@ int child_fn(void *c1)
                exit(1);
        }
 
-       sprintf(child, "childns.sh '%s'", ltproot);
+       sprintf(child, "%s/testcases/bin/childns.sh", ltproot);
 
        /* Unshare the network namespace in the child */
 #if HAVE_UNSHARE
diff -Naurp 1/testcases/kernel/containers/netns/par_chld_ipv6.c 
2/testcases/kernel/containers/netns/par_chld_ipv6.c
--- 1/testcases/kernel/containers/netns/par_chld_ipv6.c 2010-03-31 
14:14:06.000000000 +0530
+++ 2/testcases/kernel/containers/netns/par_chld_ipv6.c 2010-03-31 
14:21:54.000000000 +0530
@@ -74,10 +74,8 @@ int main()
         tst_resm(TFAIL, "error while allocating mem");
         exit(1);
     }
-    sprintf(par, "%s/testcases/kernel/containers/netns/paripv6.sh" ,     \
-ltproot);
-    sprintf(child, "%s/testcases/kernel/containers/netns/childipv6.sh" , \
-ltproot);
+    sprintf(par, "%s/testcases/bin/paripv6.sh", ltproot);
+    sprintf(child, "%s/testcases/bin/childipv6.sh", ltproot);
 
     if ((pid = fork()) == 0) {
 
diff -Naurp 1/testcases/kernel/containers/netns/sysfsview.c 
2/testcases/kernel/containers/netns/sysfsview.c
--- 1/testcases/kernel/containers/netns/sysfsview.c     2010-03-31 
14:14:06.000000000 +0530
+++ 2/testcases/kernel/containers/netns/sysfsview.c     2010-03-31 
14:22:13.000000000 +0530
@@ -56,7 +56,7 @@ int main()
         exit(1);
     }
 
-    sprintf(script, "%s/testcases/kernel/containers/netns/parent_share.sh" , 
ltproot);
+    sprintf(script, "%s/testcases/bin/parent_share.sh" , ltproot);
 
     /* Parent should be able to view child sysfs and vice versa */
     ret = system(script);
diff -Naurp 1/testcases/kernel/containers/netns/two_children_ns.c 
2/testcases/kernel/containers/netns/two_children_ns.c
--- 1/testcases/kernel/containers/netns/two_children_ns.c       2010-03-31 
14:14:06.000000000 +0530
+++ 2/testcases/kernel/containers/netns/two_children_ns.c       2010-03-31 
14:20:08.000000000 +0530
@@ -85,10 +85,10 @@ int main()
                exit(1);
     }
 
-    sprintf(child[0], "%s/testcases/kernel/containers/netns/child_1.sh" , 
ltproot);
-    sprintf(child[1], "%s/testcases/kernel/containers/netns/child_2.sh" , 
ltproot);
-    sprintf(par[0], "%s/testcases/kernel/containers/netns/parent_1.sh" , 
ltproot);
-    sprintf(par[1], "%s/testcases/kernel/containers/netns/parent_2.sh" , 
ltproot);
+    sprintf(child[0], "%s/testcases/bin/child_1.sh" , ltproot);
+    sprintf(child[1], "%s/testcases/bin/child_2.sh" , ltproot);
+    sprintf(par[0], "%s/testcases/bin/parent_1.sh" , ltproot);
+    sprintf(par[1], "%s/testcases/bin/parent_2.sh" , ltproot);
 
     /* Loop for creating two child Network Namespaces */
     for(i=0;i<2;i++) {

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to