]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: Document and extend ASPA verification tests
authorMaria Matejka <mq@ucw.cz>
Sat, 14 Mar 2026 17:42:03 +0000 (18:42 +0100)
committerMaria Matejka <mq@ucw.cz>
Sat, 14 Mar 2026 21:34:35 +0000 (22:34 +0100)
These extensions minimalistically replicate the downstream bug reported
by Evann DREUMONT. (See next commit.)

Issue: #355

filter/test.conf

index ef3ecb27db6c2e29c7b3ad571a79fa331c424cd0..704ddc83628c602af1e5cb5e40e4888295a0ad7b 100644 (file)
@@ -2453,10 +2453,19 @@ bt_test_suite(t_roa_check, "Testing ROA");
 
 aspa table at;
 
+# ASPA structure:
+#
+#
+#     65544               65545
+#       |     \ /   \ /     |
+#     65540  65542 65543  65541
+#       |            |
+#     65550        65551
+
 protocol static
 {
        aspa { table at; };
-       route aspa 65540 providers 65544;
+       route aspa 65540 providers 65544, 65549;
        route aspa 65541 providers 65545;
        route aspa 65542 providers 65544, 65545;
        route aspa 65543 providers 65544, 65545;
@@ -2498,6 +2507,27 @@ function t_aspa_check()
        p3.prepend(65544);
        bt_assert(aspa_check(at, p3, false) = ASPA_INVALID);
        bt_assert(aspa_check(at, p3, true) = ASPA_INVALID);
+
+       bgppath p4 = +empty+;
+       p4.prepend(65540);
+       p4.prepend(65544);
+
+       bt_assert(aspa_check(at, p4, false) = ASPA_VALID);
+       bt_assert(aspa_check(at, p4, true) = ASPA_VALID);
+
+       p4.prepend(65545);
+
+       bt_assert(aspa_check(at, p4, false) = ASPA_VALID);
+       bt_assert(aspa_check(at, p4, true) = ASPA_INVALID);
+
+       p4.prepend(65555);
+
+       bt_assert(aspa_check(at, p4, false) = ASPA_UNKNOWN);
+       bt_assert(aspa_check(at, p4, true) = ASPA_INVALID);
+
+       bgppath p5 = +empty+.prepend(65550).prepend(65540).prepend(65549);
+       bt_assert(aspa_check(at, p5, false) = ASPA_VALID);
+       bt_assert(aspa_check(at, p5, true) = ASPA_VALID);
 }
 
 bt_test_suite(t_aspa_check, "Testing ASPA (our tests)");