1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00

Extend maxattr regress to also check RFC8654 extended messages.

This commit is contained in:
claudio 2024-12-09 10:53:54 +00:00
parent 82293aeb2b
commit 03bc5c0e77
5 changed files with 122 additions and 1 deletions

View File

@ -19,6 +19,16 @@ group rdomain2_2 {
neighbor 2001:db8:57::3
}
group rdomain2_3 {
descr "RDOMAIN2_3"
remote-as 4200000004
announce extended yes
neighbor 10.12.57.4
neighbor 2001:db8:57::4
}
match from any community 42:1 set prepend-self 1
match from any community 42:2 set prepend-self 10
match from any community 42:3 set { community 42:43 }

View File

@ -0,0 +1,25 @@
AS 4200000004
router-id 10.12.57.4
fib-update no
log updates
listen on 10.12.57.4
listen on 2001:db8:57::4
socket "/var/run/bgpd.sock.12_3"
group rdomain1 {
descr "RDOMAIN1"
remote-as 4200000001
local-address 10.12.57.4
local-address 2001:db8:57::4
announce extended yes
neighbor 10.12.57.1
neighbor 2001:db8:57::1
}
allow from any
allow to any

View File

@ -1,5 +1,5 @@
#!/bin/ksh
# $OpenBSD: maxattr.sh,v 1.4 2024/10/28 12:11:05 claudio Exp $
# $OpenBSD: maxattr.sh,v 1.5 2024/12/09 10:53:54 claudio Exp $
set -e
@ -15,9 +15,11 @@ PAIRS="${PAIR1} ${PAIR2}"
PAIR1IP=10.12.57.1
PAIR2IP=10.12.57.2
PAIR2IP_2=10.12.57.3
PAIR2IP_3=10.12.57.4
PAIR1IP6=2001:db8:57::1
PAIR2IP6=2001:db8:57::2
PAIR2IP6_2=2001:db8:57::3
PAIR2IP6_3=2001:db8:57::4
error_notify() {
echo cleanup
@ -67,7 +69,9 @@ ifconfig ${PAIR2} rdomain ${RDOMAIN2} ${PAIR2IP}/29 up
ifconfig ${PAIR1} inet6 ${PAIR1IP6}/64
ifconfig ${PAIR2} inet6 ${PAIR2IP6}/64
ifconfig ${PAIR2} alias ${PAIR2IP_2}/32
ifconfig ${PAIR2} alias ${PAIR2IP_3}/32
ifconfig ${PAIR2} inet6 ${PAIR2IP6_2}/128
ifconfig ${PAIR2} inet6 ${PAIR2IP6_3}/128
ifconfig ${PAIR1} patch ${PAIR2}
ifconfig lo${RDOMAIN1} inet 127.0.0.1/8
ifconfig lo${RDOMAIN2} inet 127.0.0.1/8
@ -80,6 +84,8 @@ route -T ${RDOMAIN2} exec ${BGPD} \
-v -f ${BGPDCONFIGDIR}/bgpd.maxattr.rdomain2_1.conf
route -T ${RDOMAIN2} exec ${BGPD} \
-v -f ${BGPDCONFIGDIR}/bgpd.maxattr.rdomain2_2.conf
route -T ${RDOMAIN2} exec ${BGPD} \
-v -f ${BGPDCONFIGDIR}/bgpd.maxattr.rdomain2_3.conf
sleep 1
echo inject initial prefixes
@ -101,7 +107,10 @@ route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:66::/48 community 0:2
sleep 4
echo test1: check propagation
route -T ${RDOMAIN1} exec bgpctl show rib out | tee maxattr.test1.out
echo "regular peer" >> maxattr.test1.out
route -T ${RDOMAIN2} exec bgpctl -s /var/run/bgpd.sock.12_2 show rib | tee -a maxattr.test1.out
echo "extended message peer" >> maxattr.test1.out
route -T ${RDOMAIN2} exec bgpctl -s /var/run/bgpd.sock.12_3 show rib | tee -a maxattr.test1.out
echo update prefixes
route -T ${RDOMAIN2} exec bgpctl network add 10.12.62.0/24 community 0:1 community 42:1
@ -118,7 +127,10 @@ route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:66::/48 community 0:2 comm
sleep 2
echo test2: check propagation
route -T ${RDOMAIN1} exec bgpctl show rib out | tee maxattr.test2.out
echo "regular peer" >> maxattr.test2.out
route -T ${RDOMAIN2} exec bgpctl -s /var/run/bgpd.sock.12_2 show rib | tee -a maxattr.test2.out
echo "extended message peer" >> maxattr.test2.out
route -T ${RDOMAIN2} exec bgpctl -s /var/run/bgpd.sock.12_3 show rib | tee -a maxattr.test2.out
echo check results
diff -u ${BGPDCONFIGDIR}/maxattr.test1.ok maxattr.test1.out

View File

@ -19,6 +19,43 @@ flags vs destination gateway lpref med aspath origin
* N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 10.12.60.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.61.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.62.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.63.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
regular peer
flags: * = Valid, > = Selected, I = via IBGP, A = Announced,
S = Stale, E = Error, F = Filtered
origin validation state: N = not-found, V = valid, ! = invalid
aspa validation state: ? = unknown, V = valid, ! = invalid
origin: i = IGP, e = EGP, ? = Incomplete
flags vs destination gateway lpref med aspath origin
*> N-? 10.12.60.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.61.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.62.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.63.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
extended message peer
flags: * = Valid, > = Selected, I = via IBGP, A = Announced,
S = Stale, E = Error, F = Filtered
origin validation state: N = not-found, V = valid, ! = invalid

View File

@ -19,6 +19,21 @@ flags vs destination gateway lpref med aspath origin
* N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 10.12.60.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.61.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.62.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000002 i
* N-? 10.12.63.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i
* N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i
* N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000001 4200000002 i
* N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i
* N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
* N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
regular peer
flags: * = Valid, > = Selected, I = via IBGP, A = Announced,
S = Stale, E = Error, F = Filtered
origin validation state: N = not-found, V = valid, ! = invalid
@ -32,3 +47,25 @@ flags vs destination gateway lpref med aspath origin
*> N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
extended message peer
flags: * = Valid, > = Selected, I = via IBGP, A = Announced,
S = Stale, E = Error, F = Filtered
origin validation state: N = not-found, V = valid, ! = invalid
aspa validation state: ? = unknown, V = valid, ! = invalid
origin: i = IGP, e = EGP, ? = Incomplete
flags vs destination gateway lpref med aspath origin
*> N-? 10.12.60.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.61.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.62.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000002 i
*> N-? 10.12.63.0/24 10.12.57.2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i
*> N-? 10.12.64.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.65.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 10.12.66.0/24 10.12.57.2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:60::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:61::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:62::/48 2001:db8:57::2 100 0 4200000001 4200000001 4200000002 i
*> N-? 2001:db8:63::/48 2001:db8:57::2 100 0 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000001 4200000002 i
*> N-? 2001:db8:64::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:65::/48 2001:db8:57::2 100 0 4200000001 4200000002 i
*> N-? 2001:db8:66::/48 2001:db8:57::2 100 0 4200000001 4200000002 i