channel-group flurbish created a channel group, and shutdown flurbish closed the port #1495
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1495
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?
The question
Three handlers answering a neighbouring command's question (#1493) suggested a wider one: what does each command family do when it is handed a word that does not exist? Thirty-three families, one nonsense word each, every answer sorted into three classes:
3 silent, 16 unquoted, 31 good. The silent ones were the real finds.
1.
channel-group flurbishcreated a channel group called "flurbish"and in configuration:
The mode was validated —
channel-group 5 mode flurbishanswers% Invalid mode: flurbish— and the id was not. So a typo became configuration, with a receipt:show etherchannellists a group whose id is a word, and no other port can ever join it. This is the same failure as the VLAN-id doors that once answeredVLAN NaN created (name: VLAN0NaN), in the one door that was left open.2.
shutdown flurbishclosed the port and said nothingThe extra word was ignored and the port went down — a typo that costs a link with no witness at all. Same on a router port.
Both now refuse, quote the word, and change nothing:
3.
ip route flurbishwas reported as a missing argumentThat sends the reader to add a mask to something that is not an address. The shape of the destination is now checked before the rest of the line:
A genuinely short line is still called incomplete — the two answers are now different because the two problems are.
The sixteen unquoted answers are left alone, deliberately
duplex flurbish→% Usage: duplex auto | full | half;switchport flurbishon a router →% ... cannot switch frames: it has no l2-forward capability;clock rate flurbishon an RJ45 port →% clock rate is only configurable on a serial interface. None names the word, and all three tell the reader what to do instead — the alternatives, or the capability that is missing. That distinction is now written down as a rule in the test rather than left to judgement: an unquoted refusal must name a capability or list the alternatives.Evidence
test/no-command-swallows-a-word.test.js— the sweep as a guard: 33 families, three classes, the rule above, plus "no refused command wrote configuration". 21 checks, 21 passed / 0 failed. With the old handler: 12 passed / 9 failed, naming both silent families and the misleading route answer.Those flat assertions also pin what must not regress:
channel-group 5 mode activestill bundles the port and records group 5,shutdownalone still closes the port,no shutdownstill opens it, a valid route is installed and stored, a non-contiguous mask is still refused with its reason, andchannel-group 5 mode flurbishstill names the mode.Docs:
docs/CLI.md, new section "A word the console does not know is never swallowed".Full suite: 245 suites, 9,091 assertions, 0 failed. Syntax 314 files.
Landed as #1496 (
8e0d6330). Post-merge onmain:no-command-swallows-a-word21/21,command-answers-the-question27/27,lag57/57,show-vlan29/29, tree clean, 0 open PRs.The audit is the part worth keeping: 33 command families, one nonsense word each, answers sorted into silent / unquoted / quoted. Silent was 3 and is now 0. The rule for what an unquoted refusal may be -- it names a missing capability, or lists the values the command takes -- is written into the test, so the next family that accepts a word it does not know fails by measurement rather than by someone noticing.
One operational note: the branch is
fix/word-audit, notfix/no-swallowed-words-- the server refused to create that ref (remote: error: couldn't set 'refs/heads/fix/no-swallowed-words'). Same commit, different name; nothing about the change depends on it.hostnameerased the name,descriptioncleared itself #1497channel-group 4097is accepted #1505