A port name is the whole rest of the line (#1401) #1402
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1402
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/port-name-arguments"
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?
A port name is the whole rest of the line. Fixes #1401.
Found by asking two reports of the same box whether they agree about how many ports it has, over the whole
catalogue. They do — but three commands could not be asked about one port by the name printed in front of the
operator.
interface Port 1has read the name as the rest of the line since #1230, and its own comment says why: Ubiquiticalls its ports
Port 1and its cagesSFP+ 1, so reading only the first word looked up a port calledPort. Thatfix reached the configuration door. The reporting doors were left behind — on the 17 models whose ports are named
this way:
The first two refuse a port that is right there and name one that does not exist. The third accepts a filter and
drops it, which reads as "this port has all of them".
What changed
show interfaces <name>/show interface <name>take the whole rest of the line as the name, the same ruleinterface <name>uses. A name that matches nothing is refused with the whole name typed —% No interface Port 99 on …— never truncated to its first word.show power inline <name>takes it the same way.show mac address-table interface <name>applies the filter (intabbreviates it), and a filter that matchesnothing says so about that port —
(no entry learned on Port 9)— instead of printing an empty table, which readsas a claim about the whole box. Any other trailing words are refused rather than ignored: an argument that is
accepted and not applied is the same defect as a config command that is accepted and inert.
Evidence
test/port-name-arguments.test.js— 26 checks: a spaced name resolves throughshow interfaces,show interfaceand a cage name likeSFP 1; an unknown name is refused by the whole name; whatinterface Port 3configured is what
show interfaces Port 3reads back;show power inline Port 1answers aboutPort 1; the MACfilter holds one port and not the other; the abbreviation works; an empty filter result says so; a filter the command
does not implement is refused; a missing name is asked for; an unknown port is refused by name. Plus the sweep that
found this — every model, the first three ports it lists, each namable and each answer about exactly that port
(6,114 checks inside the suite). A single-word name such as
Gi0/0/0is unchanged.Reverting
engine/cli.jsfails 21 of the 26.docs/CLI.md: the naming rule, the MAC filter, and theshow mac address-tableexample brought up to date — itstill showed the pre-ageing header and claimed entries are never aged.
Suite: 203 suites, 7,777 assertions, 0 failed. Syntax: 271 files, OK.