speed 100 is lost on save: the forced line rate is not in the port document, and the round-trip test could not see it #1405

Closed
opened 2026-11-11 00:46:58 +00:00 by jaylouisw · 0 comments
Owner

Found by asking the save question from the other end: not "does the document reload as itself" but "set one thing,
save, reload, and diff the port object field by field".

sw1(config-if)#speed 100
Speed 100M on Gi1/0/1
sw1#show interfaces Gi1/0/1
  speed: 100Mb/s (forced), duplex: full
sw1#show running-config
  speed 100

Save, then reload: the port is back at its hardware rate, and speed 100 has gone from show running-config as
well — which is what makes it permanent, because nothing is left to put it back. duplex, one line above it in both
the writer and the reader, was saved all along.

Why the existing guarantee missed it

test/port-roundtrip.test.js round-tripped a lab straight out of the catalogue, so every field sat at its default
and the comparison was default-in, default-out. A setting that is only non-default after a command is invisible to
a sweep over virgin labs.
The section's claim — "every field of every port survives the round trip, for every model
in the catalogue" — was tested against a file that carried nothing.

What must be true instead

  • the forced line rate is written to the port document when it is set, and only then (a port that negotiates its
    own rate must not grow a speedMbps: null line);
  • after a reload, show interfaces says (forced), running-config still prints speed <mbps>, and the cable runs
    at that rate — the value the engine uses, not merely a field;
  • the round-trip sweep configures the port before comparing.
Found by asking the save question from the other end: not "does the document reload as itself" but "set one thing, save, reload, and diff the port object field by field". ``` sw1(config-if)#speed 100 Speed 100M on Gi1/0/1 sw1#show interfaces Gi1/0/1 speed: 100Mb/s (forced), duplex: full sw1#show running-config speed 100 ``` Save, then reload: the port is back at its hardware rate, and `speed 100` has gone from `show running-config` as well — which is what makes it permanent, because nothing is left to put it back. `duplex`, one line above it in both the writer and the reader, was saved all along. ## Why the existing guarantee missed it `test/port-roundtrip.test.js` round-tripped a lab straight out of the catalogue, so every field sat at its default and the comparison was default-in, default-out. **A setting that is only non-default after a command is invisible to a sweep over virgin labs.** The section's claim — "every field of every port survives the round trip, for every model in the catalogue" — was tested against a file that carried nothing. ## What must be true instead * the forced line rate is written to the port document **when it is set**, and only then (a port that negotiates its own rate must not grow a `speedMbps: null` line); * after a reload, `show interfaces` says `(forced)`, running-config still prints `speed <mbps>`, and the cable runs at that rate — the value the engine uses, not merely a field; * the round-trip sweep configures the port before comparing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1405
No description provided.