From: Caspar Zhang <caspar@casparzhang.com>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] testscripts/networkstress.sh: update for two interfaces support
Date: Fri, 28 Jun 2013 11:13:06 +0800 [thread overview]
Message-ID: <51CCFF42.6060703@casparzhang.com> (raw)
In-Reply-To: <1372142262-4654-1-git-send-email-liuhangbin@gmail.com>
On 06/25/2013 02:37 PM, Hangbin Liu wrote:
> As some networking tests need two interfaces at the same time. Use grep -P to
> get two interfaces' mac addresses.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> testscripts/networkstress.sh | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/testscripts/networkstress.sh b/testscripts/networkstress.sh
> index b40af72..499b40c 100755
> --- a/testscripts/networkstress.sh
> +++ b/testscripts/networkstress.sh
> @@ -15,6 +15,8 @@ fi
> export TMPDIR=/tmp/netst-$$
> mkdir $TMPDIR
> VERBOSE="no"
> +# Default interface is "eth0".
> +# For some test cases that need two interfaces, give parameter like "eth0|eth1"
> INTERFACE="eth0"
>
> #===========================================================================
> @@ -71,6 +73,7 @@ usage () {
> echo " -W|w: Run whole network stress tests"
> echo " -D|d: Test duration (default ${NS_DURATION} sec)"
> echo " -N|n: Select the network interface (default: $INTERFACE)"
> + echo " Two interfaces' format: \"eth0|eth1\""
> echo " -V|v: Enable verbose"
> echo " -H|h: This Usage"
> echo ""
> @@ -102,7 +105,7 @@ if [ -z ${TEST_CASE} ]; then
> usage
> fi
>
> -export LHOST_HWADDRS=`ifconfig | grep ${INTERFACE} | grep HWaddr |awk '{print $5}'`
> +export LHOST_HWADDRS=`ifconfig | grep -P ${INTERFACE} | grep HWaddr |awk '{print $5}'`
As my understanding, the INTERFACE & LHOST_HWADDRS variables only used
for verbose printing, right?
If yes, I'll give my ack here.
BTW, I'd to add quotations around ${INTERFACE}, to make sure 100% safety.
Caspar.
>
> if [ -z ${RHOST} ]; then
> ## Just a silly check
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-06-28 3:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 6:37 [LTP] [PATCH] testscripts/networkstress.sh: update for two interfaces support Hangbin Liu
2013-06-27 16:02 ` chrubis
2013-06-28 3:13 ` Caspar Zhang [this message]
[not found] ` <CAPwn2JSrnMeANv6Reh=Z1sGZEpr5aGD1SMKtffjwdxnuh+cv=w@mail.gmail.com>
2013-06-28 6:45 ` Caspar Zhang
[not found] ` <CAPwn2JQNo+-pVe3n31JH1aNXQADqDAQNa7xHUErWdRKExm7wEw@mail.gmail.com>
2013-06-28 11:18 ` Caspar Zhang
2013-07-04 1:13 ` Hangbin Liu
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=51CCFF42.6060703@casparzhang.com \
--to=caspar@casparzhang.com \
--cc=liuhangbin@gmail.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.