diff options
author | asou <asou@cvs.openbsd.org> | 2019-03-30 04:10:35 +0000 |
---|---|---|
committer | asou <asou@cvs.openbsd.org> | 2019-03-30 04:10:35 +0000 |
commit | 9b00d2e0e86b228df655d959d163dcc922e98f4f (patch) | |
tree | 0b873bfe387ac77b68c1c74f1844ef0306f34fb8 /regress/sbin | |
parent | 74691204aab14709482b9197635fb357a868dcdb (diff) |
Add 5 test cases for
- adding default route with "deault"
- adding default route with "0.0.0.0/0"
- adding 0.0.0.0 route
- adding routes with mask
ok yasuoka
Diffstat (limited to 'regress/sbin')
-rw-r--r-- | regress/sbin/route/Makefile | 70 | ||||
-rw-r--r-- | regress/sbin/route/rttest34.ok | 13 | ||||
-rw-r--r-- | regress/sbin/route/rttest35.ok | 13 | ||||
-rw-r--r-- | regress/sbin/route/rttest36.ok | 13 | ||||
-rw-r--r-- | regress/sbin/route/rttest37.ok | 17 | ||||
-rw-r--r-- | regress/sbin/route/rttest38.ok | 20 |
6 files changed, 145 insertions, 1 deletions
diff --git a/regress/sbin/route/Makefile b/regress/sbin/route/Makefile index 88222e13db1..9e9e724b064 100644 --- a/regress/sbin/route/Makefile +++ b/regress/sbin/route/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.30 2018/06/04 19:22:13 kn Exp $ +# $OpenBSD: Makefile,v 1.31 2019/03/30 04:10:34 asou Exp $ ROUTE?= /sbin/route RDOMAIN?= 5 @@ -396,6 +396,74 @@ rttest${n}: sed -e "s,link\#[0-9 ]*U,link# U," | \ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin +# Check that add default route. +n= 34 +RTTEST_TARGETS+:=rttest${n} +rttest${n}: + ${SUDO} ifconfig vether99 rdomain ${RDOMAIN} lladdr fe:e1:ba:d4:c8:1d up + ${SUDO} ifconfig vether99 192.168.71.10 + ${RCMD} add default 192.168.71.1 + ${RCMD} show -inet 2>&1 | \ + sed -e "s,link\#[0-9 ]*U,link# U," | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# Check that add 0.0.0.0/0 (default) route. +n= 35 +RTTEST_TARGETS+:=rttest${n} +rttest${n}: + ${SUDO} ifconfig vether99 rdomain ${RDOMAIN} lladdr fe:e1:ba:d4:c8:1d up + ${SUDO} ifconfig vether99 192.168.3.23 + ${RCMD} add 0.0.0.0/0 192.168.3.1 + ${RCMD} show -inet 2>&1 | \ + sed -e "s,link\#[0-9 ]*U,link# U," | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# Check that add 0.0.0.0 (not specified "/0", not default) route. +n= 36 +RTTEST_TARGETS+:=rttest${n} +rttest${n}: + ${SUDO} ifconfig vether99 rdomain ${RDOMAIN} lladdr fe:e1:ba:d4:c8:1d up + ${SUDO} ifconfig vether99 192.168.89.5 + ${RCMD} add 0.0.0.0 192.168.89.1 + ${RCMD} show -inet 2>&1 | \ + sed -e "s,link\#[0-9 ]*U,link# U," | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# check that specified mask. +n= 37 +RTTEST_TARGETS+:=rttest${n} +rttest${n}: + ${RCMD} add 10.1.0.2/24 192.0.2.1 + ${RCMD} add 10.2.1.8/16 192.0.2.2 + ${RCMD} add 10.3.5.7/8 192.0.2.3 + ${RCMD} add 172.25.8.3/24 192.0.2.1 + ${RCMD} add 172.30.2.5/16 192.0.2.2 + ${RCMD} add 172.21.4.7/8 192.0.2.3 + ${RCMD} add 192.168.5.3/24 192.0.2.1 + ${RCMD} add 192.168.9.8/16 192.0.2.2 + ${RCMD} add 192.168.1.7/8 192.0.2.3 + ${RCMD} show -inet 2>&1 | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + +# check that not specified mask. +n= 38 +RTTEST_TARGETS+:=rttest${n} +rttest${n}: + ${RCMD} add 10.0.0.5 192.0.2.1 + ${RCMD} add 10.4.2 192.0.2.2 + ${RCMD} add 10.5 192.0.2.3 + ${RCMD} add 10 192.0.2.4 + ${RCMD} add 172.16.1.8 192.0.2.1 + ${RCMD} add 172.17.2 192.0.2.2 + ${RCMD} add 172.28 192.0.2.3 + ${RCMD} add 172 192.0.2.4 + ${RCMD} add 192.168.7.9 192.0.2.1 + ${RCMD} add 192.168.2 192.0.2.2 + ${RCMD} add 192.168 192.0.2.3 + ${RCMD} add 192 192.0.2.4 + ${RCMD} show -inet 2>&1 | \ + diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin + REGRESS_TARGETS=netmask ${RTTEST_TARGETS} REGRESS_ROOT_TARGETS=${REGRESS_TARGETS} .PHONY: ${REGRESS_TARGETS} diff --git a/regress/sbin/route/rttest34.ok b/regress/sbin/route/rttest34.ok new file mode 100644 index 00000000000..2a7bcdf43b0 --- /dev/null +++ b/regress/sbin/route/rttest34.ok @@ -0,0 +1,13 @@ +Routing tables + +Internet: +Destination Gateway Flags Refs Use Mtu Prio Iface +default 192.168.71.1 UGS 0 0 - 8 vether99 +192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001 +192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002 +192.0.2.3 192.0.2.3 UHl 0 0 32768 1 lo10003 +192.0.2.4 192.0.2.4 UHl 0 0 32768 1 lo10004 +192.168.71/24 192.168.71.10 UCn 1 0 - 4 vether99 +192.168.71.1 link# UHLch 1 2 - 3 vether99 +192.168.71.10 fe:e1:ba:d4:c8:1d UHLl 0 0 - 1 vether99 +192.168.71.255 192.168.71.10 UHb 0 0 - 1 vether99 diff --git a/regress/sbin/route/rttest35.ok b/regress/sbin/route/rttest35.ok new file mode 100644 index 00000000000..3e5e93c06fb --- /dev/null +++ b/regress/sbin/route/rttest35.ok @@ -0,0 +1,13 @@ +Routing tables + +Internet: +Destination Gateway Flags Refs Use Mtu Prio Iface +default 192.168.3.1 UGS 0 0 - 8 vether99 +192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001 +192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002 +192.0.2.3 192.0.2.3 UHl 0 0 32768 1 lo10003 +192.0.2.4 192.0.2.4 UHl 0 0 32768 1 lo10004 +192.168.3/24 192.168.3.23 UCn 1 0 - 4 vether99 +192.168.3.1 link# UHLch 1 2 - 3 vether99 +192.168.3.23 fe:e1:ba:d4:c8:1d UHLl 0 0 - 1 vether99 +192.168.3.255 192.168.3.23 UHb 0 0 - 1 vether99 diff --git a/regress/sbin/route/rttest36.ok b/regress/sbin/route/rttest36.ok new file mode 100644 index 00000000000..3d66ce3cf9f --- /dev/null +++ b/regress/sbin/route/rttest36.ok @@ -0,0 +1,13 @@ +Routing tables + +Internet: +Destination Gateway Flags Refs Use Mtu Prio Iface +0.0.0.0 192.168.89.1 UGHS 0 0 - 8 vether99 +192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001 +192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002 +192.0.2.3 192.0.2.3 UHl 0 0 32768 1 lo10003 +192.0.2.4 192.0.2.4 UHl 0 0 32768 1 lo10004 +192.168.89/24 192.168.89.5 UCn 1 0 - 4 vether99 +192.168.89.1 link# UHLch 1 2 - 3 vether99 +192.168.89.5 fe:e1:ba:d4:c8:1d UHLl 0 0 - 1 vether99 +192.168.89.255 192.168.89.5 UHb 0 0 - 1 vether99 diff --git a/regress/sbin/route/rttest37.ok b/regress/sbin/route/rttest37.ok new file mode 100644 index 00000000000..7620548d2e5 --- /dev/null +++ b/regress/sbin/route/rttest37.ok @@ -0,0 +1,17 @@ +Routing tables + +Internet: +Destination Gateway Flags Refs Use Mtu Prio Iface +10/8 192.0.2.3 UGS 0 0 32768 8 lo10003 +10.1.0/24 192.0.2.1 UGS 0 0 32768 8 lo10001 +10.2/16 192.0.2.2 UGS 0 0 32768 8 lo10002 +172/8 192.0.2.3 UGS 0 0 32768 8 lo10003 +172.25.8/24 192.0.2.1 UGS 0 0 32768 8 lo10001 +172.30/16 192.0.2.2 UGS 0 0 32768 8 lo10002 +192/8 192.0.2.3 UGS 0 0 32768 8 lo10003 +192.0.2.1 192.0.2.1 UHhl 3 6 32768 1 lo10001 +192.0.2.2 192.0.2.2 UHhl 3 6 32768 1 lo10002 +192.0.2.3 192.0.2.3 UHhl 3 6 32768 1 lo10003 +192.0.2.4 192.0.2.4 UHl 0 0 32768 1 lo10004 +192.168/16 192.0.2.2 UGS 0 0 32768 8 lo10002 +192.168.5/24 192.0.2.1 UGS 0 0 32768 8 lo10001 diff --git a/regress/sbin/route/rttest38.ok b/regress/sbin/route/rttest38.ok new file mode 100644 index 00000000000..40b09d2e9a7 --- /dev/null +++ b/regress/sbin/route/rttest38.ok @@ -0,0 +1,20 @@ +Routing tables + +Internet: +Destination Gateway Flags Refs Use Mtu Prio Iface +10/8 192.0.2.4 UGS 0 0 32768 8 lo10004 +10.0.0.5 192.0.2.1 UGHS 0 0 32768 8 lo10001 +10.4.2/24 192.0.2.2 UGS 0 0 32768 8 lo10002 +10.5/16 192.0.2.3 UGS 0 0 32768 8 lo10003 +172.0/16 192.0.2.4 UGS 0 0 32768 8 lo10004 +172.16.1.8 192.0.2.1 UGHS 0 0 32768 8 lo10001 +172.17.2/24 192.0.2.2 UGS 0 0 32768 8 lo10002 +172.28/16 192.0.2.3 UGS 0 0 32768 8 lo10003 +192.0.0/24 192.0.2.4 UGS 0 0 32768 8 lo10004 +192.0.2.1 192.0.2.1 UHhl 3 6 32768 1 lo10001 +192.0.2.2 192.0.2.2 UHhl 3 6 32768 1 lo10002 +192.0.2.3 192.0.2.3 UHhl 3 6 32768 1 lo10003 +192.0.2.4 192.0.2.4 UHhl 3 6 32768 1 lo10004 +192.168.0/24 192.0.2.3 UGS 0 0 32768 8 lo10003 +192.168.2/24 192.0.2.2 UGS 0 0 32768 8 lo10002 +192.168.7.9 192.0.2.1 UGHS 0 0 32768 8 lo10001 |