Commit 8032783
committed
Add BMv2 e2e integration tests for PRE entity reads
The BMv2 end-to-end coverage in 1199952 verified the table-driven
read APIs against a real simple_switch_grpc instance; this commit
lifts the same pattern to the packet replication engine read APIs
shipped by b893a53 (multicast group) and f709b5a (clone session).
The new test class follows the lifecycle BMv2TestSupport established:
a single @BeforeAll spawn, @afterall teardown, and a parallel raw
P4Runtime stub used solely for seeding device state, since jp4 1.5
has no public Write API for multicast groups or clone sessions and
controllers normally install them through the wire RPC.
Local verification against simple_switch_grpc 1.15.1 — the BMv2
build the project's CI Docker image and developer hosts both run —
found that this BMv2 fully implements both MulticastGroupEntry and
CloneSessionEntry Read RPCs. That is the opposite of the
RegisterEntry case 1199952 documented, where the same BMv2 returns
UNIMPLEMENTED and the register integration test skips via
Assumptions.assumeTrue. The two new PRE tests retain the same
defensive Assumptions.assumeTrue blocks even though BMv2 1.15.1
does not trip them, so an older BMv2 or an alternate
spec-compliant target that does refuse the read with UNIMPLEMENTED
will skip rather than fail the suite.
The packet replication engine is program-agnostic — multicast
groups and clone sessions are addressed by controller-assigned
numeric ids only and carry no P4-program declaration. As a
consequence the existing counters_meters_registers_groups.p4
fixture serves these tests as-is: it satisfies the pipeline-bound
gate that jp4 enforces on every read entry point, and that is the
only fixture-side requirement PRE reads have. No new P4, JSON, or
P4Info artefacts are introduced.
Two happy-path tests cover the wire-level round-trip, one per
entity family. readMulticastGroupAfterInsertReturnsTheGroup seeds
a one-replica group through the raw stub and asserts the
multicast-group id, the replica's canonical-bytestring port, and
the per-replica instance round-trip intact. readCloneSessionAfterInsertReturnsTheSession
seeds a one-replica session with class-of-service 0 and
packetLengthBytes 0 (the "no truncation" case the spec defines)
and asserts the same shape. The unit tests in
P4SwitchReadMulticastGroupTest and P4SwitchReadCloneSessionTest
already cover the matrix dimensions (three-way port_kind handling,
backup_replicas wiring, metadata round-trip, server-side id filter
assembly, client-side where filter, and the clone-session
truncation-boundary semantics); the e2e tests deliberately focus
on the BMv2 wire round-trip rather than duplicating unit coverage.
The test count moves from 396 to 398.
SemVer-irrelevant: test-only commit; no production source changes,
no public API surface changes, no fixture changes. The library
code and the existing test suite are byte-identical to f709b5a.1 parent f709b5a commit 8032783
1 file changed
Lines changed: 200 additions & 0 deletions
Lines changed: 200 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
0 commit comments