Skip to contentSkip to conversation

testscripts/networkstress.sh: update for two interfaces support

PATCH In review Hangbin Liu 3 participants 6 messages Jun 25, 2013 – Jul 4, 2013 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 testscripts/networkstress.sh: update for two interfaces support

As some networking tests need two interfaces at the same time. Use grep -P to get two interfaces' mac addresses.

---
 testscripts/networkstress.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
testscripts/networkstress.sh +4 -1
index b40af72..499b40c 100755
@@ -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
Signature · 13 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 4 lines
---
 testscripts/networkstress.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Is anybody on the list familiar with the code to give it a review?

I could try but I do miss the big picture.

(And the same applies to the next two patches in series)

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
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
#2 lore raw
In reply to Hangbin Liu
Quoted 30 lines · Hangbin Liu

As some networking tests need two interfaces at the same time. Use grep -P to get two interfaces' mac addresses.

---
  testscripts/networkstress.sh | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
testscripts/networkstress.sh +3 -0
index b40af72..499b40c 100755
@@ -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 ""

testscripts/networkstress.sh if [ -z ${TEST_CASE} ]; then · line 108

Quoted 5 lines
testscripts/networkstress.sh +1 -1
@@ -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.

testscripts/networkstress.sh if [ -z ${TEST_CASE} ]; then

Quoted 4 lines
testscripts/networkstress.sh +0 -0
  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

A message that is not in the archive (sent off-list or not yet received): CAPwn2JSrnMeANv6Reh=Z1sGZEpr5aGD1SMKtffjwdxnuh+cv=w@mail.gmail.com

#4 lore raw
Quoted 51 lines · Hangbin Liu

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

Quoted 6 lines

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

Quoted 62 lines

2013/6/28 Caspar Zhang <[email protected]>:

Quoted 60 lines · Hangbin Liu
Quoted 38 lines

As some networking tests need two interfaces at the same time. Use grep -P to
get two interfaces' mac addresses.

---
   testscripts/networkstress.sh | 5 ++++-
   1 file changed, 4 insertions(+), 1 deletion(-)
testscripts/networkstress.sh +2 -0
index b40af72..499b40c 100755
@@ -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"

#===========================================================================

testscripts/networkstress.sh +1 -1
@@ -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
Quoted 3 lines

'{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.

Quoted 4 lines
   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

A message that is not in the archive (sent off-list or not yet received): CAPwn2JQNo+-pVe3n31JH1aNXQADqDAQNa7xHUErWdRKExm7wEw@mail.gmail.com

#6 lore raw
Quoted 4 lines · Hangbin Liu

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

Quoted 153 lines

2013/6/28 Caspar Zhang <[email protected]>:

Quoted 151 lines · Hangbin Liu
Quoted 59 lines

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

Quoted 8 lines

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

Quoted 69 lines

2013/6/28 Caspar Zhang <[email protected]>:

Quoted 67 lines · Hangbin Liu
Quoted 41 lines

As some networking tests need two interfaces at the same time. Use grep -P
to
get two interfaces' mac addresses.

---
    testscripts/networkstress.sh | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)
testscripts/networkstress.sh +2 -0
index b40af72..499b40c 100755
@@ -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"

#===========================================================================

testscripts/networkstress.sh +1 -1
@@ -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
Quoted 4 lines

'{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.

Quoted 4 lines

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

#7 lore raw
In reply to Caspar Zhang

Hi Caspar,

Here are some results after applied this patch, there are all passed except two, one is IPcomp [ tunnel ] config failed, another is IPv6 connectivity failed. Both are not related with this patch.

<<<test_start>>>
tag=icmp4-multi-diffnic01 stime=1372785494 cmdline="icmp4-multi-diffnic01"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic01 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic01    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic01    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic01    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic01    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )

MARK-LWD-LOOP -- 2013-07-02 13:18:27 --
icmp4-multi-diffnic01 1 TPASS : Test is finished successfully.
<<<execution_status>>>
initiation_status="ok"
duration=104 termination_type=exited termination_id=0 corefile=no cutime=19 cstime=46
<<<test_end>>>
<<<test_start>>>
tag=icmp4-multi-diffnic02 stime=1372785598 cmdline="icmp4-multi-diffnic02"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic02 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic02    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic02    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic02    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic02    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp4-multi-diffnic02    0  TINFO  :  - IPsec [ AH / transport ]
icmp4-multi-diffnic02    1  TPASS  :  Test is finished successfully.

