OSDN Git Service

Merge tag 'android-8.1.0_r1' into oreo-x86
[android-x86/external-toybox.git] / tests / ifconfig.test
index 0c0af46..34fcde0 100755 (executable)
@@ -23,7 +23,7 @@
 
 if [ "$(id -u)" -ne 0 ]
 then
-  echo "SKIPPED: ifconfig (not root)"
+  echo "$SHOWSKIP: ifconfig (not root)"
   continue 2>/dev/null
   exit
 fi
@@ -35,76 +35,76 @@ ifconfig dummy0 up
 
 # Test Description: Disable the dummy0 interface
 # Results Expected: After calling ifconfig, no lines with dummy0 are displayed
-testing "ifconfig dummy0 down and if config /-only" \
+testing "dummy0 down and if config /-only" \
 "ifconfig dummy0 down && ifconfig dummy0 | grep dummy | wc -l" \
 "0\n" "" ""
 
 # Test Description: Enable the dummy0 interface
 # Results Expected: After calling ifconfig, one line with dummy0 is displayed
-testing "ifconfig dummy0 up" \
+testing "dummy0 up" \
 "ifconfig dummy0 up && ifconfig dummy0 | grep dummy | wc -l" \
 "1\n" "" ""
 
 # Test Description: Set the ip address of the dummy0 interface
 # Results Expected: After calling ifconfig dummy0, one line displays the ip
 #                   address selected
-testing "ifconfig dummy0 10.240.240.240" \
+testing "dummy0 10.240.240.240" \
 "ifconfig dummy0 10.240.240.240 && ifconfig dummy0 | grep 10\.240\.240\.240 | wc -l" \
 "1\n" "" ""
 
 # Test Description: Change the netmask to the interface
 # Results Expected: After calling ifconfig dummy0, one line displays the
 #                   netmask selected
-testing "ifconfig dummy0 netmask 255.255.240.0" \
+testing "dummy0 netmask 255.255.240.0" \
 "ifconfig dummy0 netmask 255.255.240.0 && ifconfig dummy0 | grep 255\.255\.240\.0 | wc -l" \
 "1\n" "" ""
 
 # Test Description: Change the broadcast address to the interface
 # Results Expected: After calling ifconfig dummy0, one line displays the
 #                   broadcast address selected
-testing "ifconfig dummy0 broadcast 10.240.240.255" \
+testing "dummy0 broadcast 10.240.240.255" \
 "ifconfig dummy0 broadcast 10.240.240.255 && ifconfig dummy0 | grep 10\.240\.240\.255 | wc -l" \
 "1\n" "" ""
 
 # Test Description: Revert to the default ip address
 # Results Expected: After calling ifconfig dummy0, there are no lines
 #                   displaying the ip address previously selected
-testing "ifconfig dummy0 default" \
+testing "dummy0 default" \
 "ifconfig dummy0 default && ifconfig dummy0 | grep 10\.240\.240\.240 | wc -l" \
 "0\n" "" ""
 
 # Test Description: Change the Maximum transmission unit (MTU) of the interface
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   selected MTU
-testing "ifconfig dummy0 mtu 1269" \
+testing "dummy0 mtu 1269" \
 "ifconfig dummy0 mtu 1269 && ifconfig dummy0 | grep 1269 | wc -l" \
 "1\n" "" ""
 
 # Test Description: Verify ifconfig add fails with such a small mtu
 # Results Expected: There is one line of error message containing
 #                   "No buffer space available"
-testing "ifconfig dummy0 add ::2 -- too small mtu" \
+testing "dummy0 add ::2 -- too small mtu" \
 "ifconfig dummy0 add ::2 2>&1 | grep No\ buffer\ space\ available | wc -l" \
 "1\n" "" ""
 
 # Test Description: Change the Maximum transmission unit (MTU) of the interface
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   selected MTU
-testing "ifconfig dummy0 mtu 2000" \
+testing "dummy0 mtu 2000" \
 "ifconfig dummy0 mtu 2000 && ifconfig dummy0 | grep 2000 | wc -l" \
 "1\n" "" ""
 
 # Test Description: Verify ifconfig add succeeds with a larger mtu
 # Results Expected: after calling ifconfig dummy0, there is one line with the
 #                   selected ip address
-testing "ifconfig dummy0 add ::2" \
+testing "dummy0 add ::2" \
 "ifconfig dummy0 add ::2/126 && ifconfig dummy0 | grep \:\:2\/126 | wc -l" \
 "1\n" "" ""
 
 # Test Description: Verify ifconfig del removes the selected ip6 address
 # Results Expected: after calling ifconfig dummy0, there are no lines with the
 #                   selected ip address
-testing "ifconfig dummy0 del ::2" \
+testing "dummy0 del ::2" \
 "ifconfig dummy0 del ::2/126 && ifconfig dummy0 | grep \:\:2 | wc -l" \
 "0\n" "" ""
 
@@ -112,21 +112,21 @@ testing "ifconfig dummy0 del ::2" \
 #                   preparation for the next test
 # Results Expected: After calling ifconfig dummy0, there are no lines with the
 #                   NOARP flag
-testing "ifconfig dummy0 arp down" \
+testing "dummy0 arp down" \
 "ifconfig dummy0 arp down && ifconfig dummy0 | grep -i NOARP | wc -l" \
 "0\n" "" ""
 
 # Test Description: Call the pointtopoint option with no argument
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   NOARP and UP flags
-testing "ifconfig dummy0 pointtopoint" \
+testing "dummy0 pointtopoint" \
 "ifconfig dummy0 pointtopoint && ifconfig dummy0 | grep -i NOARP | grep -i UP | wc -l" \
 "1\n" "" ""
 
 # Test Description: Test the pointtopoint option and set the ipaddress
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   word inet and the selected ip address
-testing "ifconfig dummy0 pointtopoint 127.0.0.2" \
+testing "dummy0 pointtopoint 127.0.0.2" \
 "ifconfig dummy0 pointtopoint 127.0.0.2 && ifconfig dummy0 | grep -i inet | grep -i 127\.0\.0\.2 | wc -l" \
 "1\n" "" ""
 
@@ -135,56 +135,56 @@ testing "ifconfig dummy0 pointtopoint 127.0.0.2" \
 # Test Description: Enable allmulti mode on the interface
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   allmulti flag
-testing "ifconfig dummy0 allmulti" \
+testing "dummy0 allmulti" \
 "ifconfig dummy0 allmulti && ifconfig dummy0 | grep -i allmulti | wc -l" "1\n" \
 "" ""
 
 # Test Description: Disable multicast mode the interface
 # Results Expected: After calling ifconfig dummy0, there are no lines with the
 #                   allmulti flag
-testing "ifconfig dummy0 -allmulti" \
+testing "dummy0 -allmulti" \
 "ifconfig dummy0 -allmulti && ifconfig dummy0 | grep -i allmulti | wc -l" "0\n" \
 "" ""
 
 # Test Description: Disable NOARP mode on the interface
 # Results Expected: After calling ifconfig dummy0, there are no lines with the
 #                   NOARP flag
-testing "ifconfig dummy0 arp" \
+testing "dummy0 arp" \
 "ifconfig dummy0 arp && ifconfig dummy0 | grep -i NOARP | wc -l" "0\n" \
 "" ""
 
 # Test Description: Enable NOARP mode on the interface
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   NOARP flag
-testing "ifconfig dummy0 -arp" \
+testing "dummy0 -arp" \
 "ifconfig dummy0 -arp && ifconfig dummy0 | grep -i NOARP | wc -l" "1\n" \
 "" ""
 
 # Test Description: Enable multicast mode on the interface
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   multicast flag
-testing "ifconfig dummy0 multicast" \
+testing "dummy0 multicast" \
 "ifconfig dummy0 multicast && ifconfig dummy0 | grep -i multicast | wc -l" \
 "1\n" "" ""
 
 # Test Description: Disable multicast mode the interface
 # Results Expected: After calling ifconfig dummy0, there are no lines with the
 #                   multicast flag
-testing "ifconfig dummy0 -multicast" \
+testing "dummy0 -multicast" \
 "ifconfig dummy0 -multicast && ifconfig dummy0 | grep -i multicast | wc -l" \
 "0\n" "" ""
 
 # Test Description: Enable promiscuous mode the interface
 # Results Expected: After calling ifconfig dummy0, there is one line with the
 #                   promisc flag
-testing "ifconfig dummy0 promisc" \
+testing "dummy0 promisc" \
 "ifconfig dummy0 promisc && ifconfig dummy0 | grep -i promisc | wc -l" "1\n" \
 "" ""
 
 # Disable promiscuous mode the interface
 # Results Expected: After calling ifconfig dummy0, there are no lines with the
 #                   promisc flag
-testing "ifconfig dummy0 -promisc" \
+testing "dummy0 -promisc" \
 "ifconfig dummy0 -promisc && ifconfig dummy0 | grep -i promisc | wc -l" "0\n" \
 "" ""