0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

filter/test.conf: testing roa subprefixes

This commit is contained in:
Katerina Kubecova 2024-12-13 16:16:59 +01:00
parent cdc17da4b8
commit 51c2907ea2

View File

@ -2414,6 +2414,69 @@ prefix pfx;
bt_test_suite(t_roa_check, "Testing ROA"); bt_test_suite(t_roa_check, "Testing ROA");
roa6 table r61;
roa6 table r62;
protocol static
{
roa6 { table r61; import filter roa_filter; };
}
protocol static
{
roa6 { table r62; import filter roa_filter; };
route 2001:0db8::/32 max 35 as 1000;
route 2001:0db8::/32 max 40 as 1001;
route 2001:0db8::/34 max 38 as 1002;
route 2001:0db8::/32 max 35 as 1003;
route 2001:0db8::/36 max 36 as 1004;
route 2001:0db8:c000::/34 max 38 as 1005;
}
protocol pipe {
export where source ~ [ RTS_STATIC ];
import all;
table r61;
peer table r62;
}
function t_roa_subprefix_check()
{
bt_assert(roa_check(r61, 2001:0db8::/32, 1000) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8:c000::/34, 1000) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/35, 1000) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/38, 1000) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/50, 1000) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/32, 1001) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/38, 1001) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/40, 1001) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/42, 1001) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/32, 1002) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/34, 1002) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/38, 1002) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/40, 1002) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/32, 1003) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/34, 1003) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/38, 1003) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/40, 1003) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/32, 1004) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/36, 1004) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/38, 1004) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/40, 1004) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8::/32, 1005) != ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8:c000::/34, 1005) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8:c000::/38, 1005) = ROA_VALID);
bt_assert(roa_check(r61, 2001:0db8:c000::/40, 1005) != ROA_VALID);
}
bt_test_suite(t_roa_subprefix_check, "Testing ROA subprefixes");
aspa table at; aspa table at;
protocol static protocol static