netlab
netlab copied to clipboard
Self-contained lab topologies
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
Good idea. Will try to figure out how to make it work both in validation and in generic custom configuration without too much hassle.
Implemented in #2573 and #2580