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 19:18:31 +0800 [thread overview]
Message-ID: <51CD7107.9030203@casparzhang.com> (raw)
In-Reply-To: <CAPwn2JQNo+-pVe3n31JH1aNXQADqDAQNa7xHUErWdRKExm7wEw@mail.gmail.com>
On 06/28/2013 03:24 PM, Hangbin Liu wrote:
> Yes, I have used this patch for a long time myself, but I only have
> the result in beaker.
> But I think the patch is safe, if you only use one interface, the
> result will be the same with before.
I'll leave the patch for others' review.
Caspar
>
> 2013/6/28 Caspar Zhang <caspar@casparzhang.com>:
>> On 06/28/2013 01:59 PM, Hangbin Liu wrote:
>>>
>>> No, the INTERFACE and LHOST_HWADDRS are both used to make sure we have
>>> enough NIC for some network testing.
>>>
>>> We can know the networking test topology from
>>> testcases/network/stress/README
>>>
>>> Physical Topology
>>> =================
>>>
>>> These tests require two machines. And each machine needs to have 2 or more
>>> interfaces. These tests assume that they run on the following topology.
>>>
>>> Control Link
>>> +------------------------------------+
>>> | |
>>> +-------+-------+ +-------+-------+
>>> | +---- Test Link 0 ---+ |
>>> | Local Host + : + Remote Host |
>>> | +---- Test Link n ---+ |
>>> +---------------+ +---------------+
>>>
>>> Control Link is used by the local host to control the remote host.
>>> `control' means, for example, changing the setting of the interfaces that
>>> are
>>> connected to the test links. The setting of the interfaces connected to
>>> the
>>> control link is never changed.
>>>
>>> Test Links are the place where the stress tests run. For example, test
>>> packets
>>> flow those links. The number of test links must be at least 1. The setting
>>> of
>>> the interfaces connectted to the test links would be changed by the tests.
>>> Therefore, each test link should not belong to any external network. It is
>>> recommended to connect each pair of interfaces with the ether cross
>>> cables.
>>>
>>> Currently, different NIC testcases for ICMP/UDP/TCP/Multicast require
>>> plural
>>> test links. Other testcases uses only 1 test link. (Test Link 0)
>>>
>>>
>>> So some tests, such as
>>> testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01
>>> testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01
>>> testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01
>>>
>>> they all need more than one NIC for testing.
>>>
>>> When we get INTERFACE="eth0|eth1", then we can get
>>> LHOST_HWADDRS="aa:bb:cc:dd:ee:fe aa:bb:cc:dd:ee:ff" from networkstress.sh.
>>>
>>> And for example, in test
>>> testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01
>>>
>>> We will check the total link num by
>>> link_total=`echo $LHOST_HWADDRS | wc -w`
>>>
>>> Then in "while [ $link_num -lt $link_total ]; do" loop, we will assign
>>> different IP address
>>> for each link with network_part="10.0.${link_num}".
>>>
>>> What I want to say is that we need to get two MAC addresses for
>>> LHOST_HWADDRS,
>>> so we have to make sure networkstress.sh can get two interface for
>>> INTERFACE
>>
>>
>> OK, I was a bit naive :-) thanks for the detailed explanation. I grepped a
>> bit in testcases/network and did find the two variables are widely used. I
>> think before we can prove all affected cases work with this change, we
>> should hold on the patch. Do you have a running result against all affected
>> cases?
>>
>> Thanks,
>> Caspar
>>
>>
>>
>>>
>>> 2013/6/28 Caspar Zhang <caspar@casparzhang.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 11:18 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
[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 [this message]
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=51CD7107.9030203@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox