|
| 1 | +# Exhibit: test/plugin/gr-mark-stale.ci passes with Graceful Restart unreachable |
| 2 | +# |
| 3 | +# This file is a DEMONSTRATION, not a regression test. It is a copy of |
| 4 | +# test/plugin/gr-mark-stale.ci with one change: the `gr` plugin is not loaded, |
| 5 | +# so no Graceful Restart code runs at all. It still PASSES. |
| 6 | +# |
| 7 | +# DEMONSTRATES: the assertion in gr-mark-stale.ci is not about Graceful Restart. |
| 8 | +# The conn=2 re-announcement that test reads as GR evidence is produced by |
| 9 | +# RIBManager.handleState (internal/component/bgp/plugins/rib/rib.go) replaying |
| 10 | +# ribOut, which is deleted in the withdraw path and never on peer-down. The |
| 11 | +# replay happens whether or not GR exists. |
| 12 | +# DEMONSTRATES: mark-stale is not reached even when the plugin IS loaded. |
| 13 | +# parseGRCapValue (internal/component/bgp/plugins/gr/gr.go) emits two octets |
| 14 | +# with no AFI/SAFI tuples, so the capability carries zero families, decodeGR |
| 15 | +# yields nil families, and onSessionDown returns false at its |
| 16 | +# len(staleFamilies) == 0 guard. |
| 17 | +# |
| 18 | +# ASSERTS ABOUT GRACEFUL RESTART: nothing. Green here and green in |
| 19 | +# gr-mark-stale.ci are the same green, produced by the same RIB replay. |
| 20 | +# |
| 21 | +# Journal row: plan/journal/unwired-feature.md, 2026-09-08. |
| 22 | +# Handover: plan/handoff-graceful-restart-sender-facts.md. |
| 23 | + |
| 24 | +# ze-peer expectations |
| 25 | +stdin=peer:terminator=EOF_PEER |
| 26 | +option=tcp_connections:value=2 |
| 27 | +option=timeout:value=15s |
| 28 | + |
| 29 | +# Connection 1: Static route + EOR from ze |
| 30 | +expect=bgp:conn=1:seq=1:hex=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00300200000015400101004002004003040A0000014005040000006418C0A801 |
| 31 | +expect=bgp:conn=1:seq=1:hex=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00170200000000 |
| 32 | +# TCP close (no NOTIFICATION). No gr plugin is loaded, so nothing activates: |
| 33 | +# this is the stimulus the original test credits GR with answering. |
| 34 | +action=close:conn=1:seq=2 |
| 35 | + |
| 36 | +# Connection 2: ribOut replay — static route (config + RIB replay) + EOR |
| 37 | +expect=bgp:conn=2:seq=1:hex=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00300200000015400101004002004003040A0000014005040000006418C0A801 |
| 38 | +expect=bgp:conn=2:seq=1:hex=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00170200000000 |
| 39 | +EOF_PEER |
| 40 | + |
| 41 | +# ze bgp configuration |
| 42 | +stdin=ze-bgp:terminator=EOF_CONF |
| 43 | +plugin { |
| 44 | + internal bgp-rib { |
| 45 | + use bgp-rib |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +bgp { |
| 50 | + peer peer1 { |
| 51 | + connection { |
| 52 | + remote { |
| 53 | + ip 127.0.0.1 |
| 54 | + } |
| 55 | + local { |
| 56 | + ip 127.0.0.1 |
| 57 | + accept false |
| 58 | + } |
| 59 | + } |
| 60 | + session { |
| 61 | + asn { |
| 62 | + local 1 |
| 63 | + remote 1 |
| 64 | + } |
| 65 | + router-id 1.2.3.4 |
| 66 | + family { |
| 67 | + ipv4/unicast { prefix { maximum 10000; } } |
| 68 | + } |
| 69 | + capability { |
| 70 | + graceful-restart { |
| 71 | + restart-time 120 |
| 72 | + } |
| 73 | + } |
| 74 | + } |
| 75 | + behavior { |
| 76 | + group-updates disable |
| 77 | + } |
| 78 | + timer { connect-retry 5; } |
| 79 | + |
| 80 | + |
| 81 | + update { |
| 82 | + attribute { |
| 83 | + origin igp |
| 84 | + local-preference 100 |
| 85 | + next-hop 10.0.0.1 |
| 86 | + } |
| 87 | + nlri { |
| 88 | + ipv4/unicast add 192.168.1.0/24 |
| 89 | + } |
| 90 | + } |
| 91 | + attach process bgp-rib { |
| 92 | + receive [ update state refresh ] |
| 93 | + send [ update ] |
| 94 | + } |
| 95 | + } |
| 96 | +} |
| 97 | +EOF_CONF |
| 98 | + |
| 99 | +# Process orchestration |
| 100 | +cmd=background:seq=1:exec=ze-peer --port $PORT:stdin=peer |
| 101 | +cmd=foreground:seq=2:exec=ze -:stdin=ze-bgp:timeout=20s |
0 commit comments