public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] Fix Network Namespace container test scripts
@ 2010-04-01  5:42 Sachin Sant
  2010-04-01  6:00 ` Rishikesh K Rajak
  0 siblings, 1 reply; 2+ messages in thread
From: Sachin Sant @ 2010-04-01  5:42 UTC (permalink / raw)
  To: ltp-list

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 <sachinp@in.ibm.com>
---
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] Fix Network Namespace container test scripts
  2010-04-01  5:42 [LTP] [PATCH] Fix Network Namespace container test scripts Sachin Sant
@ 2010-04-01  6:00 ` Rishikesh K Rajak
  0 siblings, 0 replies; 2+ messages in thread
From: Rishikesh K Rajak @ 2010-04-01  6:00 UTC (permalink / raw)
  To: Sachin Sant; +Cc: ltp-list

Tested this patch, it looks fine. Also few problems there which this commit
resolves.

f50539e0bcb0f9bab88101ce40a8e09a1d76d4a9

Acked & Tested By: Rishikesh K Rajak <risrajak@in.ibm.com>

-Rishi
On Thu, Apr 01, 2010 at 11:12:49AM +0530, Sachin Sant wrote:
> 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 <sachinp@in.ibm.com>
> ---
> 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++) {

-- 
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-01  6:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01  5:42 [LTP] [PATCH] Fix Network Namespace container test scripts Sachin Sant
2010-04-01  6:00 ` Rishikesh K Rajak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox