netlab icon indicating copy to clipboard operation
netlab copied to clipboard

Self-contained lab topologies

Open jbemmel opened this issue 11 months ago • 1 comments

https://github.com/ipspace/netlab/blob/2c10748b6b73519ca8fd2b77a90b15e61d1f4e3a/tests/integration/gateway/02-vrrp.yml#L46

It would be useful to have lab topologies that are fully self-contained in a single YAML file. Instead of forking off to a template with a couple of lines of config script, these snippets could be embedded within the single lab file

The above could become:

validate:
  r2_eth1_down:
    description: Remove R2 from the VRRP LAN
    nodes: [ r2 ]
    config:
      template:
        variable.ifstate: 'down'
        eos: |
          interface {{ interfaces[0].ifname }}
          {{ 'no ' if ifstate|default('down') == 'up' else '' }}shutdown
        frr: |
         #!/bin/bash
         ip link set {{ interfaces[0].ifname }} {{ ifstate|default('down') }}
    pass: R2 has been disconnected from the VRRP LAN
    stop_on_error: True

jbemmel avatar Jan 15 '25 22:01 jbemmel

Good idea. Will try to figure out how to make it work both in validation and in generic custom configuration without too much hassle.

ipspace avatar Jan 16 '25 09:01 ipspace

Implemented in #2573 and #2580

ipspace avatar Aug 10 '25 16:08 ipspace