Files
infix/test/case/statd/interfaces-all/operational.json
T
Tobias Waldekranz beecff2acf test: statd: Refactor cli and yanger testing
Existing tests relied on manually captured system data from various
points in Infix's history, making them hard to extend as we add new
features.

Move to a new model where we:

To update a unit test:
1. Use Infamy tests to setup a DUT in a known state
2. Use yanger's wrapper mode to capture the system state needed to
   produce operational data for a set of YANG models
3. Use cli-pretty to create the expected output for a set of show
   commands

When running unit tests, we can then use the captured data to verify
that yanger and cli-pretty works as expected without the need for a
running Infix system - just like before.  The difference is that it is
now much easier to capture a new snapshot when the system evolves.
2025-01-20 13:44:14 +01:00

634 lines
15 KiB
JSON

{
"ietf-interfaces:interfaces": {
"interface": [
{
"admin-status": "up",
"ietf-ip:ipv4": {
"address": [
{
"ip": "127.0.0.1",
"origin": "static",
"prefix-length": 8
}
]
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "::1",
"origin": "static",
"prefix-length": 128
}
],
"mtu": 65536
},
"if-index": 1,
"name": "lo",
"oper-status": "up",
"phys-address": "00:00:00:00:00:00",
"statistics": {
"in-octets": "420569",
"out-octets": "420569"
},
"type": "infix-if-type:loopback"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fe80::2a0:85ff:fe00:301",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 2,
"name": "e1",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:01",
"statistics": {
"in-octets": "5654369",
"out-octets": "8200041"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fe80::2a0:85ff:fe00:302",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 3,
"name": "e2",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:02",
"statistics": {
"out-octets": "101161"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 4,
"infix-interfaces:bridge-port": {
"bridge": "br-Q",
"flood": {
"broadcast": true,
"multicast": true,
"unicast": true
},
"multicast": {
"fast-leave": false,
"router": "auto"
},
"stp-state": "forwarding"
},
"name": "e3",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:03",
"statistics": {
"in-octets": "23589",
"out-octets": "251584"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fe80::2a0:85ff:fe00:304",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 5,
"name": "e4",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:04",
"statistics": {
"in-octets": "30583",
"out-octets": "231318"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fe80::2a0:85ff:fe00:305",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 6,
"name": "e5",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:05",
"statistics": {
"in-octets": "67364",
"out-octets": "105244"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fe80::2a0:85ff:fe00:306",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 7,
"name": "e6",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:06",
"statistics": {
"in-octets": "136295",
"out-octets": "209032"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fe80::2a0:85ff:fe00:307",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 8,
"name": "e7",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:07",
"statistics": {
"in-octets": "70752",
"out-octets": "108022"
},
"type": "infix-if-type:etherlike"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 47,
"infix-interfaces:bridge": {
"multicast": {
"querier": "off",
"snooping": false
},
"multicast-filters": {
"multicast-filter": []
}
},
"name": "br-0",
"oper-status": "down",
"phys-address": "00:a0:85:00:03:00",
"type": "infix-if-type:bridge"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 48,
"infix-interfaces:bridge-port": {
"bridge": "br-X",
"flood": {
"broadcast": true,
"multicast": true,
"unicast": true
},
"multicast": {
"fast-leave": false,
"router": "auto"
},
"stp-state": "forwarding"
},
"infix-interfaces:vlan": {
"id": 30,
"lower-layer-if": "e2",
"tag-type": "ieee802-dot1q-types:c-vlan"
},
"name": "e2.30",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:02",
"type": "infix-if-type:vlan"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 49,
"infix-interfaces:bridge": {
"multicast": {
"querier": "off",
"snooping": false
},
"multicast-filters": {
"multicast-filter": []
}
},
"name": "br-X",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:00",
"type": "infix-if-type:bridge"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 50,
"infix-interfaces:bridge-port": {
"bridge": "br-Q",
"flood": {
"broadcast": true,
"multicast": true,
"unicast": true
},
"multicast": {
"fast-leave": false,
"router": "auto"
},
"stp-state": "forwarding"
},
"infix-interfaces:veth": {
"peer": "veth0a"
},
"name": "veth0b",
"oper-status": "up",
"phys-address": "e2:f0:55:1b:34:f3",
"statistics": {
"in-octets": "13501"
},
"type": "infix-if-type:veth"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 51,
"infix-interfaces:veth": {
"peer": "veth0b"
},
"name": "veth0a",
"oper-status": "up",
"phys-address": "86:2a:11:4e:5d:9f",
"statistics": {
"out-octets": "13501"
},
"type": "infix-if-type:veth"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 52,
"infix-interfaces:bridge-port": {
"bridge": "br-D",
"flood": {
"broadcast": true,
"multicast": true,
"unicast": true
},
"multicast": {
"fast-leave": false,
"router": "auto"
},
"stp-state": "forwarding"
},
"infix-interfaces:vlan": {
"id": 20,
"lower-layer-if": "veth0a",
"tag-type": "ieee802-dot1q-types:c-vlan"
},
"name": "veth0a.20",
"oper-status": "up",
"phys-address": "86:2a:11:4e:5d:9f",
"statistics": {
"out-octets": "13501"
},
"type": "infix-if-type:vlan"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"address": [
{
"ip": "10.0.0.1",
"origin": "static",
"prefix-length": 8
},
{
"ip": "192.168.20.1",
"origin": "static",
"prefix-length": 24
}
],
"mtu": 1500
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "2001:db8::1",
"origin": "static",
"prefix-length": 64
},
{
"ip": "fe80::2a0:85ff:fe00:300",
"origin": "link-layer",
"prefix-length": 64
}
],
"mtu": 1500
},
"if-index": 53,
"infix-interfaces:bridge": {
"multicast": {
"querier": "off",
"snooping": false
},
"multicast-filters": {
"multicast-filter": []
}
},
"name": "br-D",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:00",
"statistics": {
"out-octets": "13501"
},
"type": "infix-if-type:bridge"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 54,
"infix-interfaces:bridge": {
"vlans": {
"proto": "ieee802-dot1q-types:c-vlan",
"vlan": [
{
"multicast": {
"querier": "off",
"snooping": true
},
"multicast-filters": {
"multicast-filter": []
},
"tagged": [
"veth0b"
],
"untagged": [
"br-Q"
],
"vid": 10
},
{
"multicast": {
"querier": "off",
"snooping": true
},
"multicast-filters": {
"multicast-filter": []
},
"tagged": [
"e3",
"veth0b"
],
"untagged": [
"br-Q"
],
"vid": 20
},
{
"multicast": {
"querier": "off",
"snooping": true
},
"multicast-filters": {
"multicast-filter": []
},
"tagged": [
"br-Q",
"e3",
"veth0b"
],
"untagged": [],
"vid": 30
},
{
"multicast": {
"querier": "off",
"snooping": true
},
"multicast-filters": {
"multicast-filter": []
},
"tagged": [
"br-Q",
"e3",
"veth0b"
],
"untagged": [],
"vid": 40
}
]
}
},
"infix-interfaces:bridge-port": {
"pvid": 10
},
"name": "br-Q",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:00",
"statistics": {
"in-octets": "9469"
},
"type": "infix-if-type:bridge"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 55,
"infix-interfaces:vlan": {
"id": 40,
"lower-layer-if": "br-Q",
"tag-type": "ieee802-dot1q-types:c-vlan"
},
"name": "br-Q.40",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:00",
"type": "infix-if-type:vlan"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1500
},
"ietf-ip:ipv6": {
"mtu": 1500
},
"if-index": 56,
"infix-interfaces:vlan": {
"id": 10,
"lower-layer-if": "e3",
"tag-type": "ieee802-dot1q-types:c-vlan"
},
"name": "e3.10",
"oper-status": "up",
"phys-address": "00:a0:85:00:03:03",
"type": "infix-if-type:vlan"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1476
},
"ietf-ip:ipv6": {
"mtu": 1476
},
"if-index": 57,
"infix-interfaces:gre": {
"local": "192.168.20.1",
"remote": "192.168.20.2"
},
"name": "gre-v4",
"oper-status": "up",
"type": "infix-if-type:gre"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1448
},
"ietf-ip:ipv6": {
"mtu": 1448
},
"if-index": 58,
"infix-interfaces:gre": {
"local": "2001:db8::1",
"remote": "2001:db8::2"
},
"name": "gre-v6",
"oper-status": "up",
"type": "infix-if-type:gre"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1462
},
"ietf-ip:ipv6": {
"mtu": 1462
},
"if-index": 59,
"infix-interfaces:gre": {
"local": "192.168.20.1",
"remote": "192.168.20.2"
},
"name": "gretap-v4",
"oper-status": "up",
"phys-address": "1e:9d:e1:46:5d:9e",
"type": "infix-if-type:gretap"
},
{
"admin-status": "up",
"ietf-ip:ipv4": {
"mtu": 1434
},
"ietf-ip:ipv6": {
"mtu": 1434
},
"if-index": 60,
"infix-interfaces:gre": {
"local": "2001:db8::1",
"remote": "2001:db8::2"
},
"name": "gretap-v6",
"oper-status": "up",
"phys-address": "ae:c7:28:08:7c:ca",
"type": "infix-if-type:gretap"
}
]
}
}