* [LTP] [PATCH] networktests.sh: add ${LTPROOT}/bin into $PATH
@ 2013-11-04 9:20 Simon Xu
2013-11-07 16:07 ` chrubis
0 siblings, 1 reply; 5+ messages in thread
From: Simon Xu @ 2013-11-04 9:20 UTC (permalink / raw)
To: ltp-list
Some tests need `gethost' (e.g. sendfile01), which lives in ${LTPROOT}/bin,
which is not in $PATH of networktests.sh.
Signed-off-by: Simon Xu <xu.simon@oracle.com>
---
testscripts/networktests.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testscripts/networktests.sh b/testscripts/networktests.sh
index b136749..9465356 100755
--- a/testscripts/networktests.sh
+++ b/testscripts/networktests.sh
@@ -110,7 +110,7 @@ fi
cd $TMPDIR
-export PATH="${PATH}:${LTPROOT}/testcases/bin"
+export PATH="${PATH}:${LTPROOT}/bin:${LTPROOT}/testcases/bin"
if [ ${VERBOSE} = "yes" ]; then
echo "Network parameters:"
--
1.8.4.2
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] networktests.sh: add ${LTPROOT}/bin into $PATH
2013-11-04 9:20 [LTP] [PATCH] networktests.sh: add ${LTPROOT}/bin into $PATH Simon Xu
@ 2013-11-07 16:07 ` chrubis
[not found] ` <527C5B3D.60205@oracle.com>
0 siblings, 1 reply; 5+ messages in thread
From: chrubis @ 2013-11-07 16:07 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
Hi!
> Some tests need `gethost' (e.g. sendfile01), which lives in ${LTPROOT}/bin,
> which is not in $PATH of networktests.sh.
>
> Signed-off-by: Simon Xu <xu.simon@oracle.com>
> ---
> testscripts/networktests.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testscripts/networktests.sh b/testscripts/networktests.sh
> index b136749..9465356 100755
> --- a/testscripts/networktests.sh
> +++ b/testscripts/networktests.sh
> @@ -110,7 +110,7 @@ fi
>
> cd $TMPDIR
>
> -export PATH="${PATH}:${LTPROOT}/testcases/bin"
> +export PATH="${PATH}:${LTPROOT}/bin:${LTPROOT}/testcases/bin"
You can remove the original export that adds ${LTPROOT}/testcases/bin as
this path is allready added by runltp script.
And I think that better solution would be to install genhost into the
testcases/bin (as the rest of the binaries used from the tests such as
tst_resm).
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] networktests.sh: add ${LTPROOT}/bin into $PATH
[not found] ` <527C5B3D.60205@oracle.com>
@ 2013-11-11 14:08 ` chrubis
2013-11-12 10:59 ` [LTP] [PATCH] move gethost from tools to sendfile01 Simon Xu
0 siblings, 1 reply; 5+ messages in thread
From: chrubis @ 2013-11-11 14:08 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
Hi!
> >> Signed-off-by: Simon Xu <xu.simon@oracle.com>
> >> ---
> >> testscripts/networktests.sh | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/testscripts/networktests.sh b/testscripts/networktests.sh
> >> index b136749..9465356 100755
> >> --- a/testscripts/networktests.sh
> >> +++ b/testscripts/networktests.sh
> >> @@ -110,7 +110,7 @@ fi
> >>
> >> cd $TMPDIR
> >>
> >> -export PATH="${PATH}:${LTPROOT}/testcases/bin"
> >> +export PATH="${PATH}:${LTPROOT}/bin:${LTPROOT}/testcases/bin"
> > You can remove the original export that adds ${LTPROOT}/testcases/bin as
> > this path is allready added by runltp script.
>
> We need to make sure that it's in PATH when using networktests.sh.
Ah this is a script that is executed manually (not from runtest files)
then the path to ${LTPROOT}/testcases/bin is OK.
> > And I think that better solution would be to install genhost into the
> > testcases/bin (as the rest of the binaries used from the tests such as
> > tst_resm).
>
> gethost.c is in ltp/tools and everything in the dir is installed to
> ltp/bin. I think we should keep this in case some other tests need
> ltp/bin/gethost.
I was grepping for gethost in the LTP sources and it looks like there is
only one testcase sendfile01 that uses this binary. So moving it to
testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c looks like a
best solution to me. It will get installed along the test binaries,
etc...
The tools directory is directory for tools used to run the tests, i.e.
ltp-pan.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] move gethost from tools to sendfile01
2013-11-11 14:08 ` chrubis
@ 2013-11-12 10:59 ` Simon Xu
2013-11-12 12:38 ` chrubis
0 siblings, 1 reply; 5+ messages in thread
From: Simon Xu @ 2013-11-12 10:59 UTC (permalink / raw)
To: ltp-list
Move tools/gethost.c to
testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
since sendfile01 is the only test that requires gethost.
Signed-off-by: Simon Xu <xu.simon@oracle.com>
---
testcases/network/tcp_cmds/sendfile/Makefile | 4 +-
testcases/network/tcp_cmds/sendfile/sendfile01 | 4 +-
.../network/tcp_cmds/sendfile/sendfile01_gethost.c | 107 +++++++++++++++++++++
tools/gethost.c | 107 ---------------------
4 files changed, 111 insertions(+), 111 deletions(-)
create mode 100644 testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
delete mode 100644 tools/gethost.c
diff --git a/testcases/network/tcp_cmds/sendfile/Makefile b/testcases/network/tcp_cmds/sendfile/Makefile
index a8b0736..7ba2d7a 100644
--- a/testcases/network/tcp_cmds/sendfile/Makefile
+++ b/testcases/network/tcp_cmds/sendfile/Makefile
@@ -27,9 +27,9 @@ include $(abs_srcdir)/../Makefile.inc
CPPFLAGS += -I$(abs_srcdir)/../include
-INSTALL_TARGETS := sendfile01 sendfile01_server
+INSTALL_TARGETS := sendfile01 sendfile01_server sendfile01_gethost
-MAKE_TARGETS += testsf_c testsf_s testsf_c6 testsf_s6
+MAKE_TARGETS += testsf_c testsf_s testsf_c6 testsf_s6 sendfile01_gethost
testsf_c6.o testsf_s6.o: CPPFLAGS += -DINET6
diff --git a/testcases/network/tcp_cmds/sendfile/sendfile01 b/testcases/network/tcp_cmds/sendfile/sendfile01
index ba61873..ebeb182 100755
--- a/testcases/network/tcp_cmds/sendfile/sendfile01
+++ b/testcases/network/tcp_cmds/sendfile/sendfile01
@@ -59,9 +59,9 @@ do_setup()
tst_setup
- exists awk diff gethost grep rsh stat
+ exists awk diff sendfile01_gethost grep rsh stat
- if ! IPADDR=$(gethost ${EXEC_SUFFIX:+6} $RHOST | awk 'BEGIN { ec=1 } /addresses:/ {print $2; ec=0 } END { exit ec }'); then
+ if ! IPADDR=$(sendfile01_gethost ${EXEC_SUFFIX:+6} $RHOST | awk 'BEGIN { ec=1 } /addresses:/ {print $2; ec=0 } END { exit ec }'); then
# XXX (garrcoop): || exit 1 is there to prevent the test from hanging in the event of an install error.
end_testcase "Failed to determine the appropriate IP address for the machine." || exit 1
fi
diff --git a/testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c b/testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
new file mode 100644
index 0000000..5b9a790
--- /dev/null
+++ b/testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
@@ -0,0 +1,107 @@
+/* host - print information about a host
+ * originally written by Paul Vixie @DEC WRL, January 1989
+ */
+
+/* DECWRL Header: host.c,v 1.1 89/04/05 15:41:12 vixie Locked $ */
+
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <stdio.h>
+#include <resolv.h>
+#include <netdb.h>
+#include <syslog.h>
+#include <string.h>
+#include <stdlib.h>
+
+#ifndef LOG_PERROR
+#define LOG_PERROR 0
+#endif
+
+int main(argc, argv)
+int argc;
+char **argv;
+{
+ u_char b_addr[IN6ADDRSZ];
+ struct hostent *host;
+ char **ap, **cp, *arg;
+ const char *prog = "amnesia";
+ int af = AF_INET;
+ int size = INADDRSZ;
+ int force = 0;
+
+ if (argc < 1) {
+usage:
+ printf("usage: %s [-d] [-6] [-f] (hostname|ipaddr)\n", prog);
+ exit(1);
+ }
+ prog = *argv++;
+ argc--;
+#ifdef LOG_USER
+ openlog(prog, LOG_PERROR, LOG_USER);
+#else
+ openlog(prog, LOG_PERROR);
+#endif
+ res_init();
+
+ if (argc >= 1 && !strcmp(*argv, "-d")) {
+ _res.options |= RES_DEBUG;
+ argv++, argc--;
+ }
+ if (argc >= 1 && !strcmp(*argv, "-6")) {
+ af = AF_INET6, size = IN6ADDRSZ;
+ _res.options |= RES_USE_INET6;
+ argv++, argc--;
+ }
+ if (argc >= 1 && !strcmp(*argv, "-f")) {
+ force++;
+ argv++, argc--;
+ }
+
+ if (argc < 1)
+ goto usage;
+ arg = *argv++;
+ argc--;
+
+ if (inet_pton(af, arg, b_addr)) {
+ char p[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
+
+ printf("[%s]\n", inet_ntop(af, b_addr, p, sizeof p));
+ if (!(host = gethostbyaddr((char *)b_addr, size, af))) {
+ herror("gethostbyaddr");
+ exit(1);
+ }
+ } else {
+ printf("{%s}\n", arg);
+ if (force)
+ host = gethostbyname2(arg, af);
+ else
+ host = gethostbyname(arg);
+ if (!host) {
+ herror("gethostbyname*");
+ exit(1);
+ }
+ }
+ printf("name: %s\n", host->h_name);
+ if (host->h_aliases && *host->h_aliases) {
+ printf("aliases:");
+ for (cp = (char **)host->h_aliases; *cp; cp++)
+ printf(" %s", *cp);
+ printf("\n");
+ }
+ if (host->h_addr_list && *host->h_addr_list) {
+ printf("addresses:");
+ for (ap = host->h_addr_list; *ap; ap++) {
+ char p[sizeof
+ "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
+
+ printf(" %s", inet_ntop(host->h_addrtype,
+ *ap, p, sizeof p));
+ }
+ printf("\n");
+ }
+ exit(0);
+}
diff --git a/tools/gethost.c b/tools/gethost.c
deleted file mode 100644
index 5b9a790..0000000
--- a/tools/gethost.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* host - print information about a host
- * originally written by Paul Vixie @DEC WRL, January 1989
- */
-
-/* DECWRL Header: host.c,v 1.1 89/04/05 15:41:12 vixie Locked $ */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <stdio.h>
-#include <resolv.h>
-#include <netdb.h>
-#include <syslog.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifndef LOG_PERROR
-#define LOG_PERROR 0
-#endif
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
- u_char b_addr[IN6ADDRSZ];
- struct hostent *host;
- char **ap, **cp, *arg;
- const char *prog = "amnesia";
- int af = AF_INET;
- int size = INADDRSZ;
- int force = 0;
-
- if (argc < 1) {
-usage:
- printf("usage: %s [-d] [-6] [-f] (hostname|ipaddr)\n", prog);
- exit(1);
- }
- prog = *argv++;
- argc--;
-#ifdef LOG_USER
- openlog(prog, LOG_PERROR, LOG_USER);
-#else
- openlog(prog, LOG_PERROR);
-#endif
- res_init();
-
- if (argc >= 1 && !strcmp(*argv, "-d")) {
- _res.options |= RES_DEBUG;
- argv++, argc--;
- }
- if (argc >= 1 && !strcmp(*argv, "-6")) {
- af = AF_INET6, size = IN6ADDRSZ;
- _res.options |= RES_USE_INET6;
- argv++, argc--;
- }
- if (argc >= 1 && !strcmp(*argv, "-f")) {
- force++;
- argv++, argc--;
- }
-
- if (argc < 1)
- goto usage;
- arg = *argv++;
- argc--;
-
- if (inet_pton(af, arg, b_addr)) {
- char p[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
-
- printf("[%s]\n", inet_ntop(af, b_addr, p, sizeof p));
- if (!(host = gethostbyaddr((char *)b_addr, size, af))) {
- herror("gethostbyaddr");
- exit(1);
- }
- } else {
- printf("{%s}\n", arg);
- if (force)
- host = gethostbyname2(arg, af);
- else
- host = gethostbyname(arg);
- if (!host) {
- herror("gethostbyname*");
- exit(1);
- }
- }
- printf("name: %s\n", host->h_name);
- if (host->h_aliases && *host->h_aliases) {
- printf("aliases:");
- for (cp = (char **)host->h_aliases; *cp; cp++)
- printf(" %s", *cp);
- printf("\n");
- }
- if (host->h_addr_list && *host->h_addr_list) {
- printf("addresses:");
- for (ap = host->h_addr_list; *ap; ap++) {
- char p[sizeof
- "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
-
- printf(" %s", inet_ntop(host->h_addrtype,
- *ap, p, sizeof p));
- }
- printf("\n");
- }
- exit(0);
-}
--
1.8.4.2
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] move gethost from tools to sendfile01
2013-11-12 10:59 ` [LTP] [PATCH] move gethost from tools to sendfile01 Simon Xu
@ 2013-11-12 12:38 ` chrubis
0 siblings, 0 replies; 5+ messages in thread
From: chrubis @ 2013-11-12 12:38 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
Hi!
> Move tools/gethost.c to
> testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
> since sendfile01 is the only test that requires gethost.
>
> Signed-off-by: Simon Xu <xu.simon@oracle.com>
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-12 12:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-04 9:20 [LTP] [PATCH] networktests.sh: add ${LTPROOT}/bin into $PATH Simon Xu
2013-11-07 16:07 ` chrubis
[not found] ` <527C5B3D.60205@oracle.com>
2013-11-11 14:08 ` chrubis
2013-11-12 10:59 ` [LTP] [PATCH] move gethost from tools to sendfile01 Simon Xu
2013-11-12 12:38 ` chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox