--- testcases/network/iproute/ip_tests.sh | 41 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/testcases/network/iproute/ip_tests.sh b/testcases/network/iproute/ip_tests.sh index ed20540..e5c5035 100755 --- a/testcases/network/iproute/ip_tests.sh +++ b/testcases/network/iproute/ip_tests.sh @@ -108,21 +108,21 @@ init() tst_resm TINFO "INIT: Inititalizing tests." # Aliasing eth0 to create private network. - /sbin/ifconfig eth0:1 10.1.1.12 >$LTPTMP/tst_ip.err 2>&1 + /sbin/ifconfig ${TEST_IFACE}:1 10.1.1.12 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -ne 0 ] then - tst_brk TBROK NULL NULL "INIT: failed aliasing eth0:1 with IP 10.1.1.12" + tst_brk TBROK NULL NULL "INIT: failed aliasing ${TEST_IFACE}:1 with IP 10.1.1.12" return $RC else - /sbin/route add -host 10.1.1.12 dev eth0:1 >$LTPTMP/tst_ip.err 2>&1 + /sbin/route add -host 10.1.1.12 dev ${TEST_IFACE}:1 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -ne 0 ] then tst_brk TBROK NULL NULL "INIT: failed adding route to 10.1.1.12" return $RC else - tst_resm TINFO "INIT: added alias: `ifconfig eth0:1`" + tst_resm TINFO "INIT: added alias: `ifconfig ${TEST_IFACE}:1`" fi fi @@ -157,11 +157,11 @@ cleanup() TCID=dhcpd TST_COUNT=0 - /sbin/ifconfig eth0:1 >$LTPTMP/tst_ip.err 2>&1 + /sbin/ifconfig ${TEST_IFACE}:1 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -eq 0 ] then - /sbin/ifconfig eth0:1 down >$LTPTMP/tst_ip.err 2>&1 + /sbin/ifconfig ${TEST_IFACE}:1 down >$LTPTMP/tst_ip.err 2>&1 fi rm -fr $LTPTMP @@ -189,22 +189,22 @@ test01() tst_resm TINFO \ "Test #1: ip link set DEVICE mtu MTU changes the device mtu size" - tst_resm TINFO "Test #1: changing mtu size of eth0:1 device." + tst_resm TINFO "Test #1: changing mtu size of ${TEST_IFACE}:1 device." - MTUSZ_BAK=`ifconfig eth0:1 | grep -i MTU | sed "s/^.*MTU://" \ + MTUSZ_BAK=`ifconfig ${TEST_IFACE}:1 | grep -i MTU | sed "s/^.*MTU://" \ | awk '{print $1}'` - ip link set eth0:1 mtu 300 >$LTPTMP/tst_ip.err 2>&1 + ip link set ${TEST_IFACE}:1 mtu 300 >$LTPTMP/tst_ip.err 2>&1 if [ $RC -ne 0 ] then tst_res TFAIL $LTPTMP/tst_ip.err \ "Test #1: ip command failed. Reason: " return $RC else - MTUSZ=`ifconfig eth0:1 | grep -i MTU | sed "s/^.*MTU://" | awk '{print $1}'` + MTUSZ=`ifconfig ${TEST_IFACE}:1 | grep -i MTU | sed "s/^.*MTU://" | awk '{print $1}'` if [ $MTUSZ -eq 300 ] then tst_resm TPASS "Test #1: changing mtu size success" - ip link set eth0:1 mtu $MTUSZ_BAK \ + ip link set ${TEST_IFACE}:1 mtu $MTUSZ_BAK \ >$LTPTMP/tst_ip.err 2>&1 else tst_resm FAIL NULL \ @@ -256,7 +256,7 @@ test02() return $RC else tst_resm TPASS \ - "Test #2: Listed eth0:1 and returned correct attributes" + "Test #2: Listed ${TEST_IFACE}:1 and returned correct attributes" fi return $RC } @@ -443,14 +443,14 @@ test05() tst_resm TINFO \ - "Test #5: create an interface with inet 10.6.6.6 alias to eth0" + "Test #5: create an interface with inet 10.6.6.6 alias to ${TEST_IFACE}" - ifconfig eth0:1 10.6.6.6 netmask 255.255.255.0 >$LTPTMP/tst_ip.err 2>&1 + ifconfig ${TEST_IFACE}:1 10.6.6.6 netmask 255.255.255.0 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -ne 0 ] then tst_brk TBROK $LTPTMP/tst_ip.err NULL \ - "Test #5: unable to create interface eth0:1 inet 10.6.6.6. Reason:" + "Test #5: unable to create interface ${TEST_IFACE}:1 inet 10.6.6.6. Reason:" return $RC fi @@ -541,16 +541,16 @@ test06() tst_resm TINFO \ "Test #6: ip maddr add - adds a new multicast addr" - ifconfig eth0:1 10.6.6.6 netmask 255.255.255.0 >$LTPTMP/tst_ip.err 2>&1 + ifconfig ${TEST_IFACE}:1 10.6.6.6 netmask 255.255.255.0 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -ne 0 ] then tst_brk TBROK $LTPTMP/tst_ip.err NULL \ - "Test #6: unable to create interface eth0:1 inet 10.6.6.6. Reason:" + "Test #6: unable to create interface ${TEST_IFACE}:1 inet 10.6.6.6. Reason:" return $RC fi - ip maddr add 66:66:00:00:00:66 dev eth0:1 >$LTPTMP/tst_ip.err 2>&1 + ip maddr add 66:66:00:00:00:66 dev ${TEST_IFACE}:1 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -ne 0 ] then @@ -579,7 +579,7 @@ test06() if [ $RC -ne 0 ] then tst_res FAIL $LTPTMP/tst_ip.err \ - "Test #6: multicast addr not added to eth0:1. Details:" + "Test #6: multicast addr not added to ${TEST_IFACE}:1. Details:" return $RC fi fi @@ -587,7 +587,7 @@ test06() tst_resm TINFO \ "Test #6: ip maddr del - deletes multicast addr." - ip maddr del 66:66:00:00:00:66 dev eth0:1 >$LTPTMP/tst_ip.err 2>&1 + ip maddr del 66:66:00:00:00:66 dev ${TEST_IFACE}:1 >$LTPTMP/tst_ip.err 2>&1 RC=$? if [ $RC -ne 0 ] then @@ -620,6 +620,7 @@ test06() # Exit: - zero on success # - non-zero on failure. TFAILCNT=0 # Set TFAILCNT to 0, increment on failure. +TEST_IFACE=${TEST_IFACE:-"eth0"} init || exit $RC -- 1.9.3 ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list