* [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests
@ 2015-02-13 12:06 Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 2/11] network/stress/interface/docs: cleanup Alexey Kodanev
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:06 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if-addr-adddel | 326 +++++++++++++
.../network/stress/interface/if-addr-addlarge | 481 ++++++++++++++++++++
testcases/network/stress/interface/if-mtu-change | 264 +++++++++++
testcases/network/stress/interface/if-route-adddel | 293 ++++++++++++
.../network/stress/interface/if-route-addlarge | 292 ++++++++++++
testcases/network/stress/interface/if-updown | 258 +++++++++++
.../network/stress/interface/if4-alias-adddel | 326 -------------
.../network/stress/interface/if4-alias-addlarge | 481 --------------------
testcases/network/stress/interface/if4-mtu-change | 264 -----------
.../network/stress/interface/if4-route-adddel | 293 ------------
.../network/stress/interface/if4-route-addlarge | 292 ------------
testcases/network/stress/interface/if4-updown | 258 -----------
12 files changed, 1914 insertions(+), 1914 deletions(-)
create mode 100644 testcases/network/stress/interface/if-addr-adddel
create mode 100644 testcases/network/stress/interface/if-addr-addlarge
create mode 100644 testcases/network/stress/interface/if-mtu-change
create mode 100644 testcases/network/stress/interface/if-route-adddel
create mode 100644 testcases/network/stress/interface/if-route-addlarge
create mode 100644 testcases/network/stress/interface/if-updown
delete mode 100644 testcases/network/stress/interface/if4-alias-adddel
delete mode 100644 testcases/network/stress/interface/if4-alias-addlarge
delete mode 100644 testcases/network/stress/interface/if4-mtu-change
delete mode 100644 testcases/network/stress/interface/if4-route-adddel
delete mode 100644 testcases/network/stress/interface/if4-route-addlarge
delete mode 100644 testcases/network/stress/interface/if4-updown
diff --git a/testcases/network/stress/interface/if-addr-adddel b/testcases/network/stress/interface/if-addr-adddel
new file mode 100644
index 0000000..4e6e4d6
--- /dev/null
+++ b/testcases/network/stress/interface/if-addr-adddel
@@ -0,0 +1,326 @@
+#!/bin/sh
+
+################################################################################
+## ##
+## Copyright (c) International Business Machines Corp., 2005 ##
+## ##
+## This program is free software; you can redistribute it and#or modify ##
+## it under the terms of the GNU General Public License as published by ##
+## the Free Software Foundation; either version 2 of the License, or ##
+## (at your option) any later version. ##
+## ##
+## This program is distributed in the hope that it will be useful, but ##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
+## for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program; if not, write to the Free Software ##
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
+## ##
+## ##
+################################################################################
+#
+# File:
+# if4-alias-adddel
+#
+# Description:
+# Verify the IPv4 connectivity isn't broken with adding and deleting an
+# IPv4 alias many times
+# test01 - by `ifconfig add' style
+# test02 - by `ifconfig ethn:n' style
+# test03 - by ip command
+#
+# Setup:
+# See ltp-yyyymmdd/testcases/network/stress/README
+#
+# Author:
+# Mitsuru Chinen <mitch@jp.ibm.com>
+#
+# History:
+# Oct 19 2005 - Created (Mitsuru Chinen)
+#
+#-----------------------------------------------------------------------
+# Uncomment line below for debug output.
+#trace_logic=${trace_logic:-"set -x"}
+$trace_logic
+
+# Make sure the value of LTPROOT
+LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
+export LTPROOT
+
+# Total number of the test case
+TST_TOTAL=3
+export TST_TOTAL
+
+# Default of the test case ID and the test case count
+TCID=if4-alias-adddel
+TST_COUNT=0
+export TCID
+export TST_COUNT
+
+# Check the environmanet variable
+. check_envval || exit $TST_TOTAL
+
+# The number of the add/delete IPv4 alias
+NS_TIMES=${NS_TIMES:-10000}
+
+# The interval of the check interface activity
+CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
+
+# The number of the test link where tests run
+LINK_NUM=0
+
+# Network portion of the IPv4 address
+IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
+
+# Netmask of for the tested network
+IPV4_NETMASK="255.255.255.0"
+IPV4_NETMASK_NUM=24
+
+# Broadcast address of the tested network
+IPV4_BROADCAST=${IPV4_NETWORK}.255
+
+# Host portion of the IPv4 address of the remote host
+RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
+
+# Host portion of the non-alias
+LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"254"}
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_setup
+#
+# DESCRIPTION:
+# Make a IPv4 connectivity
+#
+# SET VALUES:
+# rhost_ipv4addr - IPv4 Address of the remote host
+# lhost_ifname - Interface name of the local host
+# rhost_ifname - Interface name of the remote host
+#
+#-----------------------------------------------------------------------
+do_setup()
+{
+ TCID=if4-alias-adddel
+ TST_COUNT=0
+
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Configure the interface at the remote host
+ initialize_if rhost ${LINK_NUM}
+ set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to initialize the interface at the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # IPv4 address of the remote host
+ rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+
+ # Get the Interface name of local host
+ lhost_ifname=`get_ifname lhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the local host"
+ exit $TST_TOTAL
+ fi
+
+ # Get the Interface name of remote host
+ rhost_ifname=`get_ifname rhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the remote host"
+ exit $TST_TOTAL
+ fi
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_cleanup
+#
+# DESCRIPTION:
+# Recover the tested interfaces
+#
+#-----------------------------------------------------------------------
+do_cleanup()
+{
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test_body
+#
+# DESCRIPTION:
+# main code of the test
+#
+# Arguments:
+# $1: define the test type
+# 1 - `ifconfig add' style
+# 2 - `ifconfig ethn:n' style
+# 3 - ip command
+#
+#-----------------------------------------------------------------------
+test_body()
+{
+ test_type=$1
+
+ TCID=if4-alias-adddel0${test_type}
+ TST_COUNT=$test_type
+
+ case $test_type in
+ 1) # Case of ifconfig add
+ command_style="'ifconfig add'"
+ ;;
+ 2) # Case of ifconfig ethn:n
+ command_style="'ifconfig ethn:n'"
+ ;;
+ 3) # Case of ip command
+ command_style="ip command"
+ ;;
+ *)
+ tst_resm TBROK "unspecified case"
+ return 1
+ ;;
+ esac
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when $command_style adds, then deletes an IPv4 alias $NS_TIMES times"
+
+ # Make sure that no alias exists.
+ initialize_if lhost ${LINK_NUM}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to initialize the interface at the local host"
+ return 1
+ fi
+
+ # Set the non-alias address
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to assign an IPv4 address to the interface at the local host"
+ return 1
+ fi
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+
+ # Check the connctivity
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # IPv4 alias address of the localhost
+ lhost_ipv4_alias_ip=${IPV4_NETWORK}.${test_type}${test_type}
+
+ # The interface alias of local host
+ case $test_type in
+ 1) # Case of ifconfig add
+ lhost_ifalias=${lhost_ifname}:0
+ ;;
+ 2) # Case of ifconfig ethn:n
+ lhost_ifalias=${lhost_ifname}:1
+ ;;
+ # interface alias doesn't exist at ip command case.
+ esac
+
+ # Make a background TCP traffic from the non-alias address
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ cnt=0
+ while [ $cnt -lt $NS_TIMES ]; do
+ # Create
+ case $test_type in
+ 1) # Case of ifconfig add
+ ifconfig $lhost_ifname add ${lhost_ipv4_alias_ip} netmask ${IPV4_NETMASK} broadcast ${IPV4_BROADCAST}
+ ;;
+ 2) # Case of ifconfig ethn:n
+ ifconfig $lhost_ifalias ${lhost_ipv4_alias_ip} netmask ${IPV4_NETMASK} broadcast ${IPV4_BROADCAST}
+ ;;
+ 3) # Case of ip command
+ ip addr add ${lhost_ipv4_alias_ip}/${IPV4_NETMASK_NUM} broadcast ${IPV4_BROADCAST} dev ${lhost_ifname}
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to add ${lhost_ipv4_alias_ip}".
+ return 1
+ fi
+
+ # Check the connectivity
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
+ if [ $test_type -ne 3 ]; then
+ # Case of ifconfig add / ifconfig ethn:n
+ check_icmpv4_connectivity $lhost_ifalias $rhost_ipv4addr
+ else
+ # Case of ip command
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ fi
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "$lhost_ifname is broken."
+ return 1
+ fi
+ fi
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+
+ # Delete
+ case $test_type in
+ 1) # Case of ifconfig add
+ ifconfig $lhost_ifalias del ${lhost_ipv4_alias_ip}
+ ;;
+ 2) # Case of ifconfig ethn:n
+ ifconfig ${lhost_ifalias} down
+ ;;
+ 3) # Case of ip command
+ ip addr del ${lhost_ipv4_alias_ip}/${IPV4_NETMASK_NUM} broadcast ${IPV4_BROADCAST} dev ${lhost_ifname}
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to delete ${lhost_ipv4_alias_ip}".
+ return 1
+ fi
+ done
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+#-----------------------------------------------------------------------
+#
+# Main
+#
+# Exit Value:
+# The number of the failure
+#
+#-----------------------------------------------------------------------
+
+RC=0
+do_setup
+test_body 1 || RC=`expr $RC + 1` # Case of ifconfig add
+test_body 2 || RC=`expr $RC + 1` # Case of ifconfig ethn:n
+test_body 3 || RC=`expr $RC + 1` # Case of ip command
+do_cleanup
+
+exit $RC
diff --git a/testcases/network/stress/interface/if-addr-addlarge b/testcases/network/stress/interface/if-addr-addlarge
new file mode 100644
index 0000000..13efe84
--- /dev/null
+++ b/testcases/network/stress/interface/if-addr-addlarge
@@ -0,0 +1,481 @@
+#!/bin/sh
+
+################################################################################
+## ##
+## Copyright (c) International Business Machines Corp., 2005 ##
+## ##
+## This program is free software; you can redistribute it and#or modify ##
+## it under the terms of the GNU General Public License as published by ##
+## the Free Software Foundation; either version 2 of the License, or ##
+## (at your option) any later version. ##
+## ##
+## This program is distributed in the hope that it will be useful, but ##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
+## for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program; if not, write to the Free Software ##
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
+## ##
+## ##
+################################################################################
+#
+# File:
+# if4-alias-addlarge
+#
+# Description:
+# Verify the IPv4 connectivity isn't broken with creating a large number
+# of IPv4-aliases
+# test01 - by `ifconfig add' style
+# test02 - by `ifconfig ethn:n' style
+# test03 - by ip command
+#
+# Setup:
+# See ltp-yyyymmdd/testcases/network/stress/README
+#
+# Author:
+# Mitsuru Chinen <mitch@jp.ibm.com>
+#
+# History:
+# Oct 19 2005 - Created (Mitsuru Chinen)
+#
+#-----------------------------------------------------------------------
+# Uncomment line below for debug output.
+#trace_logic=${trace_logic:-"set -x"}
+$trace_logic
+
+# Make sure the value of LTPROOT
+LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
+export LTPROOT
+
+# Total number of the test case
+TST_TOTAL=3
+export TST_TOTAL
+
+# Default of the test case ID and the test case count
+TCID=if4-alias-addlarge
+TST_COUNT=0
+export TCID
+export TST_COUNT
+
+# Check the environmanet variable
+. check_envval || exit $TST_TOTAL
+
+# The number of the add IPv4 alias
+IP_TOTAL=${IP_TOTAL:-10000}
+
+# The interval of the check interface activity
+CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IP_TOTAL \/ 100`}
+
+# The number of the test link where tests run
+LINK_NUM=0
+
+# Network portion of the IPv4 address
+IPV4_NETWORK=${IPV4_NETWORK:-"10"}
+
+# Netmask of for the tested network
+IPV4_NETMASK="255.0.0.0"
+IPV4_NETMASK_NUM=8
+
+# Broadcast address of the tested network
+IPV4_BROADCAST=${IPV4_NETWORK}.255.255.255
+
+# Host portion of the IPv4 address
+LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"0.0.2"}
+RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"0.0.1"}
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_setup
+#
+# DESCRIPTION:
+# Make a IPv4 connectivity
+#
+# SET VALUES:
+# lhost_ifname - Interface name of the local host
+# rhost_ifname - Interface name of the local host
+# rhost_ipv4addr - IP address of the remote host
+#
+#-----------------------------------------------------------------------
+do_setup()
+{
+ TCID=if4-alias-addlarge
+ TST_COUNT=0
+
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Initialize the interface at the remote host
+ initialize_if rhost ${LINK_NUM}
+
+ # Set IPv4 address to the interface at the remote host
+ set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to add an IPv4 address at the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # Get the Interface names
+ lhost_ifname=`get_ifname lhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the local host"
+ exit $TST_TOTAL
+ fi
+ rhost_ifname=`get_ifname rhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # IPv4 address of the remote host
+ rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_cleanup
+#
+# DESCRIPTION:
+# Recover the tested interfaces
+#
+#-----------------------------------------------------------------------
+do_cleanup()
+{
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test01
+#
+# DESCRIPTION:
+# Creating a large number of IPv4-aliases by `ifconfig add'
+#
+#-----------------------------------------------------------------------
+test01()
+{
+ TCID=if4-alias-addlarge01
+ TST_COUNT=1
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when 'ifconifg add' creates $IP_TOTAL IPv4-aliases."
+
+ # Make sure that no alias exists.
+ initialize_if lhost ${LINK_NUM}
+
+ # Set the non-alias address
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to add IPv4 address to the interface at the local host"
+ return 1
+ fi
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+
+ # Check the connctivity
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # Set up for the loop
+ # Note: 2 colon aliases are added by `ifconfig ethn:x:y'
+ # `ifconfig ethn:x:y:... add ' runs 4 times per a pair of x,y
+ cnt=0
+ x=1 ; y=1 ; xymax=99
+ a=1 ; amax=3
+ ifalias="${lhost_ifname}:${x}:${y}"
+ ifconfig $ifalias ${IPV4_NETWORK}.${x}.${y}.${a} \
+ netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
+
+ # Make a background TCP traffic from the non-alias address
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ while [ $cnt -lt $IP_TOTAL ]; do
+ if [ $a -gt $amax ]; then
+ a=1
+ y=`expr $y + 1`
+ if [ $y -gt $xymax ]; then
+ y=1
+ x=`expr $x + 1`
+ if [ $x -gt $xymax ]; then
+ tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
+ break
+ fi
+ fi
+ ifalias="${lhost_ifname}:${x}:${y}"
+ ifconfig $ifalias ${IPV4_NETWORK}.${x}.${y}.${a} \
+ netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
+ fi
+
+ # Create
+ a=`expr $a + 1`
+ ifconfig $ifalias add ${IPV4_NETWORK}.${x}.${y}.${a} \
+ netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
+ if [ $? -ne 0 ]; then
+ tst_resm TINFO "It seems $cnt is limit."
+ break
+ fi
+ ifalias="${ifalias}:0"
+
+ # Check
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % $CHECK_INTERVAL` -eq 0 ]; then
+ # Check the connectivity from the remote host to
+ # the local host alias.
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.${x}.${y}.${a}' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TFAIL "The interface ${lhost_ifname} is broken."
+ return 1
+ fi
+ fi
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+ done
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ # Check the connecitivy from the interface (non-alias)
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "The interface ${lhost_ifname} is broken."
+ return 1
+ fi
+
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test02
+#
+# DESCRIPTION:
+# Creating a large number of IPv4-aliases by `ifconfig ethn:n'
+#
+#-----------------------------------------------------------------------
+test02()
+{
+ TCID=if4-alias-addlarge02
+ TST_COUNT=2
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when 'ifconfig ethn:n' creates $IP_TOTAL IPv4-aliases'"
+
+ # Make sure that no alias exists.
+ initialize_if lhost ${LINK_NUM}
+
+ # Set the non-alias address
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to initialize the interface at the local host"
+ return 1
+ fi
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+
+ # Check the connctivity
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # Make a background TCP traffic from the non-alias address
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ cnt=0
+ x=1 ; y=1 ; xymax=254
+ while [ $cnt -lt $IP_TOTAL ]; do
+ # Create
+ ifalias="${lhost_ifname}:${x}:${y}"
+ ifconfig $ifalias ${IPV4_NETWORK}.0.${x}.${y} \
+ netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
+ if [ $? -ne 0 ]; then
+ tst_resm TINFO "It seems $cnt is limit."
+ break
+ fi
+
+
+ # Check the connectivity
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
+ # Check the connectivity from the remote host to
+ # the local host alias.
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.0.${x}.${y}'; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TFAIL "The interface ${lhost_ifname} is broken."
+ return 1
+ fi
+ fi
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+
+ # Define next IP and alias
+ y=`expr $y + 1`
+ if [ $y -gt $xymax ]; then
+ y=1
+ x=`expr $x + 1`
+ if [ $x -gt $xymax ]; then
+ tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
+ break
+ fi
+ fi
+ done
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ # Check the connecitivy from the interface (non-alias)
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "The interface ${lhost_ifname} is broken."
+ return 1
+ fi
+
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test03
+#
+# DESCRIPTION:
+# Creating a large number of IPv4-aliases by ip command
+#
+#-----------------------------------------------------------------------
+test03()
+{
+ TCID=if4-alias-addlarge03
+ TST_COUNT=3
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when ip command creates $IP_TOTAL IPv4-aliases"
+
+ # Make sure that no alias exists.
+ initialize_if lhost ${LINK_NUM}
+
+ # Set the non-alias address
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to initialize the interface at the local host"
+ return 1
+ fi
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+
+ # Check the connctivity
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # Make a background TCP traffic from the non-alias address
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ cnt=0
+ x=1 ; y=1 ; xymax=254
+ while [ $cnt -lt $IP_TOTAL ]; do
+ # Create
+ ip addr add ${IPV4_NETWORK}.1.${x}.${y}/${IPV4_NETMASK_NUM} \
+ broadcast $IPV4_BROADCAST dev ${lhost_ifname}
+ if [ $? -ne 0 ]; then
+ tst_resm TINFO "It seems $cnt is limit."
+ break
+ fi
+
+ # Check the connectivity
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
+ # Check the connectivity from the remote host to
+ # the local host alias.
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.1.${x}.${y}' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TFAIL "The interface ${lhost_ifname} is broken."
+ return 1
+ fi
+ fi
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+
+ # Define next IP and alias
+ y=`expr $y + 1`
+ if [ $y -gt $xymax ]; then
+ y=1
+ x=`expr $x + 1`
+ if [ $x -gt $xymax ]; then
+ tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
+ break
+ fi
+ fi
+ done
+
+ # Check the connecitivy from the interface (non-alias)
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "The interface ${lhost_ifname} is broken."
+ return 1
+ fi
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# Main
+#
+# Exit Value:
+# The number of the failure
+#
+#-----------------------------------------------------------------------
+
+RC=0
+do_setup
+test01 || RC=`expr $RC + 1`
+test02 || RC=`expr $RC + 1`
+test03 || RC=`expr $RC + 1`
+do_cleanup
+
+exit $RC
diff --git a/testcases/network/stress/interface/if-mtu-change b/testcases/network/stress/interface/if-mtu-change
new file mode 100644
index 0000000..f272ebd
--- /dev/null
+++ b/testcases/network/stress/interface/if-mtu-change
@@ -0,0 +1,264 @@
+#!/bin/sh
+
+################################################################################
+## ##
+## Copyright (c) International Business Machines Corp., 2005 ##
+## ##
+## This program is free software; you can redistribute it and#or modify ##
+## it under the terms of the GNU General Public License as published by ##
+## the Free Software Foundation; either version 2 of the License, or ##
+## (at your option) any later version. ##
+## ##
+## This program is distributed in the hope that it will be useful, but ##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
+## for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program; if not, write to the Free Software ##
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
+## ##
+## ##
+################################################################################
+#
+# File:
+# if4-mtu-change
+#
+# Description:
+# Verify the IPv4 connectivity isn't broken with changing MTU many times
+# test01 - by ifconfig command
+# test02 - by ip command
+#
+# Setup:
+# See ltp-yyyymmdd/testcases/network/stress/README
+#
+# Author:
+# Mitsuru Chinen <mitch@jp.ibm.com>
+#
+# History:
+# Oct 19 2005 - Created (Mitsuru Chinen)
+#
+#-----------------------------------------------------------------------
+# Uncomment line below for debug output.
+#trace_logic=${trace_logic:-"set -x"}
+$trace_logic
+
+# Make sure the value of LTPROOT
+LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
+export LTPROOT
+
+# Total number of the test case
+TST_TOTAL=2
+export TST_TOTAL
+
+# Default of the test case ID and the test case count
+TCID=if4-mtu-change
+TST_COUNT=0
+export TCID
+export TST_COUNT
+
+# Check the environmanet variable for the test
+. check_envval || exit $TST_TOTAL
+
+# The number of the change of the MTU
+MTU_CHANGE_TIMES=${MTU_CHANGE_TIMES:-1000}
+
+# The interval of the change [second]
+CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
+
+# The array of the value which MTU is changed into sequentially
+CHANGE_VALUES="784 1142 426 1500 68 1500 68 748 68 1142 1500"
+
+# The number of the test link where tests run
+LINK_NUM=0
+
+# Network portion of the IPv4 address
+IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
+
+# Host portion of the IPv4 address
+LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"} # local host
+RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"} # remote host
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_setup
+#
+# DESCRIPTION:
+# Make a IPv4 connectivity
+#
+# SET VALUES:
+# lhost_ipv4addr - IPv4 Address of the local host
+# rhost_ipv4addr - IPv4 Address of the remote host
+# lhost_ifname - Interface name of the localhost
+#
+#-----------------------------------------------------------------------
+do_setup()
+{
+ TCID=if4-mtu-change
+ TST_COUNT=0
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Set IPv4 address to the interfaces
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to set an IPv4 address at the local host"
+ exit $TST_TOTAL
+ fi
+ set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to set an IPv4 address at the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # IPv4 address of the local and remote host
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+ rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+
+ # Get the Interface name of local host
+ lhost_ifname=`get_ifname lhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the local host"
+ exit $TST_TOTAL
+ fi
+}
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_cleanup
+#
+# DESCRIPTION:
+# Recover the tested interfaces
+#
+#-----------------------------------------------------------------------
+do_cleanup()
+{
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+}
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test_body
+#
+# DESCRIPTION:
+# main code of the test
+#
+# Arguments:
+# $1: define the test type
+# 1 - ifconfig command case
+# 2 - ip command case
+#
+#-----------------------------------------------------------------------
+test_body()
+{
+ test_type=$1
+
+ TCID=if4-mtu-change0${test_type}
+ TST_COUNT=${test_type}
+
+ case $test_type in
+ 1)
+ test_command="ifconfig"
+ ;;
+ 2)
+ test_command="ip"
+ ;;
+ *)
+ tst_resm TBROK "unspecified case"
+ return 1
+ ;;
+ esac
+
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when $test_command command changes MTU $MTU_CHANGE_TIMES times every $CHANGE_INTERVAL seconds"
+
+ # Check the connctivity
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # Make a background TCP traffic
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ mtu_array_len=`echo $CHANGE_VALUES | wc -w`
+ cnt=0
+ while [ $cnt -lt $MTU_CHANGE_TIMES ]; do
+ # Wait CHANGE_INTERVAL seconds
+ sleep $CHANGE_INTERVAL
+
+ # Change
+ nth=`expr $cnt % $mtu_array_len`
+ field=`expr $nth + 1`
+ mtu=`echo $CHANGE_VALUES | cut -d ' ' -f $field`
+
+ case $test_type in
+ 1)
+ ifconfig $lhost_ifname mtu $mtu
+ ;;
+ 2)
+ ip link set $lhost_ifname mtu $mtu
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to change the mtu at $cnt time"
+ return 1
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+
+ cnt=`expr $cnt + 1`
+ done
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ # Check the connectivity again
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "$lhost_ifname is broken."
+ return 1
+ fi
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+#-----------------------------------------------------------------------
+#
+# Main
+#
+# Exit Value:
+# The number of the failure
+#
+#-----------------------------------------------------------------------
+
+RC=0
+do_setup
+test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
+test_body 2 || RC=`expr $RC + 1` # Case of ip command
+do_cleanup
+
+exit $RC
diff --git a/testcases/network/stress/interface/if-route-adddel b/testcases/network/stress/interface/if-route-adddel
new file mode 100644
index 0000000..8adf24f
--- /dev/null
+++ b/testcases/network/stress/interface/if-route-adddel
@@ -0,0 +1,293 @@
+#!/bin/sh
+
+################################################################################
+## ##
+## Copyright (c) International Business Machines Corp., 2005 ##
+## ##
+## This program is free software; you can redistribute it and#or modify ##
+## it under the terms of the GNU General Public License as published by ##
+## the Free Software Foundation; either version 2 of the License, or ##
+## (at your option) any later version. ##
+## ##
+## This program is distributed in the hope that it will be useful, but ##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
+## for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program; if not, write to the Free Software ##
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
+## ##
+## ##
+################################################################################
+#
+# File:
+# if4-route-adddel
+#
+# Description:
+# Verify the IPv4 connectivity is not broken with adding and deleting
+# an IPv4 route many times
+# test01 - by route command
+# test02 - by ip command
+#
+# Setup:
+# See ltp-yyyymmdd/testcases/network/stress/README
+#
+# Author:
+# Mitsuru Chinen <mitch@jp.ibm.com>
+#
+# History:
+# Oct 19 2005 - Created (Mitsuru Chinen)
+#
+#-----------------------------------------------------------------------
+# Uncomment line below for debug output.
+#trace_logic=${trace_logic:-"set -x"}
+$trace_logic
+
+# Make sure the value of LTPROOT
+LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
+export LTPROOT
+
+# Total number of the test case
+TST_TOTAL=2
+export TST_TOTAL
+
+# Default of the test case ID and the test case count
+TCID=if4-route-adddel
+TST_COUNT=0
+export TCID
+export TST_COUNT
+
+# Check the environmanet variable
+. check_envval || exit $TST_TOTAL
+
+# The number of the add/delete IPv4 alias
+NS_TIMES=${NS_TIMES:-10000}
+
+# The interval of the check interface activity
+CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
+
+# The number of the test link where tests run
+LINK_NUM=0
+
+# Network portion of the IPv4 address
+IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
+
+# Netmask of for the tested network
+IPV4_NETMASK="255.255.255.0"
+IPV4_NETMASK_NUM=24
+
+# Broadcast address of the tested network
+IPV4_BROADCAST=${IPV4_NETWORK}.255
+
+# Host portion of the IPv4 address
+LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}
+RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
+
+# The destination network to add and delete
+ADDDEL_ROUTE="10.10.10.0"
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_setup
+#
+# DESCRIPTION:
+# Make a IPv4 connectivity
+#
+# SET VALUES:
+# rhost_ipv4addr - IPv4 Address of the remote host
+# lhost_ifname - Interface name of the local host
+# rhost_ifname - Interface name of the remote host
+#
+#-----------------------------------------------------------------------
+do_setup()
+{
+ TCID=if4-route-adddel
+ TST_COUNT=0
+
+ # Initialize the interfaces of the remote host
+ initialize_if rhost ${LINK_NUM}
+
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Set IPv4 address to the interfaces
+ set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to add an IPv4 address the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # IPv4 address of the remote host
+ rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+
+ # Get the Interface name of local host
+ lhost_ifname=`get_ifname lhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the local host"
+ exit $TST_TOTAL
+ fi
+
+ # Get the Interface name of remote host
+ rhost_ifname=`get_ifname rhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the remote host"
+ exit $TST_TOTAL
+ fi
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_cleanup
+#
+# DESCRIPTION:
+# Recover the tested interfaces
+#
+#-----------------------------------------------------------------------
+do_cleanup()
+{
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+}
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test_body
+#
+# DESCRIPTION:
+# main code of the test
+#
+# Arguments:
+# $1: define the test type
+# 1 - route command case
+# 2 - ip command case
+#
+#-----------------------------------------------------------------------
+test_body()
+{
+ test_type=$1
+
+ TCID=if4-route-adddel0${test_type}
+ TST_COUNT=$test_type
+
+ case $test_type in
+ 1)
+ test_command="route"
+ ;;
+ 2)
+ test_command="ip"
+ ;;
+ *)
+ tst_resm TBROK "unspecified case"
+ return 1
+ ;;
+ esac
+
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command adds, then and deletes an IPv4 route $NS_TIMES times"
+
+ # Initialize the interface of the local host
+ initialize_if lhost ${LINK_NUM}
+
+ # Assign IPv4 address to the interface of the local host
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to assign an IPv4 address at the local host"
+ return 1
+ fi
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+
+ # Check the connctivity
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # Make a background TCP traffic from the non-alias address
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ cnt=0
+ while [ $cnt -lt $NS_TIMES ]; do
+ # Add the route
+ case $test_type in
+ 1)
+ route add -net $ADDDEL_ROUTE netmask $IPV4_NETMASK dev $lhost_ifname
+ ;;
+ 2)
+ ip route add ${ADDDEL_ROUTE}/${IPV4_NETMASK_NUM} dev $lhost_ifname
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to add the route to ${ADDDEL_ROUTE}"
+ return 1
+ fi
+
+ # Check the connectivity
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "The route is broken at ${cnt} time"
+ return 1
+ fi
+ fi
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+
+ # Delete the route
+ case $test_type in
+ 1)
+ route del -net $ADDDEL_ROUTE netmask $IPV4_NETMASK dev $lhost_ifname
+ ;;
+ 2)
+ ip route del ${ADDDEL_ROUTE}/${IPV4_NETMASK_NUM} dev $lhost_ifname
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Cannot delte the route to ${ADDDEL_ROUTE}"
+ return 1
+ fi
+ done
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+#-----------------------------------------------------------------------
+#
+# Main
+#
+# Exit Value:
+# The number of the failure
+#
+#-----------------------------------------------------------------------
+
+RC=0
+do_setup
+test_body 1 || RC=`expr $RC + 1` # Case of route command
+test_body 2 || RC=`expr $RC + 1` # Case of ip command
+do_cleanup
+
+exit $RC
diff --git a/testcases/network/stress/interface/if-route-addlarge b/testcases/network/stress/interface/if-route-addlarge
new file mode 100644
index 0000000..f78a6d6
--- /dev/null
+++ b/testcases/network/stress/interface/if-route-addlarge
@@ -0,0 +1,292 @@
+#!/bin/sh
+
+################################################################################
+## ##
+## Copyright (c) International Business Machines Corp., 2005 ##
+## ##
+## This program is free software; you can redistribute it and#or modify ##
+## it under the terms of the GNU General Public License as published by ##
+## the Free Software Foundation; either version 2 of the License, or ##
+## (at your option) any later version. ##
+## ##
+## This program is distributed in the hope that it will be useful, but ##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
+## for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program; if not, write to the Free Software ##
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
+## ##
+## ##
+################################################################################
+#
+# File:
+# if4-route-addlarge
+#
+# Description:
+# Verify the IPv4 connectivity is not broken with adding a large
+# number of IPv4 routes
+# test01 - by route command
+# test02 - by ip command
+#
+# Setup:
+# See ltp-yyyymmdd/testcases/network/stress/README
+#
+# Author:
+# Mitsuru Chinen <mitch@jp.ibm.com>
+#
+# History:
+# Oct 19 2005 - Created (Mitsuru Chinen)
+#
+#-----------------------------------------------------------------------
+# Uncomment line below for debug output.
+#trace_logic=${trace_logic:-"set -x"}
+$trace_logic
+
+# Make sure the value of LTPROOT
+LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
+export LTPROOT
+
+# Total number of the test case
+TST_TOTAL=2
+export TST_TOTAL
+
+# Default of the test case ID and the test case count
+TCID=if4-route-addlarge
+TST_COUNT=0
+export TCID
+export TST_COUNT
+
+# Check the environmanet variable
+. check_envval || exit $TST_TOTAL
+
+# The number of the add/delete IPv4 alias
+ROUTE_TOTAL=${ROUTE_TOTAL:-10000}
+
+# The interval of the check interface activity
+CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $ROUTE_TOTAL \/ 100`}
+
+# The number of the test link where tests run
+LINK_NUM=0
+
+# Network portion of the IPv4 address
+IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
+
+# Netmask of for the tested network
+IPV4_NETMASK="255.255.255.0"
+IPV4_NETMASK_NUM=24
+
+# Network Address of the tested netwrok
+IPV4_NETWORK_ADDR=${IPV4_NETWORK}.0
+
+# Broadcast address of the tested network
+IPV4_BROADCAST=${IPV4_NETWORK}.255
+
+# Host portion of the IPv4 address
+LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}
+RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_setup
+#
+# DESCRIPTION:
+# Make a IPv4 connectivity
+#
+# SET VALUES:
+# rhost_ipv4addr - IPv4 Address of the remote host
+# lhost_ifname - Interface name of the local host
+# rhost_ifname - Interface name of the remote host
+#
+#-----------------------------------------------------------------------
+do_setup()
+{
+ TCID=if4-route-addlarge
+ TST_COUNT=0
+
+ # Initialize the interfaces of the remote host
+ initialize_if rhost ${LINK_NUM}
+
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Set IPv4 address to the interfaces
+ set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to set an IPv4 address at the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # IPv4 address of the remote host
+ rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+
+ # Get the Interface name of local host
+ lhost_ifname=`get_ifname lhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the local host"
+ exit $TST_TOTAL
+ fi
+
+ # Get the Interface name of remote host
+ rhost_ifname=`get_ifname rhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the remote host"
+ exit $TST_TOTAL
+ fi
+}
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_cleanup
+#
+# DESCRIPTION:
+# Recover the tested interfaces
+#
+#-----------------------------------------------------------------------
+do_cleanup()
+{
+ # Make sure the TCP traffic server/client doesn't run
+ bg_tcp_traffic killall
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+}
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test_body
+#
+# DESCRIPTION:
+# main code of the test
+#
+# Arguments:
+# $1: define the test type
+# 1 - route command case
+# 2 - ip command case
+#
+#-----------------------------------------------------------------------
+test_body()
+{
+ test_type=$1
+
+ TCID=if4-route-addlarge0${test_type}
+ TST_COUNT=${test_type}
+
+ case $test_type in
+ 1)
+ test_command="route"
+ ;;
+ 2)
+ test_command="ip"
+ ;;
+ *)
+ tst_resm TBROK "unspecified case"
+ return 1
+ ;;
+ esac
+
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command adds $ROUTE_TOTAL IPv4 routes"
+
+ # Initialize the interface of the local host
+ initialize_if lhost ${LINK_NUM}
+
+ # Assign IPv4 address to the interface of the local host
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to add IPv4 address at the local host"
+ return 1
+ fi
+ lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+
+ # Check the connctivity
+ ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
+ if [ $ret -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
+ return 1
+ fi
+
+ # Make a background TCP traffic from the non-alias address
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+
+ # Start the loop
+ cnt=0
+ x=0 ; y=1 ; xymax=255
+ while [ $cnt -lt $ROUTE_TOTAL ]; do
+ # Add the route
+ case $test_type in
+ 1)
+ route add -net 10.${x}.${y}.0 netmask 255.255.255.0 dev $lhost_ifname
+ ;;
+ 2)
+ ip route add 10.${x}.${y}.0/24 dev $lhost_ifname
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to add a route at $cnt times"
+ return 1
+ fi
+
+ # Check the connectivity
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "The route is broken at ${cnt} time"
+ return 1
+ fi
+ fi
+ fi
+
+ # Check the background TCP traffic
+ bg_tcp_traffic check $server_pid
+ if [ $? -ne 0 ]; then
+ server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ fi
+
+ # Define the next network address
+ y=`expr $y + 1`
+ if [ $y -gt $xymax ]; then
+ y=0
+ x=`expr $x + 1`
+ if [ $x -gt $xymax ]; then
+ tst_resm INFO "Too large times. Finished $cnt times."
+ break
+ fi
+ fi
+ done
+
+ # Stop the background TCP traffic
+ bg_tcp_traffic killall
+
+ tst_resm TPASS "Test is finished correctly."
+ return 0
+}
+
+
+#-----------------------------------------------------------------------
+#
+# Main
+#
+# Exit Value:
+# The number of the failure
+#
+#-----------------------------------------------------------------------
+
+RC=0
+do_setup
+test_body 1 || RC=`expr $RC + 1` # Case of route command
+test_body 2 || RC=`expr $RC + 1` # Case of ip command
+do_cleanup
+
+exit $RC
diff --git a/testcases/network/stress/interface/if-updown b/testcases/network/stress/interface/if-updown
new file mode 100644
index 0000000..90bffaa
--- /dev/null
+++ b/testcases/network/stress/interface/if-updown
@@ -0,0 +1,258 @@
+#!/bin/sh
+
+################################################################################
+## ##
+## Copyright (c) International Business Machines Corp., 2005 ##
+## ##
+## This program is free software; you can redistribute it and#or modify ##
+## it under the terms of the GNU General Public License as published by ##
+## the Free Software Foundation; either version 2 of the License, or ##
+## (at your option) any later version. ##
+## ##
+## This program is distributed in the hope that it will be useful, but ##
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
+## for more details. ##
+## ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program; if not, write to the Free Software ##
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
+## ##
+## ##
+################################################################################
+#
+# File:
+# if4-updown
+#
+# Description:
+# Verify the IPv4 connectivity isn't broken with upping and downing
+# an interface many times
+# test01 - by ifconfig command
+# test02 - by ip command
+#
+# Setup:
+# See ltp-yyyymmdd/testcases/network/stress/README
+#
+# Author:
+# Mitsuru Chinen <mitch@jp.ibm.com>
+#
+# History:
+# Oct 19 2005 - Created (Mitsuru Chinen)
+#
+#-----------------------------------------------------------------------
+# Uncomment line below for debug output.
+#trace_logic=${trace_logic:-"set -x"}
+$trace_logic
+
+# Make sure the value of LTPROOT
+LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
+export LTPROOT
+
+# Total number of the test case
+TST_TOTAL=2
+export TST_TOTAL
+
+# Default of the test case ID and the test case count
+TCID=if4-updown
+TST_COUNT=0
+export TCID
+export TST_COUNT
+
+# Check the environmanet variable
+. check_envval || exit $TST_TOTAL
+
+# The number of the interface up/down in each test case
+IF_UPDOWN_TIMES=${IF_UPDOWN_TIMES:-10000}
+
+# The interval of the check interface activity
+CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IF_UPDOWN_TIMES \/ 100`}
+
+# The number of the test link where tests run
+LINK_NUM=0
+
+# Network portion of the IPv4 address
+IPV4_NETWORK=${IPV4_NETWORK:-10.0.0}
+
+# Host portion of the IPv4 address
+LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-2} # local host
+RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-1} # remote host
+
+
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_setup
+#
+# DESCRIPTION:
+# Make a IPv4 connectivity
+#
+# SET VALUES:
+# rhost_ipv4addr - IPv4 Address of the remote host
+# lhost_ifname - Interface name of the localhost
+#
+#-----------------------------------------------------------------------
+do_setup()
+{
+ TCID=if4-updown
+ TST_COUNT=0
+
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+
+ # Set IPv4 address to the interfaces
+ set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to set an IPv4 address at the local host"
+ exit $TST_TOTAL
+ fi
+ set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to set an IPv4 address at the remote host"
+ exit $TST_TOTAL
+ fi
+
+ # IPv4 address of the remote host
+ rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+
+ # Get the Interface name of local host
+ lhost_ifname=`get_ifname lhost ${LINK_NUM}`
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Failed to get the interface name at the local host"
+ exit $TST_TOTAL
+ fi
+}
+
+#-----------------------------------------------------------------------
+#
+# NAME:
+# do_cleanup
+#
+# DESCRIPTION:
+# Recover the tested interfaces
+#
+#-----------------------------------------------------------------------
+do_cleanup()
+{
+ # Initialize the interfaces
+ initialize_if lhost ${LINK_NUM}
+ initialize_if rhost ${LINK_NUM}
+}
+
+
+#-----------------------------------------------------------------------
+#
+# FUNCTION:
+# test_body
+#
+# DESCRIPTION:
+# main code of the test
+#
+# Arguments:
+# $1: define the test type
+# 1 - ifconfig command case
+# 2 - ip command case
+#
+#-----------------------------------------------------------------------
+test_body()
+{
+ test_type=$1
+
+ TCID=if4-updown0$test_type
+ TST_COUNT=$test_type
+
+ case $test_type in
+ 1)
+ test_command="ifconfig"
+ ;;
+ 2)
+ test_command="ip"
+ ;;
+ *)
+ tst_resm TBROK "unspecified case"
+ return 1
+ ;;
+ esac
+
+ tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command ups, then downs an interface $IF_UPDOWN_TIMES times"
+
+ # Check the connctivity
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TBROK "Test Link $LINK_NUM is something wrong."
+ return 1
+ fi
+
+ # Start the loop
+ cnt=0
+ while [ $cnt -lt $IF_UPDOWN_TIMES ]; do
+ # Down
+ case $test_type in
+ 1)
+ ifconfig $lhost_ifname down
+ ;;
+ 2)
+ ip link set $lhost_ifname down
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to down $lhost_ifname"
+ return 1
+ fi
+
+ # Up
+ case $test_type in
+ 1)
+ ifconfig $lhost_ifname up
+ ;;
+ 2)
+ ip link set $lhost_ifname up
+ ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to up $lhost_ifname"
+ return 1
+ fi
+
+ # Check the connectivity every CHECK_INTERVAL time
+ cnt=`expr $cnt + 1`
+ if [ $CHECK_INTERVAL -ne 0 ]; then
+ if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "$lhost_ifname is broken at ${cnt} time"
+ return 1
+ fi
+ fi
+ fi
+ done
+
+ # Check the connectivity again
+ check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "$lhost_ifname is broken."
+ return 1
+ fi
+ tst_resm TPASS "Test is finished successfully."
+
+ return 0
+}
+
+
+#-----------------------------------------------------------------------
+#
+# Main
+#
+# Exit Value:
+# The number of the failure
+#
+#-----------------------------------------------------------------------
+
+RC=0
+do_setup
+test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
+test_body 2 || RC=`expr $RC + 1` # Case of ip command
+do_cleanup
+
+exit $RC
diff --git a/testcases/network/stress/interface/if4-alias-adddel b/testcases/network/stress/interface/if4-alias-adddel
deleted file mode 100644
index 4e6e4d6..0000000
--- a/testcases/network/stress/interface/if4-alias-adddel
+++ /dev/null
@@ -1,326 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if4-alias-adddel
-#
-# Description:
-# Verify the IPv4 connectivity isn't broken with adding and deleting an
-# IPv4 alias many times
-# test01 - by `ifconfig add' style
-# test02 - by `ifconfig ethn:n' style
-# test03 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=3
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-alias-adddel
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv4 alias
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address of the remote host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
-# Host portion of the non-alias
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"254"}
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-alias-adddel
- TST_COUNT=0
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Configure the interface at the remote host
- initialize_if rhost ${LINK_NUM}
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - `ifconfig add' style
-# 2 - `ifconfig ethn:n' style
-# 3 - ip command
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if4-alias-adddel0${test_type}
- TST_COUNT=$test_type
-
- case $test_type in
- 1) # Case of ifconfig add
- command_style="'ifconfig add'"
- ;;
- 2) # Case of ifconfig ethn:n
- command_style="'ifconfig ethn:n'"
- ;;
- 3) # Case of ip command
- command_style="ip command"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when $command_style adds, then deletes an IPv4 alias $NS_TIMES times"
-
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the local host"
- return 1
- fi
-
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to assign an IPv4 address to the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # IPv4 alias address of the localhost
- lhost_ipv4_alias_ip=${IPV4_NETWORK}.${test_type}${test_type}
-
- # The interface alias of local host
- case $test_type in
- 1) # Case of ifconfig add
- lhost_ifalias=${lhost_ifname}:0
- ;;
- 2) # Case of ifconfig ethn:n
- lhost_ifalias=${lhost_ifname}:1
- ;;
- # interface alias doesn't exist at ip command case.
- esac
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- while [ $cnt -lt $NS_TIMES ]; do
- # Create
- case $test_type in
- 1) # Case of ifconfig add
- ifconfig $lhost_ifname add ${lhost_ipv4_alias_ip} netmask ${IPV4_NETMASK} broadcast ${IPV4_BROADCAST}
- ;;
- 2) # Case of ifconfig ethn:n
- ifconfig $lhost_ifalias ${lhost_ipv4_alias_ip} netmask ${IPV4_NETMASK} broadcast ${IPV4_BROADCAST}
- ;;
- 3) # Case of ip command
- ip addr add ${lhost_ipv4_alias_ip}/${IPV4_NETMASK_NUM} broadcast ${IPV4_BROADCAST} dev ${lhost_ifname}
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add ${lhost_ipv4_alias_ip}".
- return 1
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- if [ $test_type -ne 3 ]; then
- # Case of ifconfig add / ifconfig ethn:n
- check_icmpv4_connectivity $lhost_ifalias $rhost_ipv4addr
- else
- # Case of ip command
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- fi
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- # Delete
- case $test_type in
- 1) # Case of ifconfig add
- ifconfig $lhost_ifalias del ${lhost_ipv4_alias_ip}
- ;;
- 2) # Case of ifconfig ethn:n
- ifconfig ${lhost_ifalias} down
- ;;
- 3) # Case of ip command
- ip addr del ${lhost_ipv4_alias_ip}/${IPV4_NETMASK_NUM} broadcast ${IPV4_BROADCAST} dev ${lhost_ifname}
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to delete ${lhost_ipv4_alias_ip}".
- return 1
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig add
-test_body 2 || RC=`expr $RC + 1` # Case of ifconfig ethn:n
-test_body 3 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if4-alias-addlarge b/testcases/network/stress/interface/if4-alias-addlarge
deleted file mode 100644
index 13efe84..0000000
--- a/testcases/network/stress/interface/if4-alias-addlarge
+++ /dev/null
@@ -1,481 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if4-alias-addlarge
-#
-# Description:
-# Verify the IPv4 connectivity isn't broken with creating a large number
-# of IPv4-aliases
-# test01 - by `ifconfig add' style
-# test02 - by `ifconfig ethn:n' style
-# test03 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=3
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-alias-addlarge
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add IPv4 alias
-IP_TOTAL=${IP_TOTAL:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IP_TOTAL \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.0.0.0"
-IPV4_NETMASK_NUM=8
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255.255.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"0.0.2"}
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"0.0.1"}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the local host
-# rhost_ipv4addr - IP address of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-alias-addlarge
- TST_COUNT=0
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interface at the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Set IPv4 address to the interface at the remote host
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface names
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test01
-#
-# DESCRIPTION:
-# Creating a large number of IPv4-aliases by `ifconfig add'
-#
-#-----------------------------------------------------------------------
-test01()
-{
- TCID=if4-alias-addlarge01
- TST_COUNT=1
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when 'ifconifg add' creates $IP_TOTAL IPv4-aliases."
-
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
-
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add IPv4 address to the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Set up for the loop
- # Note: 2 colon aliases are added by `ifconfig ethn:x:y'
- # `ifconfig ethn:x:y:... add ' runs 4 times per a pair of x,y
- cnt=0
- x=1 ; y=1 ; xymax=99
- a=1 ; amax=3
- ifalias="${lhost_ifname}:${x}:${y}"
- ifconfig $ifalias ${IPV4_NETWORK}.${x}.${y}.${a} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- while [ $cnt -lt $IP_TOTAL ]; do
- if [ $a -gt $amax ]; then
- a=1
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=1
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
- break
- fi
- fi
- ifalias="${lhost_ifname}:${x}:${y}"
- ifconfig $ifalias ${IPV4_NETWORK}.${x}.${y}.${a} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
- fi
-
- # Create
- a=`expr $a + 1`
- ifconfig $ifalias add ${IPV4_NETWORK}.${x}.${y}.${a} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
- if [ $? -ne 0 ]; then
- tst_resm TINFO "It seems $cnt is limit."
- break
- fi
- ifalias="${ifalias}:0"
-
- # Check
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % $CHECK_INTERVAL` -eq 0 ]; then
- # Check the connectivity from the remote host to
- # the local host alias.
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.${x}.${y}.${a}' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Check the connecitivy from the interface (non-alias)
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test02
-#
-# DESCRIPTION:
-# Creating a large number of IPv4-aliases by `ifconfig ethn:n'
-#
-#-----------------------------------------------------------------------
-test02()
-{
- TCID=if4-alias-addlarge02
- TST_COUNT=2
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when 'ifconfig ethn:n' creates $IP_TOTAL IPv4-aliases'"
-
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
-
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- x=1 ; y=1 ; xymax=254
- while [ $cnt -lt $IP_TOTAL ]; do
- # Create
- ifalias="${lhost_ifname}:${x}:${y}"
- ifconfig $ifalias ${IPV4_NETWORK}.0.${x}.${y} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
- if [ $? -ne 0 ]; then
- tst_resm TINFO "It seems $cnt is limit."
- break
- fi
-
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- # Check the connectivity from the remote host to
- # the local host alias.
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.0.${x}.${y}'; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- # Define next IP and alias
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=1
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
- break
- fi
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Check the connecitivy from the interface (non-alias)
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test03
-#
-# DESCRIPTION:
-# Creating a large number of IPv4-aliases by ip command
-#
-#-----------------------------------------------------------------------
-test03()
-{
- TCID=if4-alias-addlarge03
- TST_COUNT=3
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when ip command creates $IP_TOTAL IPv4-aliases"
-
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
-
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- x=1 ; y=1 ; xymax=254
- while [ $cnt -lt $IP_TOTAL ]; do
- # Create
- ip addr add ${IPV4_NETWORK}.1.${x}.${y}/${IPV4_NETMASK_NUM} \
- broadcast $IPV4_BROADCAST dev ${lhost_ifname}
- if [ $? -ne 0 ]; then
- tst_resm TINFO "It seems $cnt is limit."
- break
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- # Check the connectivity from the remote host to
- # the local host alias.
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.1.${x}.${y}' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- # Define next IP and alias
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=1
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
- break
- fi
- fi
- done
-
- # Check the connecitivy from the interface (non-alias)
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test01 || RC=`expr $RC + 1`
-test02 || RC=`expr $RC + 1`
-test03 || RC=`expr $RC + 1`
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if4-mtu-change b/testcases/network/stress/interface/if4-mtu-change
deleted file mode 100644
index f272ebd..0000000
--- a/testcases/network/stress/interface/if4-mtu-change
+++ /dev/null
@@ -1,264 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if4-mtu-change
-#
-# Description:
-# Verify the IPv4 connectivity isn't broken with changing MTU many times
-# test01 - by ifconfig command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-mtu-change
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable for the test
-. check_envval || exit $TST_TOTAL
-
-# The number of the change of the MTU
-MTU_CHANGE_TIMES=${MTU_CHANGE_TIMES:-1000}
-
-# The interval of the change [second]
-CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
-
-# The array of the value which MTU is changed into sequentially
-CHANGE_VALUES="784 1142 426 1500 68 1500 68 748 68 1142 1500"
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"} # local host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"} # remote host
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# lhost_ipv4addr - IPv4 Address of the local host
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-mtu-change
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv4 address to the interfaces
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the local host"
- exit $TST_TOTAL
- fi
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the local and remote host
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-}
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if4-mtu-change0${test_type}
- TST_COUNT=${test_type}
-
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when $test_command command changes MTU $MTU_CHANGE_TIMES times every $CHANGE_INTERVAL seconds"
-
- # Check the connctivity
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- mtu_array_len=`echo $CHANGE_VALUES | wc -w`
- cnt=0
- while [ $cnt -lt $MTU_CHANGE_TIMES ]; do
- # Wait CHANGE_INTERVAL seconds
- sleep $CHANGE_INTERVAL
-
- # Change
- nth=`expr $cnt % $mtu_array_len`
- field=`expr $nth + 1`
- mtu=`echo $CHANGE_VALUES | cut -d ' ' -f $field`
-
- case $test_type in
- 1)
- ifconfig $lhost_ifname mtu $mtu
- ;;
- 2)
- ip link set $lhost_ifname mtu $mtu
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to change the mtu at $cnt time"
- return 1
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- cnt=`expr $cnt + 1`
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Check the connectivity again
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if4-route-adddel b/testcases/network/stress/interface/if4-route-adddel
deleted file mode 100644
index 8adf24f..0000000
--- a/testcases/network/stress/interface/if4-route-adddel
+++ /dev/null
@@ -1,293 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if4-route-adddel
-#
-# Description:
-# Verify the IPv4 connectivity is not broken with adding and deleting
-# an IPv4 route many times
-# test01 - by route command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-route-adddel
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv4 alias
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
-# The destination network to add and delete
-ADDDEL_ROUTE="10.10.10.0"
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-route-adddel
- TST_COUNT=0
-
- # Initialize the interfaces of the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv4 address to the interfaces
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv4 address the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - route command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if4-route-adddel0${test_type}
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="route"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command adds, then and deletes an IPv4 route $NS_TIMES times"
-
- # Initialize the interface of the local host
- initialize_if lhost ${LINK_NUM}
-
- # Assign IPv4 address to the interface of the local host
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to assign an IPv4 address at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- while [ $cnt -lt $NS_TIMES ]; do
- # Add the route
- case $test_type in
- 1)
- route add -net $ADDDEL_ROUTE netmask $IPV4_NETMASK dev $lhost_ifname
- ;;
- 2)
- ip route add ${ADDDEL_ROUTE}/${IPV4_NETMASK_NUM} dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add the route to ${ADDDEL_ROUTE}"
- return 1
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The route is broken at ${cnt} time"
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- # Delete the route
- case $test_type in
- 1)
- route del -net $ADDDEL_ROUTE netmask $IPV4_NETMASK dev $lhost_ifname
- ;;
- 2)
- ip route del ${ADDDEL_ROUTE}/${IPV4_NETMASK_NUM} dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Cannot delte the route to ${ADDDEL_ROUTE}"
- return 1
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of route command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if4-route-addlarge b/testcases/network/stress/interface/if4-route-addlarge
deleted file mode 100644
index f78a6d6..0000000
--- a/testcases/network/stress/interface/if4-route-addlarge
+++ /dev/null
@@ -1,292 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if4-route-addlarge
-#
-# Description:
-# Verify the IPv4 connectivity is not broken with adding a large
-# number of IPv4 routes
-# test01 - by route command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-route-addlarge
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv4 alias
-ROUTE_TOTAL=${ROUTE_TOTAL:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $ROUTE_TOTAL \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Network Address of the tested netwrok
-IPV4_NETWORK_ADDR=${IPV4_NETWORK}.0
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-route-addlarge
- TST_COUNT=0
-
- # Initialize the interfaces of the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv4 address to the interfaces
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - route command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if4-route-addlarge0${test_type}
- TST_COUNT=${test_type}
-
- case $test_type in
- 1)
- test_command="route"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command adds $ROUTE_TOTAL IPv4 routes"
-
- # Initialize the interface of the local host
- initialize_if lhost ${LINK_NUM}
-
- # Assign IPv4 address to the interface of the local host
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add IPv4 address at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- x=0 ; y=1 ; xymax=255
- while [ $cnt -lt $ROUTE_TOTAL ]; do
- # Add the route
- case $test_type in
- 1)
- route add -net 10.${x}.${y}.0 netmask 255.255.255.0 dev $lhost_ifname
- ;;
- 2)
- ip route add 10.${x}.${y}.0/24 dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add a route at $cnt times"
- return 1
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The route is broken at ${cnt} time"
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- # Define the next network address
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=0
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm INFO "Too large times. Finished $cnt times."
- break
- fi
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of route command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if4-updown b/testcases/network/stress/interface/if4-updown
deleted file mode 100644
index 90bffaa..0000000
--- a/testcases/network/stress/interface/if4-updown
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if4-updown
-#
-# Description:
-# Verify the IPv4 connectivity isn't broken with upping and downing
-# an interface many times
-# test01 - by ifconfig command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-updown
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the interface up/down in each test case
-IF_UPDOWN_TIMES=${IF_UPDOWN_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IF_UPDOWN_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-10.0.0}
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-2} # local host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-1} # remote host
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-updown
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Set IPv4 address to the interfaces
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the local host"
- exit $TST_TOTAL
- fi
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-}
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if4-updown0$test_type
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command ups, then downs an interface $IF_UPDOWN_TIMES times"
-
- # Check the connctivity
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is something wrong."
- return 1
- fi
-
- # Start the loop
- cnt=0
- while [ $cnt -lt $IF_UPDOWN_TIMES ]; do
- # Down
- case $test_type in
- 1)
- ifconfig $lhost_ifname down
- ;;
- 2)
- ip link set $lhost_ifname down
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to down $lhost_ifname"
- return 1
- fi
-
- # Up
- case $test_type in
- 1)
- ifconfig $lhost_ifname up
- ;;
- 2)
- ip link set $lhost_ifname up
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to up $lhost_ifname"
- return 1
- fi
-
- # Check the connectivity every CHECK_INTERVAL time
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken at ${cnt} time"
- return 1
- fi
- fi
- fi
- done
-
- # Check the connectivity again
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- tst_resm TPASS "Test is finished successfully."
-
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 2/11] network/stress/interface/docs: cleanup
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 3/11] runtest/network_stress.interface: fix test names Alexey Kodanev
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
.../network/stress/interface/00_Descriptions.txt | 129 +++-----------------
1 files changed, 16 insertions(+), 113 deletions(-)
diff --git a/testcases/network/stress/interface/00_Descriptions.txt b/testcases/network/stress/interface/00_Descriptions.txt
index abf1765..2c67aca 100644
--- a/testcases/network/stress/interface/00_Descriptions.txt
+++ b/testcases/network/stress/interface/00_Descriptions.txt
@@ -1,120 +1,23 @@
-if4-updown01
- Verify the IPv4 connectivity is not broken when ifconfig command ups,
- then downs an interface many times
+if-updown
+ Verify the IPv4/IPv6 connectivity is not broken when ip/ifconfig
+ command ups, then downs an interface many times
-if4-updown02
- Verify the IPv4 connectivity is not broken when ip command ups, then
- downs an interface many times
+if4-addr-change
+ Verify the IPv4 connectivity is not broken when ip/ifconfig
+ command changes address many times
-
-if4-addr-change01
- Verify the IPv4 connectivity is not broken when the ifconfig command
- changes the IPv4 address many times
-
-
-if4-alias-adddel01
- Verify the IPv4 connectivity is not broken when 'ifconfig add' adds,
- then deletes an IPv4 alias many times
-
-if4-alias-adddel02
- Verify the IPv4 connectivity is not broken when 'ifconfig ethn:n' adds,
+if-addr-adddel
+ Verify the IPv4/IPv6 connectivity is not broken when ip/ifconfig adds,
then deletes an IPv4 alias many times
-if4-alias-adddel03
- Verify the IPv4 connectivity is not broken when ip command adds, then
- deletes an IPv4 alias many times
-
-
-if4-alias-addlarge01
- Verify the IPv4 connectivity is not broken when 'ifconifg add' creates
- many IPv4-aliases.
-
-if4-alias-addlarge02
- Verify the IPv4 connectivity is not broken when 'ifconfig ethn:n'
- creates many IPv4-aliases'
-
-if4-alias-addlarge03
- Verify the IPv4 connectivity is not broken when ip command creates
- many IPv4-aliases
-
-
-if4-route-adddel01
- Verify the IPv4 connectivity is not broken when the route command adds,
- then and deletes an IPv4 route many times
-
-if4-route-adddel02
- Verify the IPv4 connectivity is not broken when the ip command adds,
- then and deletes an IPv4 route many times
-
-
-if4-route-addlarge01
- Verify the IPv4 connectivity is not broken when the route command
- adds many IPv4 routes
-
-if4-route-addlarge02
- Verify the IPv4 connectivity is not broken when the ip command adds
- many IPv4 routes
-
-
-if4-mtu-change01
- Verify the IPv4 connectivity is not broken when ifconfig command
- changes MTU many times every 5 seconds
-
-if4-mtu-change02
- Verify the IPv4 connectivity is not broken when ip command changes
- MTU many times every 5 seconds
-
-
-
-if6-updown01
- Verify the IPv6 connectivity is not broken when the ifconfig command
- ups, then downs an interface many times
-
-if6-updown02
- Verify the IPv6 connectivity is not broken when the ip command ups,
- then downs an interface many times
-
-
-if6-addr-adddel01
- Verify the IPv6 connectivty is not broken when the ifconfig command
- adds, then deletes an IPv6 address many times
-
-if6-addr-adddel02
- Verify the IPv6 connectivty is not broken when the ip command adds,
- then deletes an IPv6 address many times
-
+if-addr-addlarge
+ Verify the IPv4/IPv6 connectivity is not broken when ip/ifconifg
+ creates many addresses.
-if6-addr-addlarge01
- Verify the IPv6 connectivity is not broken when the ifconfig command
- adds many IPv6 addresses
+if-route-adddel
+ Verify the IPv4/IPv6 connectivity is not broken when the ip/route adds,
+ then and deletes an IPv4/IPv6 route many times
-if6-addr-addlarge02
- Verify the IPv6 connectivity is not broken when the ip command adds
- many IPv6 addresses
-
-
-if6-route-adddel01
- Verify the IPv6 connectivity is not broken when the route command adds,
- then deletes an IPv6 route many times
-
-if6-route-adddel02
- Verify the IPv6 connectivity is not broken when the ip command adds,
- then deletes an IPv6 route many times
-
-
-f6-route-addlarge01
- Verify the IPv6 connectivity is not broken when the route command adds
- many IPv6 routes
-
-if6-route-addlarge02
- Verify the IPv6 connectivity is not broken when the ip command adds
- many IPv6 routes
-
-
-if6-mtu-change01
- Verify the IPv6 connectivity is not broken when the ifconfig command
+if-mtu-change
+ Verify the IPv4/IPv6 connectivity is not broken when ip/ifconfig
changes MTU many times every 5 seconds
-
-if6-mtu-change02
- Verify the IPv6 connectivity is not broken when the ip command changes
- MTU many times every 5 seconds
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 3/11] runtest/network_stress.interface: fix test names
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 2/11] network/stress/interface/docs: cleanup Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 4/11] network/stress/interface/ip4-addr-change: apply test_net.sh library Alexey Kodanev
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
runtest/network_stress.interface | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/runtest/network_stress.interface b/runtest/network_stress.interface
index 43d5850..97e9ce3 100644
--- a/runtest/network_stress.interface
+++ b/runtest/network_stress.interface
@@ -2,17 +2,18 @@
# Stress test for interface
#
-if4-updown if4-updown
if4-addr-change if4-addr-change
-if4-alias-adddel if4-alias-adddel
-if4-alias-addlarge if4-alias-addlarge
-if4-route-adddel if4-route-adddel
-if4-route-addlarge if4-route-addlarge
-if4-mtu-change if4-mtu-change
-if6-updown if6-updown
-if6-addr-adddel if6-addr-adddel
-if6-addr-addlarge if6-addr-addlarge
-if6-route-adddel if6-route-adddel
-if6-route-addlarge if6-route-addlarge
-if6-mtu-change if6-mtu-change
+if4-updown if-updown
+if4-addr-adddel if-addr-adddel
+if4-addr-addlarge if-addr-addlarge
+if4-route-adddel if-route-adddel
+if4-route-addlarge if-route-addlarge
+if4-mtu-change if-mtu-change
+
+if6-updown if-updown -6
+if6-addr-adddel if-addr-adddel -6
+if6-addr-addlarge if-addr-addlarge -6
+if6-route-adddel if-route-adddel -6
+if6-route-addlarge if-route-addlarge -6
+if6-mtu-change if-mtu-change -6
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 4/11] network/stress/interface/ip4-addr-change: apply test_net.sh library
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 2/11] network/stress/interface/docs: cleanup Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 3/11] runtest/network_stress.interface: fix test names Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 5/11] network/stress/interface: add local library Alexey Kodanev
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
* skip rhost address
* cleanup
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if4-addr-change | 262 +++++---------------
1 files changed, 56 insertions(+), 206 deletions(-)
diff --git a/testcases/network/stress/interface/if4-addr-change b/testcases/network/stress/interface/if4-addr-change
index e066d62..813e760 100644
--- a/testcases/network/stress/interface/if4-addr-change
+++ b/testcases/network/stress/interface/if4-addr-change
@@ -1,237 +1,87 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-addr-change
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity isn't broken with changing IPv4 address
-# many times
-# test01 - by ifconfig command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Author:
# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-# Total number of the test case
TST_TOTAL=1
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
TCID=if4-addr-change
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
+TST_CLEANUP="cleanup"
-# The total number of changing of IPv4 address
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
+. test_net.sh
# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address on the remote host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
-# Minumum host portion of the IPv4 address on the local host
-LHOST_IPV4_HOST_MIN=${LHOST_IPV4_HOST:-"2"}
-
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($NS_TIMES / 100))}
# Maximum host portion of the IPv4 address on the local host
LHOST_IPV4_HOST_MAX="254"
+trap "tst_brkm TBROK 'test interrupted'" INT
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity on the Test Link
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
+cleanup()
{
- TCID=if4-addr-change
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Set IPv4 address to the interfaces
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST_MIN}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the local host"
- exit $TST_TOTAL
- fi
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
+ tst_restore_ipaddr
}
+test01()
+{
+ tst_resm TINFO "ifconfig changes IPv4 address $NS_TIMES times"
+
+ tst_restore_ipaddr
+ check_icmpv4_connectivity $(tst_iface) $(tst_ipaddr rhost) || \
+ tst_brkm TBROK "Failed to ping to $(tst_ipaddr rhost)"
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
+ local cnt=0
+ num=1
+ while [ $cnt -lt $NS_TIMES ]; do
+ # Define the network portion
+ num=$(($num + 1))
+ [ $num -gt $LHOST_IPV4_HOST_MAX ] && num=1
+ [ $num -eq $RHOST_IPV4_HOST ] && continue
+ # Change the IPv4 address
+ lhost_ipv4addr="${IPV4_NETWORK}.${num}"
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test01
-#
-# DESCRIPTION:
-# ifconfig case
-#
-#-----------------------------------------------------------------------
-test01()
-{
- TCID=if4-addr-change01
- TST_COUNT=1
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the ifconfig command changes the IPv4 address $NS_TIMES times"
-
- # Check the connctivity
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is something wrong."
- return 1
- fi
-
- # Start the loop
- cnt=0
- current_lhost_ipv4_host=$LHOST_IPV4_HOST_MIN
- while [ $cnt -lt $NS_TIMES ]; do
- # Define the network portion
- current_lhost_ipv4_host=`expr $current_lhost_ipv4_host + 1`
- if [ $current_lhost_ipv4_host -gt $LHOST_IPV4_HOST_MAX ]; then
- current_lhost_ipv4_host=$LHOST_IPV4_HOST_MIN
- fi
-
- # Change the IPv4 address
- lhost_ipv4addr="${IPV4_NETWORK}.${current_lhost_ipv4_host}"
- ifconfig $lhost_ifname $lhost_ipv4addr netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
- if [ $? -ne 0 ]; then
- test_resm TFAIL "Failed to change IPv4 address into ${lhost_ipv4addr}"
- return 1
- fi
-
- # Check the connecitivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken at around ${cnt} times"
- return 1
- fi
- fi
- fi
- done
-
- # Check the connectivity again.
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$errmsg $lhost_ifname is broken."
- return 1
- fi
-
- tst_resm TPASS "Test is finished successfully."
- return 0
-}
+ ifconfig $(tst_iface) $lhost_ipv4addr netmask 255.255.255.0 \
+ broadcast 255.255.255.255 || \
+ tst_brkm TFAIL "Failed to change into ${lhost_ipv4addr}"
+ cnt=$(($cnt + 1))
+ [ $CHECK_INTERVAL -eq 0 ] && continue
+ [ $(($cnt % $CHECK_INTERVAL)) -ne 0 ] && continue
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
+ tst_resm TINFO "ping from $lhost_ipv4addr to $(tst_ipaddr rhost)"
+ check_icmpv4_connectivity $(tst_iface) $(tst_ipaddr rhost) || \
+ tst_brkm TFAIL "$(tst_iface) is broken at around ${cnt} times"
+ done
+
+ tst_resm TINFO "ping from $lhost_ipv4addr to $(tst_ipaddr rhost)"
+ check_icmpv4_connectivity $(tst_iface) $(tst_ipaddr rhost) || \
+ tst_brkm TFAIL "$(tst_iface) is broken"
+
+ tst_resm TPASS "Test is finished successfully"
+}
+
+tst_check_cmds ifconfig
-RC=0
-do_setup
-test01 || RC=`expr $RC + 1`
-do_cleanup
+test01
-exit $RC
+tst_exit
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 5/11] network/stress/interface: add local library
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (2 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 4/11] network/stress/interface/ip4-addr-change: apply test_net.sh library Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 6/11] testscripts/network.sh: add IPV4_NET16_UNUSED, IPV6_NET32_UNUSED Alexey Kodanev
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
It provides the following functions:
* basic setup and cleanup
* making TCP background traffic
* checking connectivity between test hosts
Moreover it defines new IPV4_NET16_UNUSED and IPV6_NET32_UNUSED
variables. They are needed because some of the interface tests
add more then 254 new addresses to interface which could overlap
with existed ones on test network.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if-lib.sh | 64 ++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
create mode 100644 testcases/network/stress/interface/if-lib.sh
diff --git a/testcases/network/stress/interface/if-lib.sh b/testcases/network/stress/interface/if-lib.sh
new file mode 100644
index 0000000..fde6310
--- /dev/null
+++ b/testcases/network/stress/interface/if-lib.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+
+TST_CLEANUP="cleanup"
+
+. test_net.sh
+
+ipver=${TST_IPV6:-4}
+
+IPV4_NET16_UNUSED=${IPV4_NET16_UNUSED:-"10.23"}
+IPV6_NET32_UNUSED=${IPV6_NET32_UNUSED:-"fd00:23"}
+
+setup()
+{
+ tst_require_root
+ tst_check_cmds ip pgrep pkill
+ trap "tst_brkm TBROK 'test interrupted'" INT
+}
+
+cleanup()
+{
+ # Stop the background TCP traffic
+ pkill -13 -x tcp_fastopen
+ tst_rhost_run -c "pkill -13 -x tcp_fastopen"
+ tst_restore_ipaddr
+}
+
+make_background_tcp_traffic()
+{
+ port=$(tst_get_unused_port ipv${ipver} stream)
+ tcp_fastopen -R 3 -g $port > /dev/null 2>&1 &
+ tst_rhost_run -b -c "tcp_fastopen -l -H $(tst_ipaddr) -g $port"
+}
+
+check_connectivity()
+{
+ local cnt=$1
+ [ $CHECK_INTERVAL -eq 0 ] && return
+ [ $(($cnt % $CHECK_INTERVAL)) -ne 0 ] && return
+
+ tst_resm TINFO "check connectivity through $(tst_iface) on step $cnt"
+ check_icmpv${ipver}_connectivity $(tst_iface) $(tst_ipaddr rhost)
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "$(tst_iface) is broken"
+ return 1
+ fi
+ return 0
+}
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 6/11] testscripts/network.sh: add IPV4_NET16_UNUSED, IPV6_NET32_UNUSED
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (3 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 5/11] network/stress/interface: add local library Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 7/11] network/stress/interface: cleanup 'addr' group Alexey Kodanev
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testscripts/network.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/testscripts/network.sh b/testscripts/network.sh
index 01733e9..426e732 100755
--- a/testscripts/network.sh
+++ b/testscripts/network.sh
@@ -49,6 +49,10 @@ export LHOST_IPV6_REV=${LHOST_IPV6_REV:-"2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0"}
# Reverse host portion of the IPv6 address of the remote host
export RHOST_IPV6_REV=${RHOST_IPV6_REV:-"1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0"}
+# Define the networks that aren't reachable through the test links
+IPV4_NET16_UNUSED=${IPV4_NET16_UNUSED:-"10.23"}
+IPV6_NET32_UNUSED=${IPV6_NET32_UNUSED:-"fd00:23"}
+
export HTTP_DOWNLOAD_DIR=${HTTP_DOWNLOAD_DIR:-"/var/www/html"}
export FTP_DOWNLOAD_DIR=${FTP_DOWNLOAD_DIR:-"/var/ftp"}
export FTP_UPLOAD_DIR=${FTP_UPLOAD_DIR:-"/var/ftp/pub"}
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 7/11] network/stress/interface: cleanup 'addr' group
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (4 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 6/11] testscripts/network.sh: add IPV4_NET16_UNUSED, IPV6_NET32_UNUSED Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 8/11] network/stress/interface: cleanup and fix 'mtu' test Alexey Kodanev
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Use if-lib.sh, test_net.sh libraries
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if-addr-adddel | 382 ++++----------
.../network/stress/interface/if-addr-addlarge | 556 ++++----------------
2 files changed, 201 insertions(+), 737 deletions(-)
diff --git a/testcases/network/stress/interface/if-addr-adddel b/testcases/network/stress/interface/if-addr-adddel
index 4e6e4d6..4fd72da 100644
--- a/testcases/network/stress/interface/if-addr-adddel
+++ b/testcases/network/stress/interface/if-addr-adddel
@@ -1,326 +1,124 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-alias-adddel
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity isn't broken with adding and deleting an
-# IPv4 alias many times
-# test01 - by `ifconfig add' style
-# test02 - by `ifconfig ethn:n' style
-# test03 - by ip command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=3
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-alias-adddel
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv4 alias
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address of the remote host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
-# Host portion of the non-alias
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"254"}
+# Author: Mitsuru Chinen <mitch@jp.ibm.com>
+TST_TOTAL=2
+TCID=if-addr-adddel
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-alias-adddel
- TST_COUNT=0
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Configure the interface at the remote host
- initialize_if rhost ${LINK_NUM}
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the remote host"
- exit $TST_TOTAL
- fi
+. if-lib.sh
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
+# The interval of the check interface activity (check ten times)
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($NS_TIMES / 100))}
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
+test_body()
{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
+ local cmd_type=$1
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
+ case $cmd_type in
+ if_cmd) local cmd_name='ifconfig' ;;
+ ip_cmd) local cmd_name='ip' ;;
+ *) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
+ esac
+ local num=$(($(od -A n -d -N 1 /dev/random) * 253 / 255 + 2 ))
+ local iface=$(tst_iface)
+ if [ "$TST_IPV6" ]; then
+ local new_ip=${IPV6_NET32_UNUSED}::$num
+ local netmask=64
+ else
+ local new_ip=${IPV4_NET16_UNUSED}.1.$num
+ local netmask=24
+ fi
+ tst_resm TINFO "'$cmd_name' add/del IPv$ipver '$new_ip' $NS_TIMES times"
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - `ifconfig add' style
-# 2 - `ifconfig ethn:n' style
-# 3 - ip command
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
+ tst_restore_ipaddr || \
+ tst_resm TBROK "Failed to set default IP addresses"
- TCID=if4-alias-adddel0${test_type}
- TST_COUNT=$test_type
+ make_background_tcp_traffic
- case $test_type in
- 1) # Case of ifconfig add
- command_style="'ifconfig add'"
- ;;
- 2) # Case of ifconfig ethn:n
- command_style="'ifconfig ethn:n'"
- ;;
- 3) # Case of ip command
- command_style="ip command"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when $command_style adds, then deletes an IPv4 alias $NS_TIMES times"
+ local cnt=1
+ while [ $cnt -le $NS_TIMES ]; do
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the local host"
- return 1
- fi
+ case $cmd_type in
+ if_cmd)
+ if [ "$TST_IPV6" ]; then
+ ifconfig $iface add $new_ip/$netmask
+ else
+ ifconfig $iface:1 $new_ip netmask 255.255.255.0
+ fi
+ ;;
+ ip_cmd) ip addr add $new_ip/$netmask dev $iface ;;
+ esac
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to assign an IPv4 address to the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "command failed to add $new_ip to $iface"
+ return
+ fi
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
+ ip addr show $iface | grep -q $new_ip
+ if [ $? -ne 0 ]; then
+ ip addr show $iface
+ tst_resm TFAIL "$new_ip not configured"
+ return
+ fi
- # IPv4 alias address of the localhost
- lhost_ipv4_alias_ip=${IPV4_NETWORK}.${test_type}${test_type}
+ check_connectivity $cnt || return
- # The interface alias of local host
- case $test_type in
- 1) # Case of ifconfig add
- lhost_ifalias=${lhost_ifname}:0
- ;;
- 2) # Case of ifconfig ethn:n
- lhost_ifalias=${lhost_ifname}:1
- ;;
- # interface alias doesn't exist at ip command case.
- esac
+ cnt=$(($cnt + 1))
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ # Check the background TCP traffic
+ pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
- # Start the loop
- cnt=0
- while [ $cnt -lt $NS_TIMES ]; do
- # Create
- case $test_type in
- 1) # Case of ifconfig add
- ifconfig $lhost_ifname add ${lhost_ipv4_alias_ip} netmask ${IPV4_NETMASK} broadcast ${IPV4_BROADCAST}
- ;;
- 2) # Case of ifconfig ethn:n
- ifconfig $lhost_ifalias ${lhost_ipv4_alias_ip} netmask ${IPV4_NETMASK} broadcast ${IPV4_BROADCAST}
- ;;
- 3) # Case of ip command
- ip addr add ${lhost_ipv4_alias_ip}/${IPV4_NETMASK_NUM} broadcast ${IPV4_BROADCAST} dev ${lhost_ifname}
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add ${lhost_ipv4_alias_ip}".
- return 1
- fi
+ case $cmd_type in
+ if_cmd)
+ if [ "$TST_IPV6" ]; then
+ ifconfig $iface del $new_ip/$netmask
+ else
+ ifconfig $iface:1 down
+ fi
+ ;;
+ ip_cmd) ip addr del $new_ip/$netmask dev $iface ;;
+ esac
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- if [ $test_type -ne 3 ]; then
- # Case of ifconfig add / ifconfig ethn:n
- check_icmpv4_connectivity $lhost_ifalias $rhost_ipv4addr
- else
- # Case of ip command
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- fi
if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
+ tst_resm TFAIL " delete command failed".
+ return
fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
- # Delete
- case $test_type in
- 1) # Case of ifconfig add
- ifconfig $lhost_ifalias del ${lhost_ipv4_alias_ip}
- ;;
- 2) # Case of ifconfig ethn:n
- ifconfig ${lhost_ifalias} down
- ;;
- 3) # Case of ip command
- ip addr del ${lhost_ipv4_alias_ip}/${IPV4_NETMASK_NUM} broadcast ${IPV4_BROADCAST} dev ${lhost_ifname}
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to delete ${lhost_ipv4_alias_ip}".
- return 1
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
+ ip addr show $iface | grep -q $new_ip
+ if [ $? -eq 0 ]; then
+ ip addr show $iface
+ tst_resm TFAIL "Failed to remove '$new_ip' address"
+ return
+ fi
+ done
- tst_resm TPASS "Test is finished correctly."
- return 0
+ tst_resm TPASS "Test is finished correctly"
}
+setup
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
+tst_check_cmds ifconfig
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig add
-test_body 2 || RC=`expr $RC + 1` # Case of ifconfig ethn:n
-test_body 3 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
+test_body 'if_cmd'
+test_body 'ip_cmd'
-exit $RC
+tst_exit
diff --git a/testcases/network/stress/interface/if-addr-addlarge b/testcases/network/stress/interface/if-addr-addlarge
index 13efe84..fb41683 100644
--- a/testcases/network/stress/interface/if-addr-addlarge
+++ b/testcases/network/stress/interface/if-addr-addlarge
@@ -1,481 +1,147 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-alias-addlarge
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity isn't broken with creating a large number
-# of IPv4-aliases
-# test01 - by `ifconfig add' style
-# test02 - by `ifconfig ethn:n' style
-# test03 - by ip command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=3
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-alias-addlarge
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add IPv4 alias
-IP_TOTAL=${IP_TOTAL:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IP_TOTAL \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.0.0.0"
-IPV4_NETMASK_NUM=8
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255.255.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"0.0.2"}
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"0.0.1"}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the local host
-# rhost_ipv4addr - IP address of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-alias-addlarge
- TST_COUNT=0
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interface at the remote host
- initialize_if rhost ${LINK_NUM}
+# Author: Mitsuru Chinen <mitch@jp.ibm.com>
- # Set IPv4 address to the interface at the remote host
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface names
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-}
+TST_TOTAL=2
+TCID=if-addr-addlarge
+. if-lib.sh
+# The interval of the check interface activity (check ten times)
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($IP_TOTAL / 100))}
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
+test_body()
{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
+ local cmd_type=$1
+ case $cmd_type in
+ if_cmd) local cmd_name='ifconfig' ;;
+ ip_cmd) local cmd_name='ip' ;;
+ *) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
+ esac
+ local iface=$(tst_iface)
+ [ "$TST_IPV6" ] && local netmask=64 || local netmask=16
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test01
-#
-# DESCRIPTION:
-# Creating a large number of IPv4-aliases by `ifconfig add'
-#
-#-----------------------------------------------------------------------
-test01()
-{
- TCID=if4-alias-addlarge01
- TST_COUNT=1
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when 'ifconifg add' creates $IP_TOTAL IPv4-aliases."
+ tst_resm TINFO "'$cmd_name' add $IP_TOTAL IPv$ipver addresses"
+ tst_resm TINFO "check interval that $iface is working: $CHECK_INTERVAL"
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
+ tst_restore_ipaddr || \
+ tst_resm TBROK "Failed to set default IP addresses"
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add IPv4 address to the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+ make_background_tcp_traffic
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
+ local x=1
+ local y=1
+ local cnt=1
- # Set up for the loop
- # Note: 2 colon aliases are added by `ifconfig ethn:x:y'
- # `ifconfig ethn:x:y:... add ' runs 4 times per a pair of x,y
- cnt=0
- x=1 ; y=1 ; xymax=99
- a=1 ; amax=3
- ifalias="${lhost_ifname}:${x}:${y}"
- ifconfig $ifalias ${IPV4_NETWORK}.${x}.${y}.${a} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
+ [ "$TST_IPV6" ] && local xymax=65535 || xymax=254
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- while [ $cnt -lt $IP_TOTAL ]; do
- if [ $a -gt $amax ]; then
- a=1
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=1
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
- break
- fi
- fi
- ifalias="${lhost_ifname}:${x}:${y}"
- ifconfig $ifalias ${IPV4_NETWORK}.${x}.${y}.${a} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
+ if [ $IP_TOTAL -gt $((xymax * xymax)) ]; then
+ tst_resm TWARN "set IP_TOTAL to $xymax * $xymax"
+ IP_TOTAL=$((xymax * xymax))
fi
- # Create
- a=`expr $a + 1`
- ifconfig $ifalias add ${IPV4_NETWORK}.${x}.${y}.${a} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
- if [ $? -ne 0 ]; then
- tst_resm TINFO "It seems $cnt is limit."
- break
- fi
- ifalias="${ifalias}:0"
+ while [ $cnt -le $IP_TOTAL ]; do
- # Check
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % $CHECK_INTERVAL` -eq 0 ]; then
- # Check the connectivity from the remote host to
- # the local host alias.
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.${x}.${y}.${a}' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
+ if [ "$TST_IPV6" ]; then
+ local hex_x=$(printf '%x' $x)
+ local hex_y=$(printf '%x' $y)
+ local new_ip=${IPV6_NET32_UNUSED}:1:1:1:$hex_x:$hex_y:1
+ else
+ local new_ip=${IPV4_NET16_UNUSED}.$x.$y
fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Check the connecitivy from the interface (non-alias)
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test02
-#
-# DESCRIPTION:
-# Creating a large number of IPv4-aliases by `ifconfig ethn:n'
-#
-#-----------------------------------------------------------------------
-test02()
-{
- TCID=if4-alias-addlarge02
- TST_COUNT=2
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when 'ifconfig ethn:n' creates $IP_TOTAL IPv4-aliases'"
-
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
-
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- x=1 ; y=1 ; xymax=254
- while [ $cnt -lt $IP_TOTAL ]; do
- # Create
- ifalias="${lhost_ifname}:${x}:${y}"
- ifconfig $ifalias ${IPV4_NETWORK}.0.${x}.${y} \
- netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
- if [ $? -ne 0 ]; then
- tst_resm TINFO "It seems $cnt is limit."
- break
- fi
-
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- # Check the connectivity from the remote host to
- # the local host alias.
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.0.${x}.${y}'; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
+ tst_resm TINFO "set new ip $new_ip"
+
+ case $cmd_type in
+ if_cmd)
+ if [ "$TST_IPV6" ]; then
+ ifconfig $iface add $new_ip/$netmask
+ else
+ ifconfig $iface:$x:$y $new_ip netmask 255.255.0.0
+ fi
+ ;;
+ ip_cmd) ip addr add $new_ip/$netmask dev $iface ;;
+ esac
+
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "command failed to add $new_ip to $iface"
+ return
fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
-
- # Define next IP and alias
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=1
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
- break
- fi
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Check the connecitivy from the interface (non-alias)
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test03
-#
-# DESCRIPTION:
-# Creating a large number of IPv4-aliases by ip command
-#
-#-----------------------------------------------------------------------
-test03()
-{
- TCID=if4-alias-addlarge03
- TST_COUNT=3
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when ip command creates $IP_TOTAL IPv4-aliases"
-
- # Make sure that no alias exists.
- initialize_if lhost ${LINK_NUM}
-
- # Set the non-alias address
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to initialize the interface at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
-
- # Start the loop
- cnt=0
- x=1 ; y=1 ; xymax=254
- while [ $cnt -lt $IP_TOTAL ]; do
- # Create
- ip addr add ${IPV4_NETWORK}.1.${x}.${y}/${IPV4_NETMASK_NUM} \
- broadcast $IPV4_BROADCAST dev ${lhost_ifname}
- if [ $? -ne 0 ]; then
- tst_resm TINFO "It seems $cnt is limit."
- break
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- # Check the connectivity from the remote host to
- # the local host alias.
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname ${IPV4_NETWORK}.1.${x}.${y}' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
+ ip addr show $iface | grep -q $new_ip
+ if [ $? -ne 0 ]; then
+ ip addr show $iface
+ tst_resm TFAIL "$new_ip not configured"
+ return
fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
- # Define next IP and alias
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=1
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm TINFO "No more address could be assigned by this script. Finished $cnt times."
- break
- fi
- fi
- done
+ # Check the connectivity
+ check_connectivity $cnt || return
+
+ # Check the background TCP traffic
+ pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+
+ case $cmd_type in
+ if_cmd)
+ if [ "$TST_IPV6" ]; then
+ ifconfig $iface del $new_ip/$netmask
+ else
+ ifconfig $iface:$x:$y down
+ fi
+ ;;
+ ip_cmd) ip addr del $new_ip/$netmask dev $iface ;;
+ esac
+
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL " delete command failed".
+ return
+ fi
- # Check the connecitivy from the interface (non-alias)
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
+ ip addr show $iface | grep -q $new_ip
+ if [ $? -eq 0 ]; then
+ ip addr show $iface
+ tst_resm TFAIL "Failed to remove '$new_ip' address"
+ return
+ fi
- # Stop the background TCP traffic
- bg_tcp_traffic killall
+ cnt=$(($cnt + 1))
+ y=$(($y + 1))
+ if [ $y -gt $xymax ]; then
+ y=1
+ x=$(($x + 1))
+ if [ $x -gt $xymax ]; then
+ tst_brkm TBROK "Too large $IP_TOTAL"
+ fi
+ fi
+ done
- tst_resm TPASS "Test is finished correctly."
- return 0
+ tst_resm TPASS "Test is finished correctly"
}
+setup
+tst_check_cmds ifconfig
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test01 || RC=`expr $RC + 1`
-test02 || RC=`expr $RC + 1`
-test03 || RC=`expr $RC + 1`
-do_cleanup
+test_body 'if_cmd'
+test_body 'ip_cmd'
-exit $RC
+tst_exit
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 8/11] network/stress/interface: cleanup and fix 'mtu' test
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (5 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 7/11] network/stress/interface: cleanup 'addr' group Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 9/11] network/stress/interface: cleanup 'route' group Alexey Kodanev
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
In the end of test-case set default 1500 mtu back
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if-mtu-change | 294 +++++-----------------
1 files changed, 65 insertions(+), 229 deletions(-)
diff --git a/testcases/network/stress/interface/if-mtu-change b/testcases/network/stress/interface/if-mtu-change
index f272ebd..d360b7e 100644
--- a/testcases/network/stress/interface/if-mtu-change
+++ b/testcases/network/stress/interface/if-mtu-change
@@ -1,264 +1,100 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-mtu-change
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity isn't broken with changing MTU many times
-# test01 - by ifconfig command
-# test02 - by ip command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
+# Author: Mitsuru Chinen <mitch@jp.ibm.com>
-# Total number of the test case
TST_TOTAL=2
-export TST_TOTAL
+TCID=if-mtu-change
-# Default of the test case ID and the test case count
-TCID=if4-mtu-change
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable for the test
-. check_envval || exit $TST_TOTAL
-
-# The number of the change of the MTU
-MTU_CHANGE_TIMES=${MTU_CHANGE_TIMES:-1000}
+. if-lib.sh
# The interval of the change [second]
CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
-
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($MTU_CHANGE_TIMES / 100))}
# The array of the value which MTU is changed into sequentially
CHANGE_VALUES="784 1142 426 1500 68 1500 68 748 68 1142 1500"
+CHANGE6_VALUES="1280 1445 1335 1390 1500 1280 1500 1280 1335 1500"
+[ "$TST_IPV6" ] && CHANGE_VALUES=$CHANGE6_VALUES
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"} # local host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"} # remote host
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# lhost_ipv4addr - IPv4 Address of the local host
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-mtu-change
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv4 address to the interfaces
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the local host"
- exit $TST_TOTAL
- fi
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the local and remote host
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-}
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
+test_body()
{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
+ local cmd_type=$1
+ case $cmd_type in
+ if_cmd) local cmd_name='ifconfig' ;;
+ ip_cmd) local cmd_name='ip' ;;
+ *) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
+ esac
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
+ local iface=$(tst_iface)
+ [ "$TST_IPV6" ] && local netmask=64 || local netmask=16
- TCID=if4-mtu-change0${test_type}
- TST_COUNT=${test_type}
+ tst_resm TINFO "'$cmd_name changes MTU $MTU_CHANGE_TIMES times " \
+ "every $CHANGE_INTERVAL seconds"
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
+ tst_restore_ipaddr || \
+ tst_resm TBROK "Failed to set default IP addresses"
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when $test_command command changes MTU $MTU_CHANGE_TIMES times every $CHANGE_INTERVAL seconds"
+ make_background_tcp_traffic
- # Check the connctivity
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
+ mtu_array_len=$(echo $CHANGE_VALUES | wc -w)
+ local cnt=0
+ while [ $cnt -lt $MTU_CHANGE_TIMES ]; do
+ sleep $CHANGE_INTERVAL
+ local nth=$(($cnt % $mtu_array_len))
+ field=$(($nth + 1))
+ cnt=$(($cnt + 1))
+ mtu=$(echo $CHANGE_VALUES | cut -d ' ' -f $field)
+ [ $cnt -eq $MTU_CHANGE_TIMES ] && mtu=1500
- # Make a background TCP traffic
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ tst_resm TINFO "set MTU to $mtu $cnt/$MTU_CHANGE_TIMES"
+ case $cmd_type in
+ if_cmd) ifconfig $iface mtu $mtu ;;
+ ip_cmd) ip link set $iface mtu $mtu ;;
+ esac
- # Start the loop
- mtu_array_len=`echo $CHANGE_VALUES | wc -w`
- cnt=0
- while [ $cnt -lt $MTU_CHANGE_TIMES ]; do
- # Wait CHANGE_INTERVAL seconds
- sleep $CHANGE_INTERVAL
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to change the mtu at $cnt time"
+ return
+ fi
- # Change
- nth=`expr $cnt % $mtu_array_len`
- field=`expr $nth + 1`
- mtu=`echo $CHANGE_VALUES | cut -d ' ' -f $field`
+ check_connectivity $cnt || return
- case $test_type in
- 1)
- ifconfig $lhost_ifname mtu $mtu
- ;;
- 2)
- ip link set $lhost_ifname mtu $mtu
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to change the mtu at $cnt time"
- return 1
- fi
+ # Check the background TCP traffic
+ pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+ done
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
+ tst_resm TINFO "check connectivity through $iface"
+ check_icmpv${ipver}_connectivity $iface $(tst_ipaddr rhost)
if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ tst_resm TFAIL "$iface is broken"
+ return
fi
- cnt=`expr $cnt + 1`
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Check the connectivity again
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- tst_resm TPASS "Test is finished correctly."
- return 0
+ tst_resm TPASS "Test is finished correctly"
}
+setup
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
+tst_check_cmds ifconfig
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
+test_body 'if_cmd'
+test_body 'ip_cmd'
-exit $RC
+tst_exit
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 9/11] network/stress/interface: cleanup 'route' group
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (6 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 8/11] network/stress/interface: cleanup and fix 'mtu' test Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 10/11] network/stress/interface: cleanup 'updown' test Alexey Kodanev
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
* use if-lib.sh, test_net.sh libraries;
* add routes from IPV4_NET16_UNUSED, IPV6_NET32_UNUSED networks
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if-route-adddel | 330 ++++---------------
.../network/stress/interface/if-route-addlarge | 339 +++++---------------
2 files changed, 149 insertions(+), 520 deletions(-)
diff --git a/testcases/network/stress/interface/if-route-adddel b/testcases/network/stress/interface/if-route-adddel
index 8adf24f..650ab22 100644
--- a/testcases/network/stress/interface/if-route-adddel
+++ b/testcases/network/stress/interface/if-route-adddel
@@ -1,293 +1,99 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-route-adddel
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity is not broken with adding and deleting
-# an IPv4 route many times
-# test01 - by route command
-# test02 - by ip command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
+# Author: Mitsuru Chinen <mitch@jp.ibm.com>
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-route-adddel
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv4 alias
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
-# The destination network to add and delete
-ADDDEL_ROUTE="10.10.10.0"
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-route-adddel
- TST_COUNT=0
-
- # Initialize the interfaces of the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv4 address to the interfaces
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv4 address the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
+TCID=if-route-adddel
+. if-lib.sh
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($NS_TIMES / 100))}
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - route command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
test_body()
{
- test_type=$1
-
- TCID=if4-route-adddel0${test_type}
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="route"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
+ local cmd_type=$1
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command adds, then and deletes an IPv4 route $NS_TIMES times"
+ case $cmd_type in
+ rt_cmd) local cmd_name='route' ;;
+ ip_cmd) local cmd_name='ip' ;;
+ *) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
+ esac
- # Initialize the interface of the local host
- initialize_if lhost ${LINK_NUM}
+ local iface=$(tst_iface)
+ local inet="inet$TST_IPV6"
+ local new_rt=
+ local opt_rt=
+ if [ "$TST_IPV6" ]; then
+ new_rt=${IPV6_NET32_UNUSED}::
+ opt_rt="/64"
+ else
+ new_rt="${IPV4_NET16_UNUSED}.23.0"
+ case $cmd_type in
+ rt_cmd) ;;
+ ip_cmd) opt_rt='/24' ;;
+ esac
+ fi
- # Assign IPv4 address to the interface of the local host
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to assign an IPv4 address at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+ tst_resm TINFO "'$cmd_name' add/del ${new_rt}${opt_rt} $NS_TIMES times"
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
+ tst_restore_ipaddr || \
+ tst_resm TBROK "Failed to set default IP addresses"
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ make_background_tcp_traffic
- # Start the loop
- cnt=0
- while [ $cnt -lt $NS_TIMES ]; do
- # Add the route
- case $test_type in
- 1)
- route add -net $ADDDEL_ROUTE netmask $IPV4_NETMASK dev $lhost_ifname
- ;;
- 2)
- ip route add ${ADDDEL_ROUTE}/${IPV4_NETMASK_NUM} dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add the route to ${ADDDEL_ROUTE}"
- return 1
- fi
+ local cnt=1
+ while [ $cnt -le $NS_TIMES ]; do
+ case $cmd_type in
+ rt_cmd) route -A $inet add ${new_rt}${opt_rt} dev $iface ;;
+ ip_cmd) ip route add ${new_rt}${opt_rt} dev $iface ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Can't add route $new_rt to $iface"
+ return
+ fi
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ case $cmd_type in
+ rt_cmd) route -A $inet del ${new_rt}${opt_rt} dev $iface ;;
+ ip_cmd) ip route del ${new_rt}${opt_rt} dev $iface ;;
+ esac
if [ $? -ne 0 ]; then
- tst_resm TFAIL "The route is broken at ${cnt} time"
- return 1
+ tst_resm TFAIL "Can't del route $new_rt from $iface"
+ return
fi
- fi
- fi
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
+ check_connectivity $cnt || return
- # Delete the route
- case $test_type in
- 1)
- route del -net $ADDDEL_ROUTE netmask $IPV4_NETMASK dev $lhost_ifname
- ;;
- 2)
- ip route del ${ADDDEL_ROUTE}/${IPV4_NETMASK_NUM} dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Cannot delte the route to ${ADDDEL_ROUTE}"
- return 1
- fi
- done
+ # Check the background TCP traffic
+ pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
- # Stop the background TCP traffic
- bg_tcp_traffic killall
+ cnt=$(($cnt + 1))
+ done
- tst_resm TPASS "Test is finished correctly."
- return 0
+ tst_resm TPASS "Test is finished correctly"
}
+setup
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
+tst_check_cmds route
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of route command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
+test_body 'rt_cmd'
+test_body 'ip_cmd'
-exit $RC
+tst_exit
diff --git a/testcases/network/stress/interface/if-route-addlarge b/testcases/network/stress/interface/if-route-addlarge
index f78a6d6..678a6a5 100644
--- a/testcases/network/stress/interface/if-route-addlarge
+++ b/testcases/network/stress/interface/if-route-addlarge
@@ -1,292 +1,115 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-route-addlarge
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity is not broken with adding a large
-# number of IPv4 routes
-# test01 - by route command
-# test02 - by ip command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
+# Author: Mitsuru Chinen <mitch@jp.ibm.com>
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-route-addlarge
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv4 alias
-ROUTE_TOTAL=${ROUTE_TOTAL:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $ROUTE_TOTAL \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Network Address of the tested netwrok
-IPV4_NETWORK_ADDR=${IPV4_NETWORK}.0
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}
-
+TCID=if-route-addlarge
+TST_CLEANUP="cleanup"
+. if-lib.sh
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-route-addlarge
- TST_COUNT=0
-
- # Initialize the interfaces of the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv4 address to the interfaces
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($ROUTE_TOTAL / 100))}
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - route command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
test_body()
{
- test_type=$1
+ local cmd_type=$1
- TCID=if4-route-addlarge0${test_type}
- TST_COUNT=${test_type}
+ case $cmd_type in
+ rt_cmd) local cmd_name='route' ;;
+ ip_cmd) local cmd_name='ip' ;;
+ *) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
+ esac
- case $test_type in
- 1)
- test_command="route"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
+ local iface=$(tst_iface)
+ local inet="inet$TST_IPV6"
+ local opt_rt=
+ if [ "$TST_IPV6" ]; then
+ opt_rt="/64"
+ else
+ case $cmd_type in
+ rt_cmd) ;;
+ ip_cmd) opt_rt='/32' ;;
+ esac
+ fi
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command adds $ROUTE_TOTAL IPv4 routes"
+ tst_resm TINFO "'$cmd_name' add IPv$ipver $ROUTE_TOTAL routes"
- # Initialize the interface of the local host
- initialize_if lhost ${LINK_NUM}
+ tst_restore_ipaddr || \
+ tst_resm TBROK "Failed to set default IP addresses"
- # Assign IPv4 address to the interface of the local host
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add IPv4 address at the local host"
- return 1
- fi
- lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
+ make_background_tcp_traffic
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv4_connectivity $rhost_ifname $lhost_ipv4addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
+ local x=1
+ local y=1
+ local cnt=1
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
+ [ "$TST_IPV6" ] && local xymax=65535 || xymax=254
- # Start the loop
- cnt=0
- x=0 ; y=1 ; xymax=255
- while [ $cnt -lt $ROUTE_TOTAL ]; do
- # Add the route
- case $test_type in
- 1)
- route add -net 10.${x}.${y}.0 netmask 255.255.255.0 dev $lhost_ifname
- ;;
- 2)
- ip route add 10.${x}.${y}.0/24 dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add a route at $cnt times"
- return 1
+ if [ $ROUTE_TOTAL -gt $((xymax * xymax)) ]; then
+ tst_resm TWARN "set ROUTE_TOTAL to $xymax * $xymax"
+ ROUTE_TOTAL=$((xymax * xymax))
fi
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ while [ $cnt -le $ROUTE_TOTAL ]; do
+
+ if [ "$TST_IPV6" ]; then
+ local hex_x=$(printf '%x' $x)
+ local hex_y=$(printf '%x' $y)
+ local new_rt=${IPV6_NET32_UNUSED}:$hex_x:$hex_y::
+ else
+ local new_rt=${IPV4_NET16_UNUSED}.$x.$y
+ fi
+
+ case $cmd_type in
+ rt_cmd) route -A $inet add ${new_rt}${opt_rt} dev $iface ;;
+ ip_cmd) ip route add ${new_rt}${opt_rt} dev $iface ;;
+ esac
if [ $? -ne 0 ]; then
- tst_resm TFAIL "The route is broken at ${cnt} time"
- return 1
+ tst_resm TFAIL "Can't add route $new_rt to $iface"
+ return
fi
- fi
- fi
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv4addr`
- fi
+ check_connectivity $cnt || return
- # Define the next network address
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=0
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm INFO "Too large times. Finished $cnt times."
- break
- fi
- fi
- done
+ # Check the background TCP traffic
+ pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
- # Stop the background TCP traffic
- bg_tcp_traffic killall
+ cnt=$(($cnt + 1))
+ y=$(($y + 1))
+ if [ $y -gt $xymax ]; then
+ y=1
+ x=$(($x + 1))
+ if [ $x -gt $xymax ]; then
+ tst_brkm TBROK "Too large $ROUTE_TOTAL"
+ fi
+ fi
+ done
- tst_resm TPASS "Test is finished correctly."
- return 0
+ tst_resm TPASS "Test is finished correctly"
}
+setup
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
+tst_check_cmds route
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of route command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
+test_body 'rt_cmd'
+test_body 'ip_cmd'
-exit $RC
+tst_exit
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 10/11] network/stress/interface: cleanup 'updown' test
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (7 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 9/11] network/stress/interface: cleanup 'route' group Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 11/11] network/stress/interface: delete if6-* Alexey Kodanev
2015-06-11 11:20 ` [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Note, this test could cause port flapping error on a switch
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if-updown | 285 +++++---------------------
1 files changed, 54 insertions(+), 231 deletions(-)
diff --git a/testcases/network/stress/interface/if-updown b/testcases/network/stress/interface/if-updown
index 90bffaa..81a5af5 100644
--- a/testcases/network/stress/interface/if-updown
+++ b/testcases/network/stress/interface/if-updown
@@ -1,258 +1,81 @@
#!/bin/sh
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines Corp., 2005
#
-# File:
-# if4-updown
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# Description:
-# Verify the IPv4 connectivity isn't broken with upping and downing
-# an interface many times
-# test01 - by ifconfig command
-# test02 - by ip command
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
+# Author: Mitsuru Chinen <mitch@jp.ibm.com>
-# Total number of the test case
TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if4-updown
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the interface up/down in each test case
-IF_UPDOWN_TIMES=${IF_UPDOWN_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IF_UPDOWN_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-10.0.0}
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-2} # local host
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-1} # remote host
-
+TCID=if-updown
+. if-lib.sh
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv4 connectivity
-#
-# SET VALUES:
-# rhost_ipv4addr - IPv4 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if4-updown
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
+CHECK_INTERVAL=${CHECK_INTERVAL:-$(($IF_UPDOWN_TIMES / 100))}
- # Set IPv4 address to the interfaces
- set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the local host"
- exit $TST_TOTAL
- fi
- set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv4 address of the remote host
- rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-}
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
test_body()
{
- test_type=$1
-
- TCID=if4-updown0$test_type
- TST_COUNT=$test_type
+ local cmd_type=$1
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv4 connectivity is not broken when the $test_command command ups, then downs an interface $IF_UPDOWN_TIMES times"
+ case $cmd_type in
+ if_cmd) local cmd_name='ifconfig' ;;
+ ip_cmd) local cmd_name='ip' ;;
+ *) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
+ esac
- # Check the connctivity
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is something wrong."
- return 1
- fi
+ local iface=$(tst_iface)
- # Start the loop
- cnt=0
- while [ $cnt -lt $IF_UPDOWN_TIMES ]; do
- # Down
- case $test_type in
- 1)
- ifconfig $lhost_ifname down
- ;;
- 2)
- ip link set $lhost_ifname down
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to down $lhost_ifname"
- return 1
- fi
+ tst_resm TINFO "'$cmd_name ups/downs $iface $IF_UPDOWN_TIMES times"
+ tst_resm TINFO "check connectivity interval is $CHECK_INTERVAL"
+ tst_restore_ipaddr || \
+ tst_resm TBROK "Failed to set default IP addresses"
- # Up
- case $test_type in
- 1)
- ifconfig $lhost_ifname up
- ;;
- 2)
- ip link set $lhost_ifname up
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to up $lhost_ifname"
- return 1
- fi
+ local cnt=1
+ while [ $cnt -le $IF_UPDOWN_TIMES ]; do
+ case $cmd_type in
+ if_cmd) ifconfig $iface down ;;
+ ip_cmd) ip link set $iface down ;;
+ esac
+ if [ $? -ne 0 ]; then
+ tst_resm TFAIL "Failed to down $iface"
+ return
+ fi
- # Check the connectivity every CHECK_INTERVAL time
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
+ case $cmd_type in
+ if_cmd) ifconfig $iface up ;;
+ ip_cmd) ip link set $iface up ;;
+ esac
if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken at ${cnt} time"
- return 1
+ tst_resm TFAIL "Failed to up $iface"
+ return
fi
- fi
- fi
- done
- # Check the connectivity again
- check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- tst_resm TPASS "Test is finished successfully."
+ check_connectivity $cnt || return
+
+ cnt=$(($cnt + 1))
+ done
- return 0
+ tst_resm TPASS "Test is finished correctly"
}
+setup
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
+tst_check_cmds ifconfig
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
+test_body 'if_cmd'
+test_body 'ip_cmd'
-exit $RC
+tst_exit
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [LTP] [PATCH 11/11] network/stress/interface: delete if6-*
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (8 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 10/11] network/stress/interface: cleanup 'updown' test Alexey Kodanev
@ 2015-02-13 12:07 ` Alexey Kodanev
2015-06-11 11:20 ` [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-02-13 12:07 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
if6-* combined with if4-* tests
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/stress/interface/if6-addr-adddel | 291 -------------------
.../network/stress/interface/if6-addr-addlarge | 298 --------------------
testcases/network/stress/interface/if6-mtu-change | 259 -----------------
.../network/stress/interface/if6-route-adddel | 289 -------------------
.../network/stress/interface/if6-route-addlarge | 287 -------------------
testcases/network/stress/interface/if6-updown | 251 ----------------
6 files changed, 0 insertions(+), 1675 deletions(-)
delete mode 100644 testcases/network/stress/interface/if6-addr-adddel
delete mode 100644 testcases/network/stress/interface/if6-addr-addlarge
delete mode 100644 testcases/network/stress/interface/if6-mtu-change
delete mode 100644 testcases/network/stress/interface/if6-route-adddel
delete mode 100644 testcases/network/stress/interface/if6-route-addlarge
delete mode 100644 testcases/network/stress/interface/if6-updown
diff --git a/testcases/network/stress/interface/if6-addr-adddel b/testcases/network/stress/interface/if6-addr-adddel
deleted file mode 100644
index 09d9b7d..0000000
--- a/testcases/network/stress/interface/if6-addr-adddel
+++ /dev/null
@@ -1,291 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if6-addr-adddel
-#
-# Description:
-# Verify the IPv6 connectivity isn't broken with adding and deleting an
-# IPv6 address many times
-# test01 - by ifconfig command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if6-addr-adddel
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv6 address
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv6 address
-IPV6_NETWORK="fd00:1:1:1"
-
-# Netmask of the tested network
-IPV6_NETMASK_NUM=64
-
-# Host portion of the IPv6 address of the remote host
-RHOST_IPV6_HOST=":1"
-
-# Host portion of a IPv6 address of the local host for TCP traffic
-LHOST_IPV6_HOST_FIXED=":99"
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Preparation
-#
-# SET VALUES:
-# rhost_ipv6addr - IPv6 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if6-addr-adddel
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv6 address to the interfaces
- add_ipv6addr rhost ${LINK_NUM} ${IPV6_NETWORK} ${RHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv6 address at the remote host"
- fi
-
- # IPv6 address of the remote host
- rhost_ipv6addr="${IPV6_NETWORK}:${RHOST_IPV6_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if6-addr-adddel0$test_type
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv6 connectivty is not broken when the $test_command command adds, then deletes an IPv6 address $NS_TIMES times"
-
- # Make sure the interface is initialized
- initialize_if lhost ${LINK_NUM}
-
- # IPv6 address of the localhost
- lhost_ipv6addr=${IPV6_NETWORK}::${test_type}${test_type}
-
- # Add an IPv6 address for TCP traffic
- add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST_FIXED}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to assign an IPv6 address at the local host"
- return 1
- fi
- lhost_fixed_ipv6addr="${IPV6_NETWORK}:${LHOST_IPV6_HOST_FIXED}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_fixed_ipv6addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make ${lhost_fixed_ipv6addr}`
-
- # Start the loop
- cnt=0
- while [ $cnt -lt $NS_TIMES ]; do
- # Add
- case $test_type in
- 1)
- ifconfig $lhost_ifname add ${lhost_ipv6addr}/${IPV6_NETMASK_NUM}
- ;;
- 2)
- ip addr add ${lhost_ipv6addr}/${IPV6_NETMASK_NUM} dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to add an IPv6 address at $cnt times"
- return 1
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make ${lhost_fixed_ipv6addr}`
- fi
-
- # Delete
- case $test_type in
- 1)
- ifconfig $lhost_ifname del ${lhost_ipv6addr}/${IPV6_NETMASK_NUM}
- ;;
- 2)
- ip addr del ${lhost_ipv6addr}/${IPV6_NETMASK_NUM} dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to del an IPv6 addrss at $cnt times"
- return 1
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if6-addr-addlarge b/testcases/network/stress/interface/if6-addr-addlarge
deleted file mode 100644
index 7d95857..0000000
--- a/testcases/network/stress/interface/if6-addr-addlarge
+++ /dev/null
@@ -1,298 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if6-addr-addlarge
-#
-# Description:
-# Verify the IPv6 connectivity is not broken with adding a large number
-# of IPv6 address
-# test01 - by ifconfig command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if6-addr-addlarge
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add IPv6 addr
-IP_TOTAL=${IP_TOTAL:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IP_TOTAL \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv6 address
-IPV6_NETWORK="fd00:1:1:1"
-
-# Netmask of the tested network
-IPV6_NETMASK_NUM=64
-
-# Host portion of the IPv6 address
-LHOST_IPV6_HOST=":2"
-RHOST_IPV6_HOST=":1"
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Preparation
-#
-# SET VALUES:
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-# rhost_ipv6addr - IP address of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if6-addr-addlarge
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv6 address to the interfaces
- add_ipv6addr rhost ${LINK_NUM} ${IPV6_NETWORK} ${RHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv6 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of the local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of the remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv6 address of the remote host
- rhost_ipv6addr="${IPV6_NETWORK}:${RHOST_IPV6_HOST}"
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if6-addr-addlarge0$test_type
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv6 connectivity is not broken when the $test_command command adds $IP_TOTAL IPv6 addresses"
-
- # Make sure the interface is initialized
- initialize_if lhost ${LINK_NUM}
-
- # Set the fixed address
- add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add IPv6 address to the interface at the local host"
- return 1
- fi
- lhost_ipv6addr="${IPV6_NETWORK}:${LHOST_IPV6_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_ipv6addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the fixed address
- server_pid=`bg_tcp_traffic make $lhost_ipv6addr`
-
- # Start the loop
- cnt=0
- x=0 ; y=0 ; xymax=255
- while [ $cnt -lt $IP_TOTAL ]; do
- # Create
- hex_x=`printf '%02x' $x`
- hex_y=`printf '%02x' $y`
- case $test_type in
- 1)
- add_ipv6addr="${IPV6_NETWORK}:1:${hex_x}:${hex_y}:1"
- ifconfig ${lhost_ifname} add ${add_ipv6addr}/${IPV6_NETMASK_NUM}
- ;;
- 2)
- add_ipv6addr="${IPV6_NETWORK}:2:${hex_x}:${hex_y}:1"
- ip addr add ${add_ipv6addr}/${IPV6_NETMASK_NUM} dev ${lhost_ifname}
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TINFO "Failed to add an address. It seems to reach the max number."
- break
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- # Do ping from the remote host to the new local host address
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname ${add_ipv6addr}' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken at $cnt time."
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv6addr`
- fi
-
- # Define next IP address to add
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=0
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm INFO "Too large times. Finished $cnt times."
- break
- fi
- fi
- done
-
- # Check the connecitivy again
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The interface ${lhost_ifname} is broken."
- return 1
- fi
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if6-mtu-change b/testcases/network/stress/interface/if6-mtu-change
deleted file mode 100644
index 79a20d2..0000000
--- a/testcases/network/stress/interface/if6-mtu-change
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if6-mtu-change
-#
-# Description:
-# Verify the IPv6 connectivity isn't broken with changing MTU many times
-# test01 - by ifconfig command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if6-mtu-change
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable for the test
-. check_envval || exit $TST_TOTAL
-
-# The number of the change of the MTU
-MTU_CHANGE_TIMES=${MTU_CHANGE_TIMES:-1000}
-
-# The interval of the change [second]
-CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
-
-# The array of the value which MTU is changed into sequentially
-CHANGE_VALUES="1280 1445 1335 1390 1500 1280 1500 1280 1335 1500"
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv6 address
-IPV6_NETWORK="fd00:1:1:1"
-
-# Host portion of the IPv6 address of the remote host
-LHOST_IPV6_HOST=":2" # local
-RHOST_IPV6_HOST=":1" # remote
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv6 connectivity
-#
-# SET VALUES:
-# lhost_ipv6addr - IPv6 Address of the local host
-# rhost_ipv6addr - IPv6 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if6-mtu-change
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv6 address to the interfaces
- add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv6 address at the local host"
- exit $TST_TOTAL
- fi
- add_ipv6addr rhost ${LINK_NUM} ${IPV6_NETWORK} ${RHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv6 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv6 address of the local and remote host
- lhost_ipv6addr="${IPV6_NETWORK}:${LHOST_IPV6_HOST}"
- rhost_ipv6addr="${IPV6_NETWORK}:${RHOST_IPV6_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-}
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if6-mtu-change0${test_type}
- TST_COUNT=${test_type}
-
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv6 connectivity is not broken when the $test_command command changes MTU $MTU_CHANGE_TIMES times every $CHANGE_INTERVAL seconds"
-
- # Check the connctivity
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic
- server_pid=`bg_tcp_traffic make $lhost_ipv6addr`
-
- # Start the loop
- mtu_array_len=`echo $CHANGE_VALUES | wc -w`
- cnt=0
- while [ $cnt -lt $MTU_CHANGE_TIMES ]; do
- # Wait CHANGE_INTERVAL second
- sleep $CHANGE_INTERVAL
-
- # Change
- nth=`expr $cnt % $mtu_array_len`
- field=`expr $nth + 1`
- mtu=`echo $CHANGE_VALUES | cut -d ' ' -f $field`
-
- case $test_type in
- 1)
- ifconfig $lhost_ifname mtu $mtu
- ;;
- 2)
- ip link set $lhost_ifname mtu $mtu
- ;;
- esac
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make $lhost_ipv6addr`
- fi
-
- cnt=`expr $cnt + 1`
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- # Verify the connectivity again
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if6-route-adddel b/testcases/network/stress/interface/if6-route-adddel
deleted file mode 100644
index 9e7a9c3..0000000
--- a/testcases/network/stress/interface/if6-route-adddel
+++ /dev/null
@@ -1,289 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if6-route-adddel
-#
-# Description:
-# Verify the IPv6 connectivity is not broken with adding and deleting
-# an IPv6 route many times
-# test01 - by route command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if6-route-adddel
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete an IPv6 route
-NS_TIMES=${NS_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $NS_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv6 address
-IPV6_NETWORK="fd00:1:1:1"
-
-# Netmask of for the tested network
-IPV6_NETMASK_NUM=64
-
-# Host portion of the IPv6 address
-LHOST_IPV6_HOST=":2"
-RHOST_IPV6_HOST=":1"
-
-# The destination network to add and delete
-ADDDEL_ROUTE="fd00:100:1:1::/64"
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv6 connectivity
-#
-# SET VALUES:
-# rhost_ipv6addr - IPv6 Address of the remote host
-# lhost_ifname - Interface name of the localhost
-# rhost_ifname - Interface name of the local host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if6-route-adddel
- TST_COUNT=0
-
- # Initialize the interfaces of the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv6 address to the interfaces
- add_ipv6addr rhost ${LINK_NUM} ${IPV6_NETWORK} ${RHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add an IPv6 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv6 address of the remote host
- rhost_ipv6addr="${IPV6_NETWORK}:${RHOST_IPV6_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of the remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - route command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if6-route-adddel0$test_type
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="route"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv6 connectivity is not broken when the $test_command command adds, then deletes an IPv6 route $NS_TIMES times"
-
- # Initialize the interface of the local host
- initialize_if lhost ${LINK_NUM}
-
- # Assign IPv6 address to the interface of the local host
- add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to assign an IPv6 address at the local host"
- return 1
- fi
- lhost_ipv6addr="${IPV6_NETWORK}:${LHOST_IPV6_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_ipv6addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make ${lhost_ipv6addr}`
-
- # Start the loop
- cnt=0
- while [ $cnt -lt $NS_TIMES ]; do
- # Add the route
- case $test_type in
- 1)
- route -A inet6 add $ADDDEL_ROUTE dev $lhost_ifname
- ;;
- 2)
- ip route add $ADDDEL_ROUTE dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Cannot add a route to $ADDDEL_ROUTE".
- return 1
- fi
-
- # Delete the route
- case $test_type in
- 1)
- route -A inet6 del $ADDDEL_ROUTE dev $lhost_ifname
- ;;
- 2)
- ip route del $ADDDEL_ROUTE dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Cannot delte a route to $ADDDEL_ROUTE".
- return 1
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The route is broken at ${cnt} time"
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make ${lhost_ipv6addr}`
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of route command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if6-route-addlarge b/testcases/network/stress/interface/if6-route-addlarge
deleted file mode 100644
index 4e394f9..0000000
--- a/testcases/network/stress/interface/if6-route-addlarge
+++ /dev/null
@@ -1,287 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if6-route-addlarge
-#
-# Description:
-# Verify the IPv6 connectivity is not broken with adding and deleting
-# an IPv6 route many times
-# test01 - by route command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if6-route-addlarge
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the add/delete IPv6 alias
-ROUTE_TOTAL=${ROUTE_TOTAL:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $ROUTE_TOTAL \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-# Network portion of the IPv6 address
-IPV6_NETWORK="fd00:1:1:1"
-
-# Netmask of for the tested network
-IPV6_NETMASK_NUM=64
-
-# Host portion of the IPv6 address
-LHOST_IPV6_HOST=":2"
-RHOST_IPV6_HOST=":1"
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv6 connectivity
-#
-# SET VALUES:
-# rhost_ipv6addr - IPv6 Address of the remote host
-# lhost_ifname - Interface name of the local host
-# rhost_ifname - Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if6-route-addlarge
- TST_COUNT=0
-
- # Initialize the interfaces of the remote host
- initialize_if rhost ${LINK_NUM}
-
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Set IPv6 address to the interfaces
- add_ipv6addr rhost ${LINK_NUM} ${IPV6_NETWORK} ${RHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to set an IPv4 address at the remote host"
- exit $TST_TOTAL
- fi
-
- # IPv6 address of the remote host
- rhost_ipv6addr="${IPV6_NETWORK}:${RHOST_IPV6_HOST}"
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-
- # Get the Interface name of the remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Make sure the TCP traffic server/client doesn't run
- bg_tcp_traffic killall
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - route command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if6-route-addlarge0$test_type
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="route"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv6 connectivity is not broken when the $test_command command adds $ROUTE_TOTAL IPv6 routes"
-
- # Initialize the interface of the local host
- initialize_if lhost ${LINK_NUM}
-
- # Assign IPv6 address to the interface of the local host
- add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST}
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to add IPv6 address at the local host"
- return 1
- fi
- lhost_ipv6addr="${IPV6_NETWORK}:${LHOST_IPV6_HOST}"
-
- # Check the connctivity
- ret=`$LTP_RSH $RHOST ${LTPROOT}/testcases/bin/check_icmpv6_connectivity $rhost_ifname $lhost_ipv6addr' ; echo $?'`
- if [ $ret -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Make a background TCP traffic from the non-alias address
- server_pid=`bg_tcp_traffic make ${lhost_ipv6addr}`
-
- # Start the loop
- cnt=0
- x=0 ; y=0 ; xymax=255
- while [ $cnt -lt $ROUTE_TOTAL ]; do
- # Add the route
- x_hex=`printf "%x" $x`
- y_hex=`printf "%x" $y`
- add_route="fd00:11:${x_hex}:${y_hex}::/64"
- case $test_type in
- 1)
- route -A inet6 add $add_route dev $lhost_ifname
- ;;
- 2)
- ip route add $add_route dev $lhost_ifname
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TINFO "Failed to add more route. It seems to reach max number."
- break
- fi
-
- # Check the connectivity
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "The route is broken at ${cnt} time"
- return 1
- fi
- fi
- fi
-
- # Check the background TCP traffic
- bg_tcp_traffic check $server_pid
- if [ $? -ne 0 ]; then
- server_pid=`bg_tcp_traffic make ${lhost_ipv6addr}`
- fi
-
- # Define the next network address
- y=`expr $y + 1`
- if [ $y -gt $xymax ]; then
- y=0
- x=`expr $x + 1`
- if [ $x -gt $xymax ]; then
- tst_resm INFO "Too large times. Finished $cnt times."
- break
- fi
- fi
- done
-
- # Stop the background TCP traffic
- bg_tcp_traffic killall
-
- tst_resm TPASS "Test is finished correctly."
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of route command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/interface/if6-updown b/testcases/network/stress/interface/if6-updown
deleted file mode 100644
index 5a09cb8..0000000
--- a/testcases/network/stress/interface/if6-updown
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/sh
-
-################################################################################
-## ##
-## Copyright (c) International Business Machines Corp., 2005 ##
-## ##
-## This program is free software; you can redistribute it and#or modify ##
-## it under the terms of the GNU General Public License as published by ##
-## the Free Software Foundation; either version 2 of the License, or ##
-## (at your option) any later version. ##
-## ##
-## This program is distributed in the hope that it will be useful, but ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
-## for more details. ##
-## ##
-## You should have received a copy of the GNU General Public License ##
-## along with this program; if not, write to the Free Software ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ##
-## ##
-## ##
-################################################################################
-#
-# File:
-# if6-updown
-#
-# Description:
-# Verify the IPv6 connectivity isn't broken with upping and downing
-# an interface many times
-# test01 - by ifconfig command
-# test02 - by ip command
-#
-# Setup:
-# See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-# Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-# Oct 19 2005 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=if6-updown
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of the interface up/down in each test case
-IF_UPDOWN_TIMES=${IF_UPDOWN_TIMES:-10000}
-
-# The interval of the check interface activity
-CHECK_INTERVAL=${CHECK_INTERVAL:-`expr $IF_UPDOWN_TIMES \/ 100`}
-
-# The number of the test link where tests run
-LINK_NUM=0
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_setup
-#
-# DESCRIPTION:
-# Make a IPv6/IPv6 connectivity
-#
-# SET VALUES:
-# rhost_ipv6lladdr - IPv6 Link-local Address of the remote host
-# lhost_ifname - Interface name of the localhost
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
- TCID=if6-updown
- TST_COUNT=0
-
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-
- # Get the Interface name of local host
- lhost_ifname=`get_ifname lhost ${LINK_NUM}`
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Failed to get the interface name at the local host"
- exit $TST_TOTAL
- fi
-
- # Get IPv6 link-local address of the remote host
- rhost_ifname=`get_ifname rhost ${LINK_NUM}`
- ipcom_output=`mktemp -p $TMPDIR`
- $LTP_RSH $RHOST "PATH=/sbin:/usr/sbin:$PATH ip -f inet6 addr show dev $rhost_ifname" > $ipcom_output
- rhost_ipv6lladdr=`fgrep 'scope link' $ipcom_output | awk '{ print $2 }' | sed "s/\/.*$//"`
- rm -f $ipcom_output
- if [ x$rhost_ipv6lladdr = x ]; then
- tst_resm TBROK "Link-local address is not found at $rhost_ifname on the remote host"
- exit $TST_TOTAL
- fi
-}
-
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-# do_cleanup
-#
-# DESCRIPTION:
-# Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
- # Initialize the interfaces
- initialize_if lhost ${LINK_NUM}
- initialize_if rhost ${LINK_NUM}
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-# test_body
-#
-# DESCRIPTION:
-# main code of the test
-#
-# Arguments:
-# $1: define the test type
-# 1 - ifconfig command case
-# 2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
- test_type=$1
-
- TCID=if6-updown0$test_type
- TST_COUNT=$test_type
-
- case $test_type in
- 1)
- test_command="ifconfig"
- ;;
- 2)
- test_command="ip"
- ;;
- *)
- tst_resm TBROK "unspecified case"
- return 1
- ;;
- esac
-
- tst_resm TINFO "Verify the IPv6 connectivity is not broken when the $test_command command ups, then downs an interface $IF_UPDOWN_TIMES times"
-
- # Check the connctivity
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6lladdr
- if [ $? -ne 0 ]; then
- tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
- return 1
- fi
-
- # Start the loop
- cnt=0
- while [ $cnt -lt $IF_UPDOWN_TIMES ]; do
- # Down
- case $test_type in
- 1)
- ifconfig $lhost_ifname down
- ;;
- 2)
- ip link set $lhost_ifname down
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to disable $lhost_ifname"
- return 1
- fi
-
- # Wait 0-2 seconds for imcomplete/complete DAD.
- sleep `expr $cnt % 3`
-
- # Up
- case $test_type in
- 1)
- ifconfig $lhost_ifname up
- ;;
- 2)
- ip link set $lhost_ifname up
- ;;
- esac
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "Failed to enable $lhost_ifname"
- return 1
- fi
-
- # Check the connectivity every CHECK_INTERVAL time
- cnt=`expr $cnt + 1`
- if [ $CHECK_INTERVAL -ne 0 ]; then
- if [ `expr $cnt % ${CHECK_INTERVAL}` -eq 0 ]; then
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6lladdr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken at ${cnt} time"
- return 1
- fi
- fi
- fi
- done
-
- # Check the connectivity again
- check_icmpv6_connectivity $lhost_ifname $rhost_ipv6lladdr
- if [ $? -ne 0 ]; then
- tst_resm TFAIL "$lhost_ifname is broken."
- return 1
- fi
- tst_resm TPASS "Test is finished successfully."
-
- return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-# The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1` # Case of ifconfig command
-test_body 2 || RC=`expr $RC + 1` # Case of ip command
-do_cleanup
-
-exit $RC
--
1.7.1
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
` (9 preceding siblings ...)
2015-02-13 12:07 ` [LTP] [PATCH 11/11] network/stress/interface: delete if6-* Alexey Kodanev
@ 2015-06-11 11:20 ` Alexey Kodanev
10 siblings, 0 replies; 12+ messages in thread
From: Alexey Kodanev @ 2015-06-11 11:20 UTC (permalink / raw)
To: ltp-list; +Cc: vasily.isaenko
Hi,
On 02/13/2015 03:06 PM, Alexey Kodanev wrote:
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
> testcases/network/stress/interface/if-addr-adddel | 326 +++++++++++++
> .../network/stress/interface/if-addr-addlarge | 481 ++++++++++++++++++++
> testcases/network/stress/interface/if-mtu-change | 264 +++++++++++
> testcases/network/stress/interface/if-route-adddel | 293 ++++++++++++
> .../network/stress/interface/if-route-addlarge | 292 ++++++++++++
> testcases/network/stress/interface/if-updown | 258 +++++++++++
> .../network/stress/interface/if4-alias-adddel | 326 -------------
> .../network/stress/interface/if4-alias-addlarge | 481 --------------------
> testcases/network/stress/interface/if4-mtu-change | 264 -----------
> .../network/stress/interface/if4-route-adddel | 293 ------------
> .../network/stress/interface/if4-route-addlarge | 292 ------------
> testcases/network/stress/interface/if4-updown | 258 -----------
> 12 files changed, 1914 insertions(+), 1914 deletions(-)
> create mode 100644 testcases/network/stress/interface/if-addr-adddel
> create mode 100644 testcases/network/stress/interface/if-addr-addlarge
> create mode 100644 testcases/network/stress/interface/if-mtu-change
> create mode 100644 testcases/network/stress/interface/if-route-adddel
> create mode 100644 testcases/network/stress/interface/if-route-addlarge
> create mode 100644 testcases/network/stress/interface/if-updown
> delete mode 100644 testcases/network/stress/interface/if4-alias-adddel
> delete mode 100644 testcases/network/stress/interface/if4-alias-addlarge
> delete mode 100644 testcases/network/stress/interface/if4-mtu-change
> delete mode 100644 testcases/network/stress/interface/if4-route-adddel
> delete mode 100644 testcases/network/stress/interface/if4-route-addlarge
> delete mode 100644 testcases/network/stress/interface/if4-updown
Patch-set applied.
Best regards,
Alexey
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-06-11 11:17 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 12:06 [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 2/11] network/stress/interface/docs: cleanup Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 3/11] runtest/network_stress.interface: fix test names Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 4/11] network/stress/interface/ip4-addr-change: apply test_net.sh library Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 5/11] network/stress/interface: add local library Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 6/11] testscripts/network.sh: add IPV4_NET16_UNUSED, IPV6_NET32_UNUSED Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 7/11] network/stress/interface: cleanup 'addr' group Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 8/11] network/stress/interface: cleanup and fix 'mtu' test Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 9/11] network/stress/interface: cleanup 'route' group Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 10/11] network/stress/interface: cleanup 'updown' test Alexey Kodanev
2015-02-13 12:07 ` [LTP] [PATCH 11/11] network/stress/interface: delete if6-* Alexey Kodanev
2015-06-11 11:20 ` [LTP] [PATCH 1/11] network/stress/interface: rename if4-* tests Alexey Kodanev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox