* [LTP] [PATCH] rwho01: fix getting hostnames from command output and a typo
@ 2013-10-31 10:19 Simon Xu
2013-11-01 8:52 ` Simon Xu
0 siblings, 1 reply; 6+ messages in thread
From: Simon Xu @ 2013-10-31 10:19 UTC (permalink / raw)
To: ltp-list
Fix the way the script gets hostnames from rwho/ruptime command output,
and the mistake that $COUNT is used instead of $TST_COUNT in do_test().
---
testcases/network/tcp_cmds/rwho/rwho01 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/testcases/network/tcp_cmds/rwho/rwho01 b/testcases/network/tcp_cmds/rwho/rwho01
index 2c82ef1..eb31642 100755
--- a/testcases/network/tcp_cmds/rwho/rwho01
+++ b/testcases/network/tcp_cmds/rwho/rwho01
@@ -106,18 +106,18 @@ do_test()
while [ $TST_COUNT -le $NUMLOOPS ]; do
rwho -a > $OUTFILE
- HOST=`awk "\\$2 ~ /$LHOST>/" $OUTFILE | cut -f1 -d: | sort -u`
+ HOST=`grep $LHOST $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
[ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in rwho outfile"
- HOST=`awk "\\$2 ~ /$RHOSTNAME>/" $OUTFILE | cut -f1 -d: | sort -u`
+ HOST=`grep $RHOSTNAME $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
[ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in rwho outfile"
ruptime -a > $OUTFILE
- HOST=`awk "\\$1 ~ /$LHOST>/" $OUTFILE | sort -u`
+ HOST=`grep $LHOST $OUTFILE | sed 's/ .*//' | uniq`
[ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in ruptime outfile"
- HOST=`awk "\\$1 ~ /$RHOSTNAME>/" $OUTFILE | sort -u`
+ HOST=`grep $RHOSTNAME $OUTFILE | sed 's/ .*//' | uniq`
[ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in ruptime outfile"
- tst_resm TINFO "Test $COUNT of $NUMLOOPS complete"
+ tst_resm TINFO "Test $TST_COUNT of $NUMLOOPS complete"
incr_tst_count
done
}
--
1.8.4
------------------------------------------------------------------------------
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] 6+ messages in thread* Re: [LTP] [PATCH] rwho01: fix getting hostnames from command output and a typo
2013-10-31 10:19 [LTP] [PATCH] rwho01: fix getting hostnames from command output and a typo Simon Xu
@ 2013-11-01 8:52 ` Simon Xu
2013-11-04 8:58 ` [LTP] [PATCH V2] rwho01: fix getting hostnames from command output and $COUNT Simon Xu
0 siblings, 1 reply; 6+ messages in thread
From: Simon Xu @ 2013-11-01 8:52 UTC (permalink / raw)
To: ltp-list
Could anyone review this?
Thanks
Simon
On 10/31/13 18:19, Simon Xu wrote:
> Fix the way the script gets hostnames from rwho/ruptime command output,
> and the mistake that $COUNT is used instead of $TST_COUNT in do_test().
> ---
> testcases/network/tcp_cmds/rwho/rwho01 | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/network/tcp_cmds/rwho/rwho01 b/testcases/network/tcp_cmds/rwho/rwho01
> index 2c82ef1..eb31642 100755
> --- a/testcases/network/tcp_cmds/rwho/rwho01
> +++ b/testcases/network/tcp_cmds/rwho/rwho01
> @@ -106,18 +106,18 @@ do_test()
>
> while [ $TST_COUNT -le $NUMLOOPS ]; do
> rwho -a > $OUTFILE
> - HOST=`awk "\\$2 ~ /$LHOST>/" $OUTFILE | cut -f1 -d: | sort -u`
> + HOST=`grep $LHOST $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
> [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in rwho outfile"
> - HOST=`awk "\\$2 ~ /$RHOSTNAME>/" $OUTFILE | cut -f1 -d: | sort -u`
> + HOST=`grep $RHOSTNAME $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
> [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in rwho outfile"
>
> ruptime -a > $OUTFILE
> - HOST=`awk "\\$1 ~ /$LHOST>/" $OUTFILE | sort -u`
> + HOST=`grep $LHOST $OUTFILE | sed 's/ .*//' | uniq`
> [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in ruptime outfile"
> - HOST=`awk "\\$1 ~ /$RHOSTNAME>/" $OUTFILE | sort -u`
> + HOST=`grep $RHOSTNAME $OUTFILE | sed 's/ .*//' | uniq`
> [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in ruptime outfile"
>
> - tst_resm TINFO "Test $COUNT of $NUMLOOPS complete"
> + tst_resm TINFO "Test $TST_COUNT of $NUMLOOPS complete"
> incr_tst_count
> done
> }
------------------------------------------------------------------------------
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 [flat|nested] 6+ messages in thread
* [LTP] [PATCH V2] rwho01: fix getting hostnames from command output and $COUNT
2013-11-01 8:52 ` Simon Xu
@ 2013-11-04 8:58 ` Simon Xu
2013-11-04 17:20 ` chrubis
0 siblings, 1 reply; 6+ messages in thread
From: Simon Xu @ 2013-11-04 8:58 UTC (permalink / raw)
To: ltp-list
Fix the way the script gets hostnames from rwho/ruptime command output,
and the mistake that $COUNT is used instead of $TST_COUNT in do_test().
Signed-off-by: Simon Xu <xu.simon@oracle.com>
---
testcases/network/tcp_cmds/rwho/rwho01 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/testcases/network/tcp_cmds/rwho/rwho01 b/testcases/network/tcp_cmds/rwho/rwho01
index 2c82ef1..eb31642 100755
--- a/testcases/network/tcp_cmds/rwho/rwho01
+++ b/testcases/network/tcp_cmds/rwho/rwho01
@@ -106,18 +106,18 @@ do_test()
while [ $TST_COUNT -le $NUMLOOPS ]; do
rwho -a > $OUTFILE
- HOST=`awk "\\$2 ~ /$LHOST>/" $OUTFILE | cut -f1 -d: | sort -u`
+ HOST=`grep $LHOST $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
[ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in rwho outfile"
- HOST=`awk "\\$2 ~ /$RHOSTNAME>/" $OUTFILE | cut -f1 -d: | sort -u`
+ HOST=`grep $RHOSTNAME $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
[ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in rwho outfile"
ruptime -a > $OUTFILE
- HOST=`awk "\\$1 ~ /$LHOST>/" $OUTFILE | sort -u`
+ HOST=`grep $LHOST $OUTFILE | sed 's/ .*//' | uniq`
[ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in ruptime outfile"
- HOST=`awk "\\$1 ~ /$RHOSTNAME>/" $OUTFILE | sort -u`
+ HOST=`grep $RHOSTNAME $OUTFILE | sed 's/ .*//' | uniq`
[ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in ruptime outfile"
- tst_resm TINFO "Test $COUNT of $NUMLOOPS complete"
+ tst_resm TINFO "Test $TST_COUNT of $NUMLOOPS complete"
incr_tst_count
done
}
--
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] 6+ messages in thread* Re: [LTP] [PATCH V2] rwho01: fix getting hostnames from command output and $COUNT
2013-11-04 8:58 ` [LTP] [PATCH V2] rwho01: fix getting hostnames from command output and $COUNT Simon Xu
@ 2013-11-04 17:20 ` chrubis
[not found] ` <5278297D.5090407@oracle.com>
0 siblings, 1 reply; 6+ messages in thread
From: chrubis @ 2013-11-04 17:20 UTC (permalink / raw)
To: Simon Xu; +Cc: ltp-list
Hi!
> Fix the way the script gets hostnames from rwho/ruptime command output,
> and the mistake that $COUNT is used instead of $TST_COUNT in do_test().
The change from COUNT to TST_COUNT is pretty straightforward. Can you
please describe more verbosely why is the second change needed? Has the
output from rwho and ruptime changed over the time?
> while [ $TST_COUNT -le $NUMLOOPS ]; do
> rwho -a > $OUTFILE
> - HOST=`awk "\\$2 ~ /$LHOST>/" $OUTFILE | cut -f1 -d: | sort -u`
> + HOST=`grep $LHOST $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
> [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in rwho outfile"
> - HOST=`awk "\\$2 ~ /$RHOSTNAME>/" $OUTFILE | cut -f1 -d: | sort -u`
> + HOST=`grep $RHOSTNAME $OUTFILE | sed 's/[^ ]* *//; s/:.*//' | uniq`
> [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in rwho outfile"
>
> ruptime -a > $OUTFILE
> - HOST=`awk "\\$1 ~ /$LHOST>/" $OUTFILE | sort -u`
> + HOST=`grep $LHOST $OUTFILE | sed 's/ .*//' | uniq`
> [ "$HOST" = "$LHOST" ] || end_testcase "$LHOST is not in ruptime outfile"
> - HOST=`awk "\\$1 ~ /$RHOSTNAME>/" $OUTFILE | sort -u`
> + HOST=`grep $RHOSTNAME $OUTFILE | sed 's/ .*//' | uniq`
> [ "$HOST" = "$RHOSTNAME" ] || end_testcase "$RHOSTNAME is not in ruptime outfile"
>
> - tst_resm TINFO "Test $COUNT of $NUMLOOPS complete"
> + tst_resm TINFO "Test $TST_COUNT of $NUMLOOPS complete"
> incr_tst_count
> done
> }
> --
> 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
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
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 [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-06 10:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 10:19 [LTP] [PATCH] rwho01: fix getting hostnames from command output and a typo Simon Xu
2013-11-01 8:52 ` Simon Xu
2013-11-04 8:58 ` [LTP] [PATCH V2] rwho01: fix getting hostnames from command output and $COUNT Simon Xu
2013-11-04 17:20 ` chrubis
[not found] ` <5278297D.5090407@oracle.com>
2013-11-06 7:47 ` Simon Xu
2013-11-06 10:56 ` chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox