Add some additional config regress tests. Testing neighbor, group and rdomain.
authorclaudio <claudio@openbsd.org>
Sat, 8 Sep 2018 12:32:01 +0000 (12:32 +0000)
committerclaudio <claudio@openbsd.org>
Sat, 8 Sep 2018 12:32:01 +0000 (12:32 +0000)
regress/usr.sbin/bgpd/config/Makefile
regress/usr.sbin/bgpd/config/bgpd.conf.4.in [new file with mode: 0644]
regress/usr.sbin/bgpd/config/bgpd.conf.4.ok [new file with mode: 0644]
regress/usr.sbin/bgpd/config/bgpd.conf.5.in [new file with mode: 0644]
regress/usr.sbin/bgpd/config/bgpd.conf.5.ok [new file with mode: 0644]

index 4181cbb..2938a36 100644 (file)
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.2 2018/09/08 09:18:34 benno Exp $
+# $OpenBSD: Makefile,v 1.3 2018/09/08 12:32:01 claudio Exp $
 
-BGPDTESTS=1 2 3
+BGPDTESTS=1 2 3 4 5
 
 REGRESS_TARGETS = config
 
diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.4.in b/regress/usr.sbin/bgpd/config/bgpd.conf.4.in
new file mode 100644 (file)
index 0000000..0fc9d60
--- /dev/null
@@ -0,0 +1,41 @@
+# $OpenBSD: bgpd.conf.4.in,v 1.1 2018/09/08 12:32:01 claudio Exp $
+# test neighbor and group statements
+
+AS 1
+
+neighbor 192.0.2.1 {
+       remote-as       64496
+}
+#notyet neighbor 192.0.2.2 { remote-as 64496 }
+
+neighbor 192.0.2.3 {
+       # test comment
+       remote-as       64496
+       descr           "test-peer"
+}
+
+group testing {
+       remote-as       64496
+
+       neighbor 192.0.2.4
+       #notyet neighbor 192.0.2.5 { descr "test2-peer" }
+       neighbor 192.0.2.6 {
+               remote-as 64497
+               descr "test2-peer"
+
+
+       }
+       #notyet neighbor 192.0.2.7 {
+               # comment
+
+               # another comment
+       #notyet }
+       neighbor 192.0.2.8
+}
+
+group test2 {
+       remote-as 64497
+
+       neighbor 192.0.2.10
+       #notyet neighbor 192.0.2.11 { descr "test3-peer" }
+}
diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok
new file mode 100644 (file)
index 0000000..872b5bf
--- /dev/null
@@ -0,0 +1,57 @@
+AS 1
+router-id 127.0.0.1
+socket "/var/run/bgpd.sock.0"
+holdtime min 3
+fib-priority 48
+
+
+rde rib Adj-RIB-In no evaluate
+rde rib Adj-RIB-Out no evaluate
+rde rib Loc-RIB rtable 0 fib-update yes
+
+
+neighbor 192.0.2.3 {
+       descr "test-peer"
+       remote-as 64496
+       enforce neighbor-as yes
+       enforce local-as yes
+       announce IPv4 unicast
+}
+neighbor 192.0.2.1 {
+       remote-as 64496
+       enforce neighbor-as yes
+       enforce local-as yes
+       announce IPv4 unicast
+}
+group "testing" {
+       neighbor 192.0.2.8 {
+               remote-as 64496
+               enforce neighbor-as yes
+               enforce local-as yes
+               announce IPv4 unicast
+       }
+       neighbor 192.0.2.6 {
+               descr "test2-peer"
+               remote-as 64497
+               enforce neighbor-as yes
+               enforce local-as yes
+               announce IPv4 unicast
+       }
+       neighbor 192.0.2.4 {
+               remote-as 64496
+               enforce neighbor-as yes
+               enforce local-as yes
+               announce IPv4 unicast
+       }
+}
+
+group "test2" {
+       neighbor 192.0.2.10 {
+               remote-as 64497
+               enforce neighbor-as yes
+               enforce local-as yes
+               announce IPv4 unicast
+       }
+}
+
+
diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.5.in b/regress/usr.sbin/bgpd/config/bgpd.conf.5.in
new file mode 100644 (file)
index 0000000..f08e5c3
--- /dev/null
@@ -0,0 +1,37 @@
+# $OpenBSD: bgpd.conf.5.in,v 1.1 2018/09/08 12:32:01 claudio Exp $
+# test rdomain statement
+
+AS 1
+
+# example from the man page
+rdomain 1 {
+       descr "a rdomain"
+       rd 65002:1
+       import-target rt 65002:42
+       export-target rt 65002:42
+       network 192.0.2/24
+       depend on mpe0
+}
+
+rdomain 2 {
+       rd 1:2
+}
+
+rdomain 3 {
+       rd 1:3
+
+       # some comment
+       descr "test-rdomain"
+}
+
+rdomain 4 {
+       depend on mpe1
+       descr "test-full"
+       export-target rt 65002:42
+       export-target rt 192.0.2.3:42
+       fib-update no
+       import-target rt 65002:21
+       import-target rt 192.0.2.3:21
+       network 192.0.2.32/27
+       rd 192.0.2.4:1
+}
diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.5.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.5.ok
new file mode 100644 (file)
index 0000000..bbeba06
--- /dev/null
@@ -0,0 +1,48 @@
+AS 1
+router-id 127.0.0.1
+socket "/var/run/bgpd.sock.0"
+holdtime min 3
+fib-priority 48
+
+rdomain 1 {
+       descr "a rdomain"
+       fib-update yes
+       depend on mpe0
+       network 192.0.2.0/24
+
+       rd 65002:1
+       export-target rt 65002:42 
+       import-target rt 65002:42 
+}
+rdomain 2 {
+       fib-update yes
+       depend on 
+
+       rd 1:2
+}
+rdomain 3 {
+       descr "test-rdomain"
+       fib-update yes
+       depend on 
+
+       rd 1:3
+}
+rdomain 4 {
+       descr "test-full"
+       fib-update no
+       depend on mpe1
+       network 192.0.2.32/27
+
+       rd 192.0.2.4:1
+       export-target rt 65002:42 
+       export-target rt 192.0.2.3:42 
+       import-target rt 65002:21 
+       import-target rt 192.0.2.3:21 
+}
+
+rde rib Adj-RIB-In no evaluate
+rde rib Adj-RIB-Out no evaluate
+rde rib Loc-RIB rtable 0 fib-update yes
+
+
+