From c57d02b01a188ee6c18cda0e7b11736b948124cf Mon Sep 17 00:00:00 2001 From: claudio Date: Fri, 21 Sep 2018 05:14:07 +0000 Subject: [PATCH] Basic testing of roa-sets. --- regress/usr.sbin/bgpd/config/Makefile | 4 +- regress/usr.sbin/bgpd/config/bgpd.conf.9.in | 36 ++++++++++++++++++ regress/usr.sbin/bgpd/config/bgpd.conf.9.ok | 41 +++++++++++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.9.in create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.9.ok diff --git a/regress/usr.sbin/bgpd/config/Makefile b/regress/usr.sbin/bgpd/config/Makefile index 03568c3698d..d019c72dab3 100644 --- a/regress/usr.sbin/bgpd/config/Makefile +++ b/regress/usr.sbin/bgpd/config/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.5 2018/09/10 14:20:25 benno Exp $ +# $OpenBSD: Makefile,v 1.6 2018/09/21 05:14:07 claudio Exp $ -BGPDTESTS=1 2 3 4 5 6 7 8 +BGPDTESTS=1 2 3 4 5 6 7 8 9 REGRESS_TARGETS = config diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.9.in b/regress/usr.sbin/bgpd/config/bgpd.conf.9.in new file mode 100644 index 00000000000..fc8167ab529 --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.9.in @@ -0,0 +1,36 @@ +# $OpenBSD: bgpd.conf.9.in,v 1.1 2018/09/21 05:14:07 claudio Exp $ +# test roa-set blocks + +AS 1 + +roa-set empty1 { } +roa-set empty2 { + # comment +} +roa-set one1 { 1.2.3/24 source-as 0 } +roa-set one2 { + # comment + 1.2.3/24 source-as 42 +} +roa-set test2 { 1.2.3/24 source-as 1, 1.2.8.0/22 source-as 3 } + +roa-set test3 { + 10/8 source-as 1 + 10/8 source-as 2 + 10/8 source-as 3 + 10/8 source-as 4 + 10/8 maxlen 24 source-as 3 + 10/8 maxlen 24 source-as 4 + 10/8 maxlen 24 source-as 5 +} + +roa-set test4 { + 10.1/16 source-as 1 + 10.2/16 maxlen 24 source-as 1 + 10.3/16 prefixlen <= 24 source-as 1 + 10.4/16 prefixlen < 24 source-as 1 +} + +#match from any roa-set empty1 unknown +#match from any roa-set one1 invalid +#match from any roa-set test3 valid diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.9.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.9.ok new file mode 100644 index 00000000000..8b5434568f2 --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.9.ok @@ -0,0 +1,41 @@ +AS 1 +router-id 127.0.0.1 +socket "/var/run/bgpd.sock.0" +holdtime min 3 +fib-priority 48 + +roa-set "empty1" { +} + +roa-set "empty2" { +} + +roa-set "one1" { + 1.2.3.0/24 source-as 0 +} + +roa-set "one2" { + 1.2.3.0/24 source-as 42 +} + +roa-set "test2" { + 1.2.3.0/24 source-as 1, 1.2.8.0/22 source-as 3 +} + +roa-set "test3" { + 10.0.0.0/8 source-as 1, 10.0.0.0/8 source-as 2 + 10.0.0.0/8 source-as 3, 10.0.0.0/8 source-as 4 + 10.0.0.0/8 maxlen 24 source-as 3, 10.0.0.0/8 maxlen 24 source-as 4 + 10.0.0.0/8 maxlen 24 source-as 5 +} + +roa-set "test4" { + 10.1.0.0/16 source-as 1, 10.2.0.0/16 maxlen 24 source-as 1 + 10.3.0.0/16 maxlen 24 source-as 1, 10.4.0.0/16 maxlen 23 source-as 1 +} + + +rde rib Adj-RIB-In no evaluate +rde rib Adj-RIB-Out no evaluate +rde rib Loc-RIB rtable 0 fib-update yes + -- 2.20.1