From: Sachin Sant <sachinp@in.ibm.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] Fix Network Namespace container test scripts
Date: Thu, 01 Apr 2010 11:12:49 +0530 [thread overview]
Message-ID: <20100401054249.10197.78829.sendpatchset@localhost.localdomain> (raw)
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® 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
next reply other threads:[~2010-04-01 6:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 5:42 Sachin Sant [this message]
2010-04-01 6:00 ` [LTP] [PATCH] Fix Network Namespace container test scripts Rishikesh K Rajak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100401054249.10197.78829.sendpatchset@localhost.localdomain \
--to=sachinp@in.ibm.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.