<<<execution_status>>>
initiation_status="ok"
duration=102 termination_type=exited termination_id=0 corefile=no cutime=20 cstime=49
<<<test_end>>>
<<<test_start>>>
tag=icmp4-multi-diffnic03 stime=1372785700 cmdline="icmp4-multi-diffnic03"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic03 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic03    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic03    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic03    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic03    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp4-multi-diffnic03    0  TINFO  :  - IPsec [ AH / tunnel ]
icmp4-multi-diffnic03    1  TPASS  :  Test is finished successfully.

<<<execution_status>>>
initiation_status="ok"
duration=104 termination_type=exited termination_id=0 corefile=no cutime=19 cstime=49
<<<test_end>>>
<<<test_start>>>
tag=icmp4-multi-diffnic04 stime=1372785804 cmdline="icmp4-multi-diffnic04"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic04 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic04    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic04    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic04    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic04    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )
icmp4-multi-diffnic04 0 TINFO : - IPsec [ ESP / transport ]

MARK-LWD-LOOP -- 2013-07-02 13:23:27 --
icmp4-multi-diffnic04 1 TPASS : Test is finished successfully.
<<<execution_status>>>
initiation_status="ok"
duration=102 termination_type=exited termination_id=0 corefile=no cutime=20 cstime=49
<<<test_end>>>
<<<test_start>>>
tag=icmp4-multi-diffnic05 stime=1372785906 cmdline="icmp4-multi-diffnic05"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic05 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic05    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic05    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic05    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic05    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp4-multi-diffnic05    0  TINFO  :  - IPsec [ ESP / tunnel ]
icmp4-multi-diffnic05    1  TPASS  :  Test is finished successfully.

<<<execution_status>>>
initiation_status="ok"
duration=102 termination_type=exited termination_id=0 corefile=no cutime=20 cstime=48
<<<test_end>>>
<<<test_start>>>
tag=icmp4-multi-diffnic06 stime=1372786008 cmdline="icmp4-multi-diffnic06"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic06 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic06    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic06    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic06    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic06    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )
icmp4-multi-diffnic06 0 TINFO : - IPcomp [ transport ]

MARK-LWD-LOOP -- 2013-07-02 13:28:27 --
icmp4-multi-diffnic06 1 TPASS : Test is finished successfully.
<<<execution_status>>>
initiation_status="ok"
duration=103 termination_type=exited termination_id=0 corefile=no cutime=19 cstime=50
<<<test_end>>>
<<<test_start>>>
tag=icmp4-multi-diffnic07 stime=1372786111 cmdline="icmp4-multi-diffnic07"
contacts=""
analysis=exit
<<<test_output>>>
icmp4-multi-diffnic07 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp4-multi-diffnic07    0  TINFO  :  - Test duration is 60 [sec]
icmp4-multi-diffnic07    0  TINFO  :  - Target number of the connection is 2
icmp4-multi-diffnic07    0  TINFO  :  - Version of IP is IPv4
icmp4-multi-diffnic07    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )
icmp4-multi-diffnic07 0 TINFO : - IPcomp [ tunnel ]
Invalid argument.
Invalid argument.
icmp4-multi-diffnic07 1 TBROK : Failed to configure SAD/SPD on
the local host.
<<<execution_status>>>
initiation_status="ok"
duration=7 termination_type=exited termination_id=1 corefile=no cutime=12 cstime=35
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic01 stime=1372786118 cmdline="icmp6-multi-diffnic01"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic01 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic01    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic01    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic01    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic01    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )
icmp6-multi-diffnic01 1 TPASS : Test is finished successfully.
<<<execution_status>>>
initiation_status="ok"
duration=103 termination_type=exited termination_id=0 corefile=no cutime=20 cstime=36
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic02 stime=1372786221 cmdline="icmp6-multi-diffnic02"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic02 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic02    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic02    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic02    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic02    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp6-multi-diffnic02    0  TINFO  :  - IPsec [ AH / transport ]
icmp6-multi-diffnic02    1  TPASS  :  Test is finished successfully.

<<<execution_status>>>
initiation_status="ok"
duration=103 termination_type=exited termination_id=0 corefile=no cutime=19 cstime=38
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic03 stime=1372786324 cmdline="icmp6-multi-diffnic03"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic03 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic03    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic03    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic03    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic03    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )
icmp6-multi-diffnic03 0 TINFO : - IPsec [ AH / tunnel ]

MARK-LWD-LOOP -- 2013-07-02 13:33:27 --
icmp6-multi-diffnic03 1 TPASS : Test is finished successfully.
<<<execution_status>>>
initiation_status="ok"
duration=104 termination_type=exited termination_id=0 corefile=no cutime=20 cstime=39
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic04 stime=1372786428 cmdline="icmp6-multi-diffnic04"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic04 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic04    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic04    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic04    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic04    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp6-multi-diffnic04    0  TINFO  :  - IPsec [ ESP / transport ]
icmp6-multi-diffnic04    1  TPASS  :  Test is finished successfully.

<<<execution_status>>>
initiation_status="ok"
duration=106 termination_type=exited termination_id=0 corefile=no cutime=18 cstime=39
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic05 stime=1372786534 cmdline="icmp6-multi-diffnic05"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic05 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic05    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic05    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic05    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic05    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp6-multi-diffnic05    0  TINFO  :  - IPsec [ ESP / tunnel ]
icmp6-multi-diffnic05    1  TPASS  :  Test is finished successfully.

<<<execution_status>>>
initiation_status="ok"
duration=103 termination_type=exited termination_id=0 corefile=no cutime=18 cstime=40
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic06 stime=1372786637 cmdline="icmp6-multi-diffnic06"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic06 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic06    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic06    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic06    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic06    0  TINFO  :  - Size of packets are ( 10 100

1000 10000 65507 )
icmp6-multi-diffnic06 0 TINFO : - IPcomp [ transport ]

MARK-LWD-LOOP -- 2013-07-02 13:38:27 --
icmp6-multi-diffnic06 1 TPASS : Test is finished successfully.
<<<execution_status>>>
initiation_status="ok"
duration=104 termination_type=exited termination_id=0 corefile=no cutime=20 cstime=38
<<<test_end>>>
<<<test_start>>>
tag=icmp6-multi-diffnic07 stime=1372786741 cmdline="icmp6-multi-diffnic07"
contacts=""
analysis=exit
<<<test_output>>>
icmp6-multi-diffnic07 0 TINFO : Verify that the kernel is not
crashed with receiving and sending various size of ICMP message at differnt NIC simultaneously with the following conditions

icmp6-multi-diffnic07    0  TINFO  :  - Test duration is 60 [sec]
icmp6-multi-diffnic07    0  TINFO  :  - Target number of the connection is 2
icmp6-multi-diffnic07    0  TINFO  :  - Version of IP is IPv6
icmp6-multi-diffnic07    0  TINFO  :  - Size of packets are ( 10 100
1000 10000 65507 )
icmp6-multi-diffnic07    0  TINFO  :  - IPcomp [ tunnel ]
icmp6-multi-diffnic07    1  TBROK  :  There is no IPv6 connectivity on Link0

incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=86 termination_type=exited termination_id=1 corefile=no cutime=13 cstime=28
<<<test_end>>>
ltp-pan reported FAIL

2013/6/28 Caspar Zhang <[email protected]>:

Quoted 70 lines · Hangbin Liu
Quoted 59 lines

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

Quoted 8 lines

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

Quoted 81 lines

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

Quoted 69 lines

2013/6/28 Caspar Zhang <[email protected]>:

Quoted 67 lines · Hangbin Liu
Quoted 41 lines

As some networking tests need two interfaces at the same time. Use grep -P
to
get two interfaces' mac addresses.

---
   testscripts/networkstress.sh | 5 ++++-
   1 file changed, 4 insertions(+), 1 deletion(-)
testscripts/networkstress.sh +2 -0
index b40af72..499b40c 100755
@@ -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"

#===========================================================================

testscripts/networkstress.sh +1 -1
@@ -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
Quoted 4 lines

'{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.

Quoted 4 lines
   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