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

Reply via email to