Add IP Infusion OcNOS device (best-effort)#3679
Conversation
fe70e7e to
cf13db1
Compare
ipspace
left a comment
There was a problem hiding this comment.
Thanks a million for the PR!
Not sure what timezone you're in, so just a short comment (more later today or tomorrow): we're pretty strict about having one functionality/change per PR, as it makes things easier to track down when you're trying to figure out why something was changed.
Considering that, please submit the validation-using-ansible changes as a separate PR. Doesn't have to be anything more complex than creating a new branch, picking the relevant files from this branch into that one, and submitting that one as a PR.
Thank you, Ivan
ansible validation action|
Thanks Ivan — done. The |
Add IP Infusion OcNOS as a containerlab-provisioned device (a vrnetlab-packaged OcNOS VM; clab provider only) at best-effort support level. Configuration is deployed with the ipinfusion.ocnos Ansible collection over network_cli (driving the interactive cmlsh shell). Supported modules include initial, OSPFv2/OSPFv3, BGP, IS-IS, VRF (including per-VRF IS-IS), VLAN, LAG, first-hop gateway (VRRP), STP, MPLS/LDP, segment routing, VXLAN/EVPN, BFD, DHCP relay/client, and static/policy routing, plus the bgp.session, bgp.policy, ebgp.multihop, ospf.areas, evpn.multihoming and tunnel.gre plugins. Because OcNOS cmlsh has no non-interactive SSH exec, `netlab validate` reads device state through the ansible validation action: the device sets netlab_validate.ansible_module to ipinfusion.ocnos.ocnos_command, and the OcNOS OSPFv2/OSPFv3, BGP and IS-IS validators use the ansible_/valid_ contract to screen-scrape the CLI text. Live-verified against vrnetlab ipinfusion_ocnos 7.0.0-262 with FRR probes: OSPFv2, OSPFv3, BGP and IS-IS DUT-side validation all pass through the ansible action.
- docs/platforms.md: add IP Infusion OcNOS (best-effort) to the device list and to the per-module support tables it passes. - docs/caveats.md: OcNOS platform caveats (commercial image, the cmlsh restricted shell and ansible-action validation, the OSPF commit-notice re-run, loopback naming, and the DHCP-relay and GRE datapath limitations). - docs/install/ocnos.md: installation, container image build, configuration deployment, and the ansible-action validation notes. - docs/release/26.07.md: release-note entries for the OcNOS device and the ansible validation action.
cf13db1 to
d1df080
Compare
Add IP Infusion OcNOS (best-effort) and a general
ansiblevalidation actionCloses #3676.
This PR contributes two things that stand on their own but ship together because the first needs the second:
ansiblevalidation action fornetlab validate, so a device whose CLI cannot be driven non-interactively can still have its state read and asserted.The
ansiblevalidation actionWhy
netlab validatereads device state either by running ashow/execcommand over the node connection, or from an external source (suzieq). Both assume the platform can return command output to a non-interactive caller. Some network OSes only expose their operational data through a vendor Ansible module — their interactive CLI rejects non-interactive command execution — so neither existing path can reach them, and today such a device cannot be validated at all.The
ansibleaction closes that gap. It is a validation data source, a peer ofnetsim/cli/validate/suzieq.py— not a connection method.netsim/cli/connect.pyis unchanged (byte-identical todev); interactivenetlab connectis untouched. As suggested on #3676, it is implemented as a first-class, reusable action rather than a one-off device plugin, so any platform in the same situation can adopt it.How it works
validateentry:ansible_<test>()function and assert on the result invalid_<test>().netsim/cli/validate/ansible.pyruns the module ad-hoc against the node using the netlab-generated inventory, and returns parsed JSON when the command emits it (... | json), otherwise the raw CLI text instdoutfor a text assertion to match.The action is registered everywhere a validation action is expected — the topology schema (
attributes.yml), the augment/validation checks (augment/validate.py), the test and plugin dispatchers — soansible:is accepted and executed like any built-in action, and documented indocs/topology/validate.md.The IP Infusion OcNOS device
A native containerlab device driven by the
ipinfusion.ocnosAnsible collection. Because OcNOS'scmlshhas no non-interactive exec mode, it uses the newansibleaction for state validation (this is the concrete first consumer described above).Module coverage
Configuration templates are provided across the standard module set:
Module-level exceptions and platform quirks (e.g. OSPF NSSA type-7 ranges, GRE tunnel line-protocol on the 7.0 image, and DHCP relay not yet covered end-to-end on the test host) are recorded in
docs/caveats.mdand the per-module support tables rather than silently claimed.State validation
Validators are provided for the modules whose assertions read state directly off the OcNOS device — OSPFv2, OSPFv3, BGP and IS-IS — following the same
ansible_<test>()/valid_<test>()signatures as the FRR/EOS validators. Other modules are exercised by netlab's standard cross-device checks (reachability and neighbor state verified from the peer nodes in each integration topology), which need no device-specific validator.Verification
Verified on real OcNOS containerlab topologies (
vrnetlab/ipinfusion_ocnos:7.0.0-262), with an FRR node on each side of the device under test. The device-side checks below are the ones that exercise the OcNOS validators through theansibleaction:ansibleaction)The direct
ansible:action (no plugin) was additionally confirmed end-to-end against the device.Both the configuration the templates render and the show commands the validators parse were checked against the vendor's OcNOS-SP 7.0 CLI documentation — command forms, and the output columns the validators key on (
show ip/ipv6 ospf neighbor,show ip bgp summary,show clns neighbors,show ip/ipv6 route).Files
ansiblevalidation action (core, device-agnostic)netsim/cli/validate/ansible.py— new validation source (peer ofsuzieq.py)netsim/cli/validate/tests.py,utils.py,plugin.py— dispatch + action registrationnetsim/augment/validate.py,netsim/defaults/attributes.yml— acceptansible:as a first-class validation actiondocs/topology/validate.md,docs/release/26.07.md— documentationOcNOS device
netsim/devices/ocnos.yml— device settings, feature matrix,netlab_validate.ansible_moduleopt-innetsim/ansible/templates/**/ocnos.j2,netsim/extra/**/ocnos.j2— configuration templatesnetsim/validate/{ospf,bgp,isis}/ocnos.py+netsim/validate/ocnos.py— state validatorsnetsim/ansible/tasks/{deploy-config,fetch-config,readiness-check}/ocnos.yml— device tasksdocs/platforms.md,docs/caveats.md,docs/install/ocnos.md— device documentationtests/integration/platform/ocnos/— integration topology and notesSupport level
OcNOS is contributed at best-effort support. I don't expect it to be part of the regular upstream integration runs; the supported-module matrix and its documented exceptions live in
docs/platforms.mdanddocs/caveats.md, and I'm happy to maintain the device and address issues against it.