From 08ee75849436ccf09bf924cef81898f584667268 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 9 Apr 2024 09:33:46 +0000 Subject: [PATCH] Add capability announce enforcement test and fixup some other result files since the role capability is now shown in more cases. --- regress/usr.sbin/bgpd/config/Makefile | 4 +- regress/usr.sbin/bgpd/config/bgpd.conf.12.ok | 3 + regress/usr.sbin/bgpd/config/bgpd.conf.13.ok | 12 ++++ regress/usr.sbin/bgpd/config/bgpd.conf.15.ok | 2 + regress/usr.sbin/bgpd/config/bgpd.conf.16.in | 59 ++++++++++++++++++++ regress/usr.sbin/bgpd/config/bgpd.conf.16.ok | 53 ++++++++++++++++++ regress/usr.sbin/bgpd/config/bgpd.conf.3.ok | 1 + regress/usr.sbin/bgpd/config/bgpd.conf.4.ok | 10 ++++ 8 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.16.in create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.16.ok diff --git a/regress/usr.sbin/bgpd/config/Makefile b/regress/usr.sbin/bgpd/config/Makefile index 263b09f5dfa..97a69be6b72 100644 --- a/regress/usr.sbin/bgpd/config/Makefile +++ b/regress/usr.sbin/bgpd/config/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.13 2023/04/12 09:09:41 claudio Exp $ +# $OpenBSD: Makefile,v 1.14 2024/04/09 09:33:46 claudio Exp $ -BGPDTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +BGPDTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 .for n in ${BGPDTESTS} BGPD_TARGETS+=bgpd${n} diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok index 07156ee40f7..286fc63c50a 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok @@ -14,6 +14,7 @@ neighbor 127.0.0.2 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 127.0.0.3 { remote-as 3 @@ -21,10 +22,12 @@ neighbor 127.0.0.3 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 127.0.0.4 { remote-as 4 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok index b3df41178e0..e593726855b 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok @@ -13,18 +13,21 @@ neighbor 2001:db8:abcd::7 { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.5 { remote-as 5 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::5 { remote-as 5 enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.6 { remote-as 6 @@ -33,6 +36,7 @@ neighbor 192.0.2.6 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::6 { remote-as 6 @@ -41,12 +45,14 @@ neighbor 2001:db8:abcd::6 { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.7 { remote-as 7 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } group "TEST" { neighbor 192.0.2.2 { @@ -56,6 +62,7 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::2 { remote-as 2 @@ -64,6 +71,7 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.3 { remote-as 3 @@ -72,6 +80,7 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::3 { remote-as 3 @@ -80,18 +89,21 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.4 { remote-as 4 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::4 { remote-as 4 enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok index f09bc9d3dcc..54db40810ca 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok @@ -15,6 +15,7 @@ neighbor 192.0.2.1 { announce IPv4 unicast announce IPv4 vpn announce IPv4 flowspec + announce policy no } neighbor 2001:db8::1 { remote-as 64496 @@ -23,4 +24,5 @@ neighbor 2001:db8::1 { announce IPv6 unicast announce IPv6 vpn announce IPv6 flowspec + announce policy no } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.16.in b/regress/usr.sbin/bgpd/config/bgpd.conf.16.in new file mode 100644 index 00000000000..9ad5de3d23f --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.16.in @@ -0,0 +1,59 @@ +# $OpenBSD: bgpd.conf.16.in,v 1.1 2024/04/09 09:33:46 claudio Exp $ +# test announce statements + +AS 1 + +neighbor 192.0.2.1 { + remote-as 64496 + role peer + + announce inet unicast + announce inet vpn + announce inet flowspec + announce inet6 unicast + announce inet6 vpn + announce inet6 flowspec + + announce add-path recv yes + announce add-path send all + + announce as-4byte yes + announce enhanced refresh yes + announce policy yes + announce refresh yes + announce restart yes +} + +neighbor 192.0.2.2 { + remote-as 64496 + role peer + + announce inet none + announce inet6 none + + announce add-path recv no + announce add-path send no + + announce as-4byte no + announce enhanced refresh no + announce policy no + announce refresh no + announce restart no +} + +neighbor 192.0.2.3 { + remote-as 64496 + role peer + + announce inet unicast enforce + announce inet6 unicast enforce + + announce add-path recv enforce + announce add-path send best plus 3 enforce + + announce as-4byte enforce + announce enhanced refresh enforce + announce policy enforce + announce refresh enforce + announce restart enforce +} diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.16.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.16.ok new file mode 100644 index 00000000000..43f3041aced --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.16.ok @@ -0,0 +1,53 @@ +AS 1 +router-id 127.0.0.1 +socket "/var/run/bgpd.sock.0" +listen on 0.0.0.0 +listen on :: + + +rde rib Adj-RIB-In no evaluate +rde rib Loc-RIB rtable 0 fib-update yes + +neighbor 192.0.2.1 { + remote-as 64496 + role peer + enforce neighbor-as yes + enforce local-as yes + announce IPv4 unicast + announce IPv6 unicast + announce IPv4 vpn + announce IPv6 vpn + announce IPv4 flowspec + announce IPv6 flowspec + announce enhanced refresh yes + announce add-path recv yes + announce add-path send all + announce policy yes +} +neighbor 192.0.2.2 { + remote-as 64496 + role peer + enforce neighbor-as yes + enforce local-as yes + announce IPv4 none + announce IPv6 none + announce refresh no + announce restart no + announce as4byte no + announce policy no +} +neighbor 192.0.2.3 { + remote-as 64496 + role peer + enforce neighbor-as yes + enforce local-as yes + announce IPv4 unicast enforce + announce IPv6 unicast enforce + announce refresh enforce + announce enhanced refresh enforce + announce restart enforce + announce as4byte enforce + announce add-path recv enforce + announce add-path send best plus 3 enforce + announce policy enforce +} diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok index 4478a03c85b..62566aa0543 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok @@ -18,6 +18,7 @@ neighbor 2001:db8::1 { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } allow from 2001:db8::1 prefix 2001:db8:300::/64 allow from 2001:db8::1 prefix 2001:db8:200::/64 diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok index 674ba486b16..3d597dae67c 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok @@ -13,12 +13,14 @@ neighbor 192.0.2.1 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.2 { remote-as 64496 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.3 { descr "test-peer" @@ -26,6 +28,7 @@ neighbor 192.0.2.3 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } group "testing" { neighbor 192.0.2.7 { @@ -33,12 +36,14 @@ group "testing" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.8 { remote-as 64496 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.6 { descr "test2-peer" @@ -46,12 +51,14 @@ group "testing" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.4 { remote-as 64496 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.5 { descr "test2-peer" @@ -59,6 +66,7 @@ group "testing" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } } @@ -68,6 +76,7 @@ group "test2" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.11 { descr "test3-peer" @@ -75,6 +84,7 @@ group "test2" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } } -- 2.20.1