Skip to contentSkip to conversation

networking/stress/tcp: make sure we will kill the test case after timeout

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 networking/stress/tcp: make sure we will kill the test case after timeout

In some old machines or guests, the system may not have the ability to set up all the connections, e.g. 4000 tcp connections, quickly. Then the system will take lots of time to try setup the connections or just huang there.

I think we should just kill all the connections after testing timeout, no matter how many connections we have setup. So mv the connecting setup while loop into whatchdog while loop.

---
 .../stress/tcp/multi-diffip/tcp4-multi-diffip01    | 62 ++++++++++-----------
 .../stress/tcp/multi-diffnic/tcp4-multi-diffnic01  | 28 +++++-----
 .../tcp/multi-diffport/tcp4-multi-diffport01       | 64 +++++++++++-----------
 .../tcp/multi-sameport/tcp4-multi-sameport01       | 33 +++++------
 4 files changed, 94 insertions(+), 93 deletions(-)
testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 +31 -31
index 8b9652c..58fdde7 100644
@@ -389,41 +389,41 @@ done
 server_pid=`grep PID: $info_file | cut -f 2 -d ' '`
 rm -f $info_file
 
-# Make connections
 connection_num=0
-while [ $connection_num -lt $ipaddr_pair_num ]; do
-    # IP addresses
-    x=`expr $connection_num \/ 255 % 255`
-    y=`expr $connection_num % 255`
-
-    case $IP_VER in
-	4)
-	lhost_addr="10.${x}.${y}.2"
-	;;
-
-	6)
-	hex_x=`printf %x $x`
-	hex_y=`printf %x $y`
-	lhost_addr="fd00:1:${hex_x}:${hex_y}::2"
-	;;
-    esac
-
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'`
-    if [ $ret -ne 0 ]; then
-	if [ $connection_num -eq 0 ]; then
-	    tst_resm TFAIL "Failed to run any client"
-		exit 1
-	else
-	    tst_resm TINFO "$connection_num seems the maximum number of the client"
-	fi
-	break
-    fi
-    connection_num=`expr $connection_num + 1`
-done
-
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Make connections
+	if [ $connection_num -lt $ipaddr_pair_num ]; then
+		# IP addresses
+		x=`expr $connection_num \/ 255 % 255`
+		y=`expr $connection_num % 255`
+
+		case $IP_VER in
+			4)
+				lhost_addr="10.${x}.${y}.2"
+				;;
+
+			6)
+				hex_x=`printf %x $x`
+				hex_y=`printf %x $y`
+				lhost_addr="fd00:1:${hex_x}:${hex_y}::2"
+				;;
+		esac
+
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'`
+		if [ $ret -ne 0 ]; then
+			if [ $connection_num -eq 0 ]; then
+				tst_resm TFAIL "Failed to run any client"
+				exit 1
+			else
+				tst_resm TINFO "$connection_num seems the maximum number of the client"
+			fi
+			break
+		fi
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
 
testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 +14 -14
index dc9e784..6a5a72c 100644
@@ -340,24 +340,24 @@ done
 server_pid=`grep PID: $info_file | cut -f 2 -d ' '`
 rm -f $info_file
 
-# Main loop
 connection_num=0
-while [ $connection_num -lt $link_total ]; do
-    field=`expr $connection_num + 1`
-    lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field`
-
-    # Run a client
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port'; echo $?'`
-    if [ $ret -ne 0 ]; then
-	tst_resm TFAIL "Failed to run client on Link${connection_num}"
-	exit 1
-    fi
-    connection_num=`expr $connection_num + 1`
-done
-
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Main loop
+	if [ $connection_num -lt $link_total ]; then
+		field=`expr $connection_num + 1`
+		lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field`
+
+		# Run a client
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port'; echo $?'`
+		if [ $ret -ne 0 ]; then
+			tst_resm TFAIL "Failed to run client on Link${connection_num}"
+			exit 1
+		fi
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
 
testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 +32 -32

76 lines not on this page · raw message

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +17 -16
index aff2481..206a0d1 100644
@@ -334,27 +334,28 @@ done
 server_pid=`grep PID: $info_file | cut -f 2 -d ' '`
 rm -f $info_file
 
-# Making connections
 connection_num=0
-while [ $connection_num -lt $CONNECTION_TOTAL ]; do
-    # Run a client
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'`
-    if [ $ret -ne 0 ]; then
-	# Failed to start any client
-	if [ $connection_num -eq 0 ]; then
-	    tst_resm TFAIL "Failed to run any client"
-	    exit 1
-	fi
-	# Failed to start a client
-	tst_resm TINFO "$connection_num seems the maximum number of the client"
-	break
-    fi
-    connection_num=`expr $connection_num + 1`
-done
 
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Making connections
+	if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+		# Run a client
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; echo $?'`
+		if [ $ret -ne 0 ]; then
+			# Failed to start any client
+			if [ $connection_num -eq 0 ]; then
+				tst_resm TFAIL "Failed to run any client"
+				exit 1
+			fi
+			# Failed to start a client
+			tst_resm TINFO "$connection_num seems the maximum number of the client"
+			break
+		fi
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
 
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

----- Original Message -----

Quoted 9 lines

From: "Hangbin Liu" <[email protected]>
To: "LTP list" <[email protected]>
Sent: Tuesday, 25 June, 2013 9:48:52 AM
Subject: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

In some old machines or guests, the system may not have the ability to set up all the connections, e.g. 4000 tcp connections, quickly. Then the system will take lots of time to try setup the connections or just huang there.

Quoted 5 lines

I think we should just kill all the connections after testing timeout, no matter how many connections we have setup. So mv the connecting setup while loop into whatchdog while loop.

Hi,

correct me if I'm reading this wrong.

By moving it to watchdog loop you allow only 1 connection per second, then taking your example number (4000), it is going to take 4000 seconds. Should we also lower that sleep?

Regards,
Jan

Quoted 280 lines
---
 .../stress/tcp/multi-diffip/tcp4-multi-diffip01    | 62
 ++++++++++-----------
 .../stress/tcp/multi-diffnic/tcp4-multi-diffnic01  | 28 +++++-----
 .../tcp/multi-diffport/tcp4-multi-diffport01       | 64
 +++++++++++-----------
 .../tcp/multi-sameport/tcp4-multi-sameport01       | 33 +++++------
 4 files changed, 94 insertions(+), 93 deletions(-)
testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 +31 -33
index 8b9652c..58fdde7 100644
@@ -389,41 +389,41 @@ done
 server_pid=`grep PID: $info_file | cut -f 2 -d ' '`
 rm -f $info_file
 
-# Make connections
 connection_num=0
-while [ $connection_num -lt $ipaddr_pair_num ]; do
-    # IP addresses
-    x=`expr $connection_num \/ 255 % 255`
-    y=`expr $connection_num % 255`
-
-    case $IP_VER in
-	4)
-	lhost_addr="10.${x}.${y}.2"
-	;;
-
-	6)
-	hex_x=`printf %x $x`
-	hex_y=`printf %x $y`
-	lhost_addr="fd00:1:${hex_x}:${hex_y}::2"
-	;;
-    esac
-
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $server_port' ; echo $?'`
-    if [ $ret -ne 0 ]; then
-	if [ $connection_num -eq 0 ]; then
-	    tst_resm TFAIL "Failed to run any client"
-		exit 1
-	else
-	    tst_resm TINFO "$connection_num seems the maximum number of the client"
-	fi
-	break
-    fi
-    connection_num=`expr $connection_num + 1`
-done
-
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Make connections
+	if [ $connection_num -lt $ipaddr_pair_num ]; then
+		# IP addresses
+		x=`expr $connection_num \/ 255 % 255`
+		y=`expr $connection_num % 255`
+
+		case $IP_VER in
+			4)
+				lhost_addr="10.${x}.${y}.2"
+				;;
+
+			6)
+				hex_x=`printf %x $x`
+				hex_y=`printf %x $y`
+				lhost_addr="fd00:1:${hex_x}:${hex_y}::2"
+				;;
+		esac
+
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $server_port' ; echo $?'`
+		if [ $ret -ne 0 ]; then
+			if [ $connection_num -eq 0 ]; then
+				tst_resm TFAIL "Failed to run any client"
+				exit 1
+			else
+				tst_resm TINFO "$connection_num seems the maximum number of the client"
+			fi
+			break
+		fi
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 +14 -16
index dc9e784..6a5a72c 100644
@@ -340,24 +340,24 @@ done
 server_pid=`grep PID: $info_file | cut -f 2 -d ' '`
 rm -f $info_file
 
-# Main loop
 connection_num=0
-while [ $connection_num -lt $link_total ]; do
-    field=`expr $connection_num + 1`
-    lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field`
-
-    # Run a client
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $server_port'; echo $?'`
-    if [ $ret -ne 0 ]; then
-	tst_resm TFAIL "Failed to run client on Link${connection_num}"
-	exit 1
-    fi
-    connection_num=`expr $connection_num + 1`
-done
-
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Main loop
+	if [ $connection_num -lt $link_total ]; then
+		field=`expr $connection_num + 1`
+		lhost_addr=`echo $lhost_addrs | cut -d ' ' -f $field`
+
+		# Run a client
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $server_port'; echo $?'`
+		if [ $ret -ne 0 ]; then
+			tst_resm TFAIL "Failed to run client on Link${connection_num}"
+			exit 1
+		fi
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`

diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 index e260d35..1b9f342 100644

testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 +32 -34
@@ -320,44 +320,44 @@ fi
 start_port=`echo $portbundle | cut -f 1 -d '-'`
 end_port=`echo $portbundle | cut -f 2 -d '-'`
 
-# Making connections
 connection_num=0
 current_port=$start_port
-while [ $current_port -le $end_port ]; do
-    # Run a server
-    ns-tcpserver -b -f $IP_VER -p $current_port
-    if [ $? -ne 0 ]; then
-	# Failed to start no server
-	if [ $connection_num -eq 0 ]; then
-	    tst_resm TFAIL "Failed to run a server"
-	    exit 1
-	fi
-	# Failed to start a server
-	tst_resm TINFO "$connection_num seems the maximum number of the server"
-	break
-    fi
-
-    # Run a clinet
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $current_port' ; echo $?'`
-    if [ $ret -ne 0 ]; then
-	# Failed to start any client
-	if [ $connection_num -eq 0 ]; then
-	    tst_resm TFAIL "Failed to run any client."
-	    exit 1
-	fi
-	# Failed to start a client
-	tst_resm TINFO "$connection_num seems the maximum number of the client"
-	break
-    fi
-
-    current_port=`expr $current_port + 1`
-    connection_num=`expr $connection_num + 1`
-done
-
 
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Making connections
+	if [ $current_port -le $end_port ]; then
+		# Run a server
+		ns-tcpserver -b -f $IP_VER -p $current_port
+		if [ $? -ne 0 ]; then
+			# Failed to start no server
+			if [ $connection_num -eq 0 ]; then
+				tst_resm TFAIL "Failed to run a server"
+				exit 1
+			fi
+			# Failed to start a server
+			tst_resm TINFO "$connection_num seems the maximum number of the server"
+			break
+		fi
+
+		# Run a clinet
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $current_port' ; echo $?'`
+		if [ $ret -ne 0 ]; then
+			# Failed to start any client
+			if [ $connection_num -eq 0 ]; then
+				tst_resm TFAIL "Failed to run any client."
+				exit 1
+			fi
+			# Failed to start a client
+			tst_resm TINFO "$connection_num seems the maximum number of the client"
+			break
+		fi
+
+		current_port=`expr $current_port + 1`
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
     if [ $elapse_epoc -ge $NS_DURATION ]; then

diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 index aff2481..206a0d1 100644

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +17 -19
@@ -334,27 +334,28 @@ done
 server_pid=`grep PID: $info_file | cut -f 2 -d ' '`
 rm -f $info_file
 
-# Making connections
 connection_num=0
-while [ $connection_num -lt $CONNECTION_TOTAL ]; do
-    # Run a client
-    ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $server_port' ; echo $?'`
-    if [ $ret -ne 0 ]; then
-	# Failed to start any client
-	if [ $connection_num -eq 0 ]; then
-	    tst_resm TFAIL "Failed to run any client"
-	    exit 1
-	fi
-	# Failed to start a client
-	tst_resm TINFO "$connection_num seems the maximum number of the client"
-	break
-    fi
-    connection_num=`expr $connection_num + 1`
-done
 
 # Watch the TCP traffic server
 start_epoc=`date +%s`
 while true ; do
+	# Making connections
+	if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+		# Run a client
+		ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER
-S $lhost_addr -p $server_port' ; echo $?'`
+		if [ $ret -ne 0 ]; then
+			# Failed to start any client
+			if [ $connection_num -eq 0 ]; then
+				tst_resm TFAIL "Failed to run any client"
+				exit 1
+			fi
+			# Failed to start a client
+			tst_resm TINFO "$connection_num seems the maximum number of the client"
+			break
+		fi
+		connection_num=`expr $connection_num + 1`
+	fi
+
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
 
--

1.8.1.4

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Quoted 8 lines

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

------------------------------------------------------------------------------
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): CAPwn2JTuF3EVb8_XoWkFk=qZc61FhNHenNDmdR7b6xrZFf9x1g@mail.gmail.com

#3 lore raw

----- Original Message -----

Quoted 7 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 8:36:05 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

No, we can set up $CONNECTION_TOTAL connections as soon as possible, and also transmit tcp data at the same time.

Where does this happen?

I'm looking at the while loop, and I see it creates 1 connection each iteration, then it sleeps for 1 second.

Am I missing something here?

while true ; do
# Making connections
if [ $connection_num -lt $CONNECTION_TOTAL ]; then
# make new connection
...
connection_num=expr $connection_num + 1
fi

# check time
...
sleep 1
done

Regards,
Jan

------------------------------------------------------------------------------
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): CAPwn2JRYRWDEvn090NdtM1K178R=yQSasmBX3ZoKymVtcRWPXw@mail.gmail.com

#5 lore raw

----- Original Message -----

Quoted 5 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 11:30:02 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hangbin,

just fyi, your replies are not going to list.

Quoted 4 lines

Opps, My mistake. Didn't find there is a sleep 1...

I will send another patch for this issue. How about check $connection_num every 100 times. like

I'd go with new variable to count each attempt, not just successful ones.

Or something like this (on top your patch):
Skip the sleep and continue on success, if we hit issue sleep and retry as watchdog allows.

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +3 -2
index 206a0d1..649c60b 100644
@@ -351,9 +351,10 @@ while true ; do
                        fi
                        # Failed to start a client
                        tst_resm TINFO "$connection_num seems the maximum number of the client"
-                       break
+               else
+                       connection_num=`expr $connection_num + 1`
+                       continue;
                fi
-               connection_num=`expr $connection_num + 1`
        fi
 
     current_epoc=`date +%s`

Regards,
Jan

Quoted 29 lines
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +1 -1
@@ -340,7 +340,7 @@ connection_num=0
 start_epoc=`date +%s`
 while true ; do
        # Making connections
-       if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+       while [ $connection_num -lt $CONNECTION_TOTAL ]; do
                # Run a client
                ret=`$LTP_RSH $RHOST

${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; ec

                if [ $ret -ne 0 ]; then
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +6 -1
@@ -354,7 +354,12 @@ while true ; do
                        break
                fi
                connection_num=`expr $connection_num + 1`
-       fi
+
+               # check timeout every 100 times
+               if [ $(($connection_num % 100)) -eq 0 ];then
+                       break
+               fi
+       done
 
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`
Quoted 39 lines

2013/6/28 Jan Stancek <[email protected]>:

Quoted 37 lines

----- Original Message -----

Quoted 9 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 8:36:05 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

No, we can set up $CONNECTION_TOTAL connections as soon as possible, and also
transmit tcp data at the same time.

Where does this happen?

I'm looking at the while loop, and I see it creates 1 connection each iteration, then it sleeps for 1 second.

Am I missing something here?

while true ; do
# Making connections
if [ $connection_num -lt $CONNECTION_TOTAL ]; then
# make new connection
...
connection_num=expr $connection_num + 1
fi

# check time
...
sleep 1
done

Regards,
Jan

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

#6 lore raw

Hi Jan,
The problem is the connection won't fail, but only need too much time. For example:
On a guest: on cpu process, 2G memory

# for i in `seq 4000`; do ./ns-tcpclient -b -f 4 -S 10.66.87.216 -p
9999; echo "The $i connection : `date`"; done
The 1 connection : Mon Jul  1 04:03:05 EDT 2013
The 2 connection : Mon Jul  1 04:03:05 EDT 2013
The 3 connection : Mon Jul  1 04:03:05 EDT 2013
The 4 connection : Mon Jul  1 04:03:06 EDT 2013
<snip>
The 19 connection : Mon Jul  1 04:04:46 EDT 2013
<snip>
The 30 connection : Mon Jul  1 04:06:34 EDT 2013
The 31 connection : Mon Jul  1 04:07:52 EDT 2013
<snip>
The 45 connection : Mon Jul  1 04:10:11 EDT 2013
<snip>
The 50 connection : Mon Jul  1 04:12:05 EDT 2013

You can saw we took 9 minutes to set up 50 tcp connections.

But on a powerful physical machine,
The 1 connection : Mon Jul 1 04:21:08 EDT 2013 The 2 connection : Mon Jul 1 04:21:08 EDT 2013 <snip>
The 499 connection : Mon Jul 1 04:24:35 EDT 2013 The 500 connection : Mon Jul 1 04:24:35 EDT 2013

It only use 3 minutest to set up 500 connections.

So we can't just continue on success, but should check the time after some connections.

Thanks and Best regards
Hangbin Liu

2013/6/28 Jan Stancek <[email protected]>:

Quoted 41 lines

----- Original Message -----

Quoted 5 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 11:30:02 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hangbin,

just fyi, your replies are not going to list.

Quoted 4 lines

Opps, My mistake. Didn't find there is a sleep 1...

I will send another patch for this issue. How about check $connection_num every 100 times. like

I'd go with new variable to count each attempt, not just successful ones.

Or something like this (on top your patch):
Skip the sleep and continue on success, if we hit issue sleep and retry as watchdog allows.

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +3 -2
index 206a0d1..649c60b 100644
@@ -351,9 +351,10 @@ while true ; do
                        fi
                        # Failed to start a client
                        tst_resm TINFO "$connection_num seems the maximum number of the client"
-                       break
+               else
+                       connection_num=`expr $connection_num + 1`
+                       continue;
                fi
-               connection_num=`expr $connection_num + 1`
        fi
 
     current_epoc=`date +%s`
Quoted 71 lines

Regards,
Jan

Quoted 68 lines
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +1 -1
@@ -340,7 +340,7 @@ connection_num=0
 start_epoc=`date +%s`
 while true ; do
        # Making connections
-       if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+       while [ $connection_num -lt $CONNECTION_TOTAL ]; do
                # Run a client
                ret=`$LTP_RSH $RHOST

${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; ec

                if [ $ret -ne 0 ]; then
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +6 -1
@@ -354,7 +354,12 @@ while true ; do
                        break
                fi
                connection_num=`expr $connection_num + 1`
-       fi
+
+               # check timeout every 100 times
+               if [ $(($connection_num % 100)) -eq 0 ];then
+                       break
+               fi
+       done
 
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`

2013/6/28 Jan Stancek <[email protected]>:

Quoted 37 lines

----- Original Message -----

Quoted 9 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 8:36:05 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

No, we can set up $CONNECTION_TOTAL connections as soon as possible, and also
transmit tcp data at the same time.

Where does this happen?

I'm looking at the while loop, and I see it creates 1 connection each iteration, then it sleeps for 1 second.

Am I missing something here?

while true ; do
# Making connections
if [ $connection_num -lt $CONNECTION_TOTAL ]; then
# make new connection
...
connection_num=expr $connection_num + 1
fi

# check time
...
sleep 1
done

Regards,
Jan

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

----- Original Message -----

Quoted 9 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: "ltp-list" <[email protected]>
Sent: Monday, 1 July, 2013 10:31:28 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hi Jan,
The problem is the connection won't fail, but only need too much time. For example:

I see, checking after each X connection seems reasonable.
I'm not very familiar with this test, so it's up to you to come up with some number.

Regards,
Jan

Quoted 28 lines

On a guest: on cpu process, 2G memory

# for i in `seq 4000`; do ./ns-tcpclient -b -f 4 -S 10.66.87.216 -p
9999; echo "The $i connection : `date`"; done
The 1 connection : Mon Jul  1 04:03:05 EDT 2013
The 2 connection : Mon Jul  1 04:03:05 EDT 2013
The 3 connection : Mon Jul  1 04:03:05 EDT 2013
The 4 connection : Mon Jul  1 04:03:06 EDT 2013
<snip>
The 19 connection : Mon Jul  1 04:04:46 EDT 2013
<snip>
The 30 connection : Mon Jul  1 04:06:34 EDT 2013
The 31 connection : Mon Jul  1 04:07:52 EDT 2013
<snip>
The 45 connection : Mon Jul  1 04:10:11 EDT 2013
<snip>
The 50 connection : Mon Jul  1 04:12:05 EDT 2013

You can saw we took 9 minutes to set up 50 tcp connections.

But on a powerful physical machine,
The 1 connection : Mon Jul 1 04:21:08 EDT 2013 The 2 connection : Mon Jul 1 04:21:08 EDT 2013 <snip>
The 499 connection : Mon Jul 1 04:24:35 EDT 2013 The 500 connection : Mon Jul 1 04:24:35 EDT 2013

It only use 3 minutest to set up 500 connections.

Quoted 127 lines

So we can't just continue on success, but should check the time after some connections.

Thanks and Best regards
Hangbin Liu

2013/6/28 Jan Stancek <[email protected]>:

Quoted 119 lines

----- Original Message -----

Quoted 6 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 11:30:02 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hangbin,

just fyi, your replies are not going to list.

Quoted 4 lines

Opps, My mistake. Didn't find there is a sleep 1...

I will send another patch for this issue. How about check $connection_num every 100 times. like

I'd go with new variable to count each attempt, not just successful ones.

Or something like this (on top your patch):
Skip the sleep and continue on success, if we hit issue sleep and retry as watchdog allows.

diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 index 206a0d1..649c60b 100644

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +3 -2
@@ -351,9 +351,10 @@ while true ; do
                        fi
                        # Failed to start a client
                        tst_resm TINFO "$connection_num seems the maximum
                        number of the client"
-                       break
+               else
+                       connection_num=`expr $connection_num + 1`
+                       continue;
                fi
-               connection_num=`expr $connection_num + 1`
        fi
 
     current_epoc=`date +%s`

Regards,
Jan

Quoted 70 lines
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +1 -1
@@ -340,7 +340,7 @@ connection_num=0
 start_epoc=`date +%s`
 while true ; do
        # Making connections
-       if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+       while [ $connection_num -lt $CONNECTION_TOTAL ]; do
                # Run a client
                ret=`$LTP_RSH $RHOST

${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; ec

                if [ $ret -ne 0 ]; then
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +6 -1
@@ -354,7 +354,12 @@ while true ; do
                        break
                fi
                connection_num=`expr $connection_num + 1`
-       fi
+
+               # check timeout every 100 times
+               if [ $(($connection_num % 100)) -eq 0 ];then
+                       break
+               fi
+       done
 
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`

2013/6/28 Jan Stancek <[email protected]>:

Quoted 39 lines

----- Original Message -----

Quoted 11 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 8:36:05 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill
the test case after timeout

No, we can set up $CONNECTION_TOTAL connections as soon as possible, and
also
transmit tcp data at the same time.

Where does this happen?

I'm looking at the while loop, and I see it creates 1 connection each iteration, then it sleeps for 1 second.

Am I missing something here?

while true ; do
# Making connections
if [ $connection_num -lt $CONNECTION_TOTAL ]; then
# make new connection
...
connection_num=expr $connection_num + 1
fi

# check time
...
sleep 1
done

Regards,
Jan

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

#8 lore raw

Sorry the late reply, too busy these days. I think 100 is suitable, It won't take too much time on sleeping, and will check timeout after a while.
I will send a new patchv2 for all this issue.

Thanks
Hangbin Liu

2013/7/1 Jan Stancek <[email protected]>:

Quoted 15 lines

----- Original Message -----

Quoted 9 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: "ltp-list" <[email protected]>
Sent: Monday, 1 July, 2013 10:31:28 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hi Jan,
The problem is the connection won't fail, but only need too much time. For example:

Quoted 161 lines

I see, checking after each X connection seems reasonable.
I'm not very familiar with this test, so it's up to you to come up with some number.

Regards,
Jan

Quoted 155 lines

On a guest: on cpu process, 2G memory

# for i in `seq 4000`; do ./ns-tcpclient -b -f 4 -S 10.66.87.216 -p
9999; echo "The $i connection : `date`"; done
The 1 connection : Mon Jul  1 04:03:05 EDT 2013
The 2 connection : Mon Jul  1 04:03:05 EDT 2013
The 3 connection : Mon Jul  1 04:03:05 EDT 2013
The 4 connection : Mon Jul  1 04:03:06 EDT 2013
<snip>
The 19 connection : Mon Jul  1 04:04:46 EDT 2013
<snip>
The 30 connection : Mon Jul  1 04:06:34 EDT 2013
The 31 connection : Mon Jul  1 04:07:52 EDT 2013
<snip>
The 45 connection : Mon Jul  1 04:10:11 EDT 2013
<snip>
The 50 connection : Mon Jul  1 04:12:05 EDT 2013

You can saw we took 9 minutes to set up 50 tcp connections.

But on a powerful physical machine,
The 1 connection : Mon Jul 1 04:21:08 EDT 2013 The 2 connection : Mon Jul 1 04:21:08 EDT 2013 <snip>
The 499 connection : Mon Jul 1 04:24:35 EDT 2013 The 500 connection : Mon Jul 1 04:24:35 EDT 2013

It only use 3 minutest to set up 500 connections.

So we can't just continue on success, but should check the time after some connections.

Thanks and Best regards
Hangbin Liu

2013/6/28 Jan Stancek <[email protected]>:

Quoted 119 lines

----- Original Message -----

Quoted 6 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 11:30:02 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hangbin,

just fyi, your replies are not going to list.

Quoted 4 lines

Opps, My mistake. Didn't find there is a sleep 1...

I will send another patch for this issue. How about check $connection_num every 100 times. like

I'd go with new variable to count each attempt, not just successful ones.

Or something like this (on top your patch):
Skip the sleep and continue on success, if we hit issue sleep and retry as watchdog allows.

diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 index 206a0d1..649c60b 100644

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +3 -2
@@ -351,9 +351,10 @@ while true ; do
                        fi
                        # Failed to start a client
                        tst_resm TINFO "$connection_num seems the maximum
                        number of the client"
-                       break
+               else
+                       connection_num=`expr $connection_num + 1`
+                       continue;
                fi
-               connection_num=`expr $connection_num + 1`
        fi
 
     current_epoc=`date +%s`

Regards,
Jan

Quoted 70 lines
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +1 -1
@@ -340,7 +340,7 @@ connection_num=0
 start_epoc=`date +%s`
 while true ; do
        # Making connections
-       if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+       while [ $connection_num -lt $CONNECTION_TOTAL ]; do
                # Run a client
                ret=`$LTP_RSH $RHOST

${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; ec

                if [ $ret -ne 0 ]; then
testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +6 -1
@@ -354,7 +354,12 @@ while true ; do
                        break
                fi
                connection_num=`expr $connection_num + 1`
-       fi
+
+               # check timeout every 100 times
+               if [ $(($connection_num % 100)) -eq 0 ];then
+                       break
+               fi
+       done
 
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`

2013/6/28 Jan Stancek <[email protected]>:

Quoted 39 lines

----- Original Message -----

Quoted 11 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 8:36:05 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill
the test case after timeout

No, we can set up $CONNECTION_TOTAL connections as soon as possible, and
also
transmit tcp data at the same time.

Where does this happen?

I'm looking at the while loop, and I see it creates 1 connection each iteration, then it sleeps for 1 second.

Am I missing something here?

while true ; do
# Making connections
if [ $connection_num -lt $CONNECTION_TOTAL ]; then
# make new connection
...
connection_num=expr $connection_num + 1
fi

# check time
...
sleep 1
done

Regards,
Jan

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

#9 lore raw
In reply to Hangbin Liu

Hi,
I have also seen "connect(): connection timeout for basically ipv6 " behavior for networking/stress/tcp testcase i.e.

tcp6-multi-sameport12 0 TINFO : - Test duration is 120 [sec] tcp6-multi-sameport12 0 TINFO : - Target number of the connection is 128 tcp6-multi-sameport12 0 TINFO : - Version of IP is IPv6 tcp6-multi-sameport12 0 TINFO : - Network delay is 600ms +/- 200ms tcp6-multi-sameport12 0 TINFO : - IPsec [ ESP / tunnel ] connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out
connect(): Connection timed out

This behavior is not due testcase but its due to kernel. So I did some code changes in Linux kernel 3.2 i.e. mentioned below

In /net/ipv6/ip6_output.c

int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
dst->dev, dst_output);
}

- net_dbg_ratelimited("IPv6: sending pkt_too_big to self\n");
skb->dev = dst->dev;
- icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
+ ipv6_local_error(sk, EMSGSIZE, fl6, mtu);
IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); kfree_skb(skb);
return -EMSGSIZE;

After above mentioned code changes all networking/stress/tcp testcase gets PASS.

Thanks and Regards,
Bhushan

-----Original Message-----
From: Hangbin Liu [mailto:[email protected]]
Sent: Monday, July 01, 2013 2:01 PM
To: Jan Stancek
Cc: ltp-list
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hi Jan,
The problem is the connection won't fail, but only need too much time. For example:
On a guest: on cpu process, 2G memory

