Skip to contentSkip to conversation

networktests.sh: add ${LTPROOT}/bin into $PATH

PATCH In review Simon Xu 2 participants 5 messages Nov 4, 2013 – Nov 12, 2013 1 message not in the archive

lore
Share & tools
lore

Simon Xu

author
#0 lore raw

PATCH 1/1 networktests.sh: add ${LTPROOT}/bin into $PATH

Some tests need `gethost' (e.g. sendfile01), which lives in ${LTPROOT}/bin, which is not in $PATH of networktests.sh.

---
 testscripts/networktests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testscripts/networktests.sh +1 -1
index b136749..9465356 100755
@@ -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:"
Signature · 13 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 13 lines

Some tests need `gethost' (e.g. sendfile01), which lives in ${LTPROOT}/bin, which is not in $PATH of networktests.sh.

---
 testscripts/networktests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testscripts/networktests.sh +0 -0
index b136749..9465356 100755

testscripts/networktests.sh fi · line 113

Quoted 5 lines
testscripts/networktests.sh +1 -1
@@ -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).

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi!

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
---
  testscripts/networktests.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
testscripts/networktests.sh +0 -0
index b136749..9465356 100755
@@ -110,7 +110,7 @@ fi
 
Quoted 8 lines
Quoted 6 lines

testscripts/networktests.sh fi · line 113

Quoted 4 lines
testscripts/networktests.sh +1 -1
  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.

Quoted 7 lines
Quoted 3 lines

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.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
author
#4 lore raw

PATCH 1/1 move gethost from tools to sendfile01

Move tools/gethost.c to
testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
since sendfile01 is the only test that requires gethost.

---
 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
testcases/network/tcp_cmds/sendfile/Makefile +2 -2
index a8b0736..7ba2d7a 100644
@@ -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
 
testcases/network/tcp_cmds/sendfile/sendfile01 +2 -2
index ba61873..ebeb182 100755
@@ -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
testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c new file +107 -0

107 lines not on this page · raw message

tools/gethost.c deleted +0 -107

107 lines not on this page · raw message

Signature · 13 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#5 lore raw

Re: [LTP] [PATCH] move gethost from tools to sendfile01

Hi!

Quoted 5 lines

Move tools/gethost.c to
testcases/network/tcp_cmds/sendfile/sendfile01_gethost.c
since sendfile01 is the only test that requires gethost.

Pushed, thanks.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list