forked from ipspace/netlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13-status-mgmt-dual-stack.yml
More file actions
53 lines (44 loc) · 1.37 KB
/
Copy path13-status-mgmt-dual-stack.yml
File metadata and controls
53 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
message: |
This test checks that netlab status displays both IPv4 and IPv6
management addresses in a mixed libvirt, clab, and tool topology.
plugin: [ files ]
provider: libvirt
defaults.device: linux
tools:
graphite:
defaults.addressing.mgmt.ipv6: 2001:db8:121::/64
defaults.netlab.integration:
skip: [ initial ]
validate: bash validate.sh
nodes:
vm:
mgmt.ipv4: 192.168.121.31
mgmt.ipv6: 2001:db8:121::31
ctr:
provider: clab
mgmt.ipv4: 192.168.121.32
links: [ vm-ctr ]
files:
validate.sh: |
#!/bin/bash
set -e
netlab status >status.out
grep "mgmt IP" status.out >/dev/null
grep "192.168.121.31" status.out >/dev/null
grep "2001:db8:121::31" status.out >/dev/null
grep "192.168.121.32" status.out >/dev/null
grep "graphite" status.out >/dev/null
netlab status --format json >status.json
python3 - <<'PY'
import json
with open("status.json", encoding="utf-8") as status_file:
nodes = json.load(status_file)["nodes"]
assert nodes["vm"]["mgmt"] == "192.168.121.31"
assert nodes["vm"]["mgmt6"] == "2001:db8:121::31"
assert nodes["ctr"]["mgmt"] == "192.168.121.32"
assert nodes["graphite"]["device"] == "(tool)"
assert "mgmt" not in nodes["graphite"]
assert "mgmt6" not in nodes["graphite"]
PY
echo "netlab status displays dual-stack management addresses in a mixed topology"