-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement clab save
for IOL.
#2403
Conversation
There was redundant regex for the `eX/X` and `EthernetX/X` checks. The regexp has been simplified so "e" vs "Ethernet" and the slot/port checks are in two separate capture groups.
`SaveConfig()` func is used which allows the "clab save" command to be used. Uses the scrapligo network driver to send a basic `write memory` command which copies the running config -> startup config.
// SaveConfig is used for "clab save" functionality -- it saves the running config to the startup configuration | ||
func (n *iol) SaveConfig(_ context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaelemc can you add a simple robot test in the iol test suite?
Just call a command and check if it returns rc=0 at a mininum.
If you want to make it more proper, maybe you can check with some show command that the stratup has actually been written to
Some basic tests which use "containerlab save" to save all running configurations to the startup-configuration (in NVRAM). The test then verifies the config was saved to the startup-config by checking the startup-config location contains a configuration with the nodes hostname.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2403 +/- ##
==========================================
+ Coverage 51.97% 52.56% +0.59%
==========================================
Files 172 168 -4
Lines 17394 16940 -454
==========================================
- Hits 9040 8905 -135
+ Misses 7412 7122 -290
+ Partials 942 913 -29
|
As per the title this PR:
clab save
for IOLAllowedIntfRegexp
I've pretty much stolen the sample in the scrapligo README and modified it to exec
write memory
which does the same ascopy run start
, the difference being withwrite memory
there is no pesky prompt that shows up to confirm you want to copy the config.I'll add some tests, but let me know if you like it this way or would prefer something else.
FYI: "programmability" is not supported on IOL (this includes NETCONF).