Every printed config line has a no form, and no vlan stops lying (#1277) #1278
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!1278
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/config-undo"
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?
Every printed config line now has a
noform, andno vlanstops reporting work it did not do.Fixes #1277.
The gap
show running-configis the backup. The suite already held it to two rules — it replays, and it is complete— and it failed the third: you cannot edit it back.
and the mirror image, which is worse than missing because it lies:
The rule this PR makes testable
Add a command, remove it, and
show running-configcomes back byte for byte to what it was. Not "themessage looks right" — the same text. That is the assertion in
test/config-undo.test.js, 48 checks,24 of which fail with
engine/cli.jsreverted.The
noforms, and what they say when there is nothing to removenoformhostname <name>no hostname% No hostname set (the device is named …)ip dhcp pool <name>no ip dhcp pool <name>% No DHCP pool named nopedns zone <name>no dns zone <name>% No DNS zone named nope.exampleip access-group <n> in|outno ip access-group [<n>] [in|out]% No access list 101 applied in on Gi0vlan <id>no vlan <id>% VLAN 99 does not existThree refusals that are load-bearing, not tidy
no ip access-group 103 inwhile 102 is applied refuses and names 102. Silently clearing "whatever isbound" would remove a policy the operator did not ask about.
no vlan 20while ports carry it refuses, naming up to five and counting the rest:Deleting a VLAN behind the ports' backs left
show running-configno longer printingvlan 20whileshow vlanstill listed it from the member ports — two descriptions of one switch that disagreed, the sameclass as #1232, #1256 and #1262. Once the port is moved off it, the same command deletes it cleanly.
no hostnamerestores the name the box had before the hostname was typed, becausehostnamesets boththe config line and the canvas label so the two cannot disagree (#21). Undoing only half of it leaves a
clean config over a label that lies.
Also
docs/CLI.mdgains an "Undoing a command" section — the rule, the sample refusals, the table — and theconfig-mode command table lists the new forms.
helplists them too.Suite: 152 suites, 6,380 assertions, 0 failed.