Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/netinet/fibs_test.sh
| Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | default_route_with_multiple_fibs_on_same_subnet_body() | ||||
| TAP1=$TAP | TAP1=$TAP | ||||
| # Attempt to add default routes | # Attempt to add default routes | ||||
| setfib ${FIB0} route add default ${GATEWAY} | setfib ${FIB0} route add default ${GATEWAY} | ||||
| setfib ${FIB1} route add default ${GATEWAY} | setfib ${FIB1} route add default ${GATEWAY} | ||||
| # Verify that the default route exists for both fibs, with their | # Verify that the default route exists for both fibs, with their | ||||
| # respective interfaces. | # respective interfaces. | ||||
| atf_check -o match:"^0\.0\.0\.0.*${TAP0}$" \ | atf_check -o match:"^default.*${TAP0}$" \ | ||||
| setfib ${FIB0} netstat -rn -f inet | setfib ${FIB0} netstat -rn -f inet | ||||
| atf_check -o match:"^0\.0\.0\.0.*${TAP1}$" \ | atf_check -o match:"^default.*${TAP1}$" \ | ||||
| setfib ${FIB1} netstat -rn -f inet | setfib ${FIB1} netstat -rn -f inet | ||||
| } | } | ||||
| default_route_with_multiple_fibs_on_same_subnet_cleanup() | default_route_with_multiple_fibs_on_same_subnet_cleanup() | ||||
| { | { | ||||
| cleanup_ifaces | cleanup_ifaces | ||||
| } | } | ||||
| Show All 27 Lines | default_route_with_multiple_fibs_on_same_subnet_inet6_body() | ||||
| TAP1=$TAP | TAP1=$TAP | ||||
| # Attempt to add default routes | # Attempt to add default routes | ||||
| setfib ${FIB0} route -6 add default ${GATEWAY} | setfib ${FIB0} route -6 add default ${GATEWAY} | ||||
| setfib ${FIB1} route -6 add default ${GATEWAY} | setfib ${FIB1} route -6 add default ${GATEWAY} | ||||
| # Verify that the default route exists for both fibs, with their | # Verify that the default route exists for both fibs, with their | ||||
| # respective interfaces. | # respective interfaces. | ||||
| atf_check -o match:"^::/0.*${TAP0}$" \ | atf_check -o match:"^default.*${TAP0}$" \ | ||||
| setfib ${FIB0} netstat -rn -f inet6 | setfib ${FIB0} netstat -rn -f inet6 | ||||
| atf_check -o match:"^::/0.*${TAP1}$" \ | atf_check -o match:"^default.*${TAP1}$" \ | ||||
| setfib ${FIB1} netstat -rn -f inet6 | setfib ${FIB1} netstat -rn -f inet6 | ||||
| } | } | ||||
| default_route_with_multiple_fibs_on_same_subnet_inet6_cleanup() | default_route_with_multiple_fibs_on_same_subnet_inet6_cleanup() | ||||
| { | { | ||||
| cleanup_ifaces | cleanup_ifaces | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | atf_check -o match:"inet6 ${SUBNET}.*prefixlen ${MASK}.*autoconf" \ | ||||
| ifconfig "$EPAIRB" | ifconfig "$EPAIRB" | ||||
| # Check local route | # Check local route | ||||
| atf_check -o match:"${SUBNET}.*\<UHS\>.*lo0" \ | atf_check -o match:"${SUBNET}.*\<UHS\>.*lo0" \ | ||||
| netstat -rnf inet6 -F $FIB1 | netstat -rnf inet6 -F $FIB1 | ||||
| # Check subnet route | # Check subnet route | ||||
| atf_check -o match:"${SUBNET}:/${MASK}.*\<U\>.*$EPAIRB" \ | atf_check -o match:"${SUBNET}:/${MASK}.*\<U\>.*$EPAIRB" \ | ||||
| netstat -rnf inet6 -F $FIB1 | netstat -rnf inet6 -F $FIB1 | ||||
| # Check default route | # Check default route | ||||
| atf_check -o match:"^::/0.*\<UG\>.*$EPAIRB" \ | atf_check -o match:"default.*\<UG\>.*$EPAIRB" \ | ||||
| netstat -rnf inet6 -F $FIB1 | netstat -rnf inet6 -F $FIB1 | ||||
| # Check that none of the above routes appeared on other routes | # Check that none of the above routes appeared on other routes | ||||
| for fib in $( seq 0 $(($(sysctl -n net.fibs) - 1))); do | for fib in $( seq 0 $(($(sysctl -n net.fibs) - 1))); do | ||||
| if [ "$fib" = "$FIB1" -o "$fib" = "$FIB0" ]; then | if [ "$fib" = "$FIB1" -o "$fib" = "$FIB0" ]; then | ||||
| continue | continue | ||||
| fi | fi | ||||
| atf_check -o not-match:"${SUBNET}.*\<UHS\>.*lo0" \ | atf_check -o not-match:"${SUBNET}.*\<UHS\>.*lo0" \ | ||||
| ▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines | |||||