All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: LTP list <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH] testscripts/networkstress.sh: update for two interfaces support
Date: Tue, 25 Jun 2013 14:37:42 +0800	[thread overview]
Message-ID: <1372142262-4654-1-git-send-email-liuhangbin@gmail.com> (raw)

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}'`
 
 if [ -z ${RHOST} ]; then
 	## Just a silly check
-- 
1.8.1.4


------------------------------------------------------------------------------
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

             reply	other threads:[~2013-06-25  6:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25  6:37 Hangbin Liu [this message]
2013-06-27 16:02 ` [LTP] [PATCH] testscripts/networkstress.sh: update for two interfaces support chrubis
2013-06-28  3:13 ` Caspar Zhang
     [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=1372142262-4654-1-git-send-email-liuhangbin@gmail.com \
    --to=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.