# for i in `seq 4000`; do ./ns-tcpclient -b -f 4 -S 10.66.87.216 -p 9999; echo "The $i connection : `date`"; done The 1 connection : Mon Jul  1 04:03:05 EDT 2013 The 2 connection : Mon Jul  1 04:03:05 EDT 2013 The 3 connection : Mon Jul  1 04:03:05 EDT 2013 The 4 connection : Mon Jul  1 04:03:06 EDT 2013 <snip> The 19 connection : Mon Jul  1 04:04:46 EDT 2013 <snip> The 30 connection : Mon Jul  1 04:06:34 EDT 2013 The 31 connection : Mon Jul  1 04:07:52 EDT 2013 <snip> The 45 connection : Mon Jul  1 04:10:11 EDT 2013 <snip> The 50 connection : Mon Jul  1 04:12:05 EDT 2013

You can saw we took 9 minutes to set up 50 tcp connections.

But on a powerful physical machine,
The 1 connection : Mon Jul 1 04:21:08 EDT 2013 The 2 connection : Mon Jul 1 04:21:08 EDT 2013 <snip> The 499 connection : Mon Jul 1 04:24:35 EDT 2013 The 500 connection : Mon Jul 1 04:24:35 EDT 2013

It only use 3 minutest to set up 500 connections.

So we can't just continue on success, but should check the time after some connections.

Thanks and Best regards
Hangbin Liu

2013/6/28 Jan Stancek <[email protected]>:

Quoted 46 lines

----- Original Message -----

Quoted 6 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 11:30:02 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

Hangbin,

just fyi, your replies are not going to list.

Quoted 4 lines

Opps, My mistake. Didn't find there is a sleep 1...

I will send another patch for this issue. How about check $connection_num every 100 times. like

I'd go with new variable to count each attempt, not just successful ones.

Or something like this (on top your patch):
Skip the sleep and continue on success, if we hit issue sleep and retry as watchdog allows.

(quoted diff) +0 -0

a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 index 206a0d1..649c60b 100644
---
a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport0 +++ 1

testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +3 -2
@@ -351,9 +351,10 @@ while true ; do
                        fi
                        # Failed to start a client
                        tst_resm TINFO "$connection_num seems the maximum number of the client"
-                       break
+               else
+                       connection_num=`expr $connection_num + 1`
+                       continue;
                fi
-               connection_num=`expr $connection_num + 1`
        fi
 
     current_epoc=`date +%s`
Quoted 72 lines

Regards,
Jan

Quoted 69 lines

---
a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 +++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport +++ 01

(quoted diff) +1 -1
@@ -340,7 +340,7 @@ connection_num=0
 start_epoc=`date +%s`
 while true ; do
        # Making connections
-       if [ $connection_num -lt $CONNECTION_TOTAL ]; then
+       while [ $connection_num -lt $CONNECTION_TOTAL ]; do
                # Run a client
                ret=`$LTP_RSH $RHOST

${LTPROOT}/testcases/bin/ns-tcpclient -b -f $IP_VER -S $lhost_addr -p $server_port' ; ec

                if [ $ret -ne 0 ]; then @@ -354,7 +354,12 @@ while 

true ; do
break
fi
connection_num=expr $connection_num + 1

(quoted diff) +6 -1
-       fi
+
+               # check timeout every 100 times
+               if [ $(($connection_num % 100)) -eq 0 ];then
+                       break
+               fi
+       done
 
     current_epoc=`date +%s`
     elapse_epoc=`expr $current_epoc - $start_epoc`

2013/6/28 Jan Stancek <[email protected]>:

Quoted 36 lines

----- Original Message -----

Quoted 8 lines

From: "Hangbin Liu" <[email protected]>
To: "Jan Stancek" <[email protected]>
Sent: Friday, 28 June, 2013 8:36:05 AM
Subject: Re: [LTP] [PATCH] networking/stress/tcp: make sure we will kill the test case after timeout

No, we can set up $CONNECTION_TOTAL connections as soon as possible, and also transmit tcp data at the same time.

Where does this happen?

I'm looking at the while loop, and I see it creates 1 connection each iteration, then it sleeps for 1 second.

Am I missing something here?

while true ; do
# Making connections
if [ $connection_num -lt $CONNECTION_TOTAL ]; then
# make new connection
...
connection_num=expr $connection_num + 1
fi

# check time
...
sleep 1
done

Regards,
Jan

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

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