A spec can give two ports one name (5 ports become 4), declare a model another file already declares, and expand to nonsense — the schema says otherwise #1317
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
docs/DEVICE_SCHEMA.mdalready says, in the interface table:and, in its own section:
Neither was true at load. The importer enforced the second;
loadCatalog()enforced neither. Measured on thecurrent tree:
so the catalogue is clean — and nothing keeps it that way. Three ways of lying are accepted today.
1. Two ports with one name: the spec describes 5, the device has 4
Ports are kept in a map keyed by name, so the later
Gi2silently replaces the earlier one. A 28-port switch writtenwith a clash becomes a 27-port switch, and nothing anywhere says so — the canvas, the inspector count and the port
audit all agree with each other and all disagree with the file.
2. Two files for one box
modelKey()squashes punctuation and is what the importer gates on (issue #60), but nothing re-checks it at load, soa file that arrives by a rebase, a copy or a hand edit puts two entries in the palette for one machine. Then
POST /api/topologies/default/devices {model}takes whichever sorted first, and the box you cab is not necessarilythe one you read about.
3. A template prefix or start of the wrong type
prefix: 5withstart: "1"expands toGi10, Gi11, Gi12, Gi13— port numbering that begins at ten becausestart + iconcatenated a string. No rule was broken by any single field; the result is nonsense.What must be true instead
ports the device would really keep;
modelanother file already declares is refused, naming the file that has it — comparison ignorespunctuation, as the importer's does;
portTemplate.prefixmust be a string andstarta whole number ≥ 0 when present;"24x RJ45 + 4x SFP", explicit-only, and a template with no
start.