summaryrefslogtreecommitdiff
path: root/tests/unit/fixtures
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2026-08-21 14:06:28 -0500
committerGitHub <noreply@github.com>2026-08-21 14:06:28 -0500
commitff5224728484eb4f3bbf6ae52fe0b79f64959660 (patch)
tree71b3e53e0080da60abf9fd2381705971dfe4d507 /tests/unit/fixtures
parent7a6b5e4f3a7a021cfa75faa7bf833741dfc09cff (diff)
parent45dc95873fd906c582fbbd5e6ca3838caf867399 (diff)
downloadrest.vyos-ff5224728484eb4f3bbf6ae52fe0b79f64959660.tar.gz
rest.vyos-ff5224728484eb4f3bbf6ae52fe0b79f64959660.zip
Merge pull request #16 from vyos/T8989_wave4
T8989: wave4 vyos_command, dict_op refactor
Diffstat (limited to 'tests/unit/fixtures')
-rw-r--r--tests/unit/fixtures/bgp_af_running.json17
-rw-r--r--tests/unit/fixtures/bgp_global_running.json14
-rw-r--r--tests/unit/fixtures/firewall_interfaces_running.json14
-rw-r--r--tests/unit/fixtures/ha_running.json44
-rw-r--r--tests/unit/fixtures/nat_running.json80
-rw-r--r--tests/unit/fixtures/route_maps_running.json11
-rw-r--r--tests/unit/fixtures/snmp_server_running.json11
-rw-r--r--tests/unit/fixtures/system_running.json11
-rw-r--r--tests/unit/fixtures/vlan_running.json24
9 files changed, 220 insertions, 6 deletions
diff --git a/tests/unit/fixtures/bgp_af_running.json b/tests/unit/fixtures/bgp_af_running.json
index f9c36d9..8e14e52 100644
--- a/tests/unit/fixtures/bgp_af_running.json
+++ b/tests/unit/fixtures/bgp_af_running.json
@@ -4,7 +4,7 @@
"ipv4-unicast": {
"network": {
"192.0.2.0/24": {},
- "192.0.3.0/24": {}
+ "192.0.3.0/24": { "route-map": "RM-OUT", "backdoor": {} }
},
"redistribute": {
"connected": { "metric": "10" },
@@ -18,7 +18,20 @@
"address-family": {
"ipv4-unicast": {
"nexthop-self": {},
- "soft-reconfiguration": { "inbound": {} }
+ "soft-reconfiguration": { "inbound": {} },
+ "attribute-unchanged": {
+ "as-path": {},
+ "med": {}
+ },
+ "capability": {
+ "orf": {
+ "prefix-list": { "receive": {} }
+ }
+ },
+ "distribute-list": {
+ "import": "10",
+ "export": "20"
+ }
},
"ipv6-unicast": {
"soft-reconfiguration": { "inbound": {} }
diff --git a/tests/unit/fixtures/bgp_global_running.json b/tests/unit/fixtures/bgp_global_running.json
index dc76159..65c3f58 100644
--- a/tests/unit/fixtures/bgp_global_running.json
+++ b/tests/unit/fixtures/bgp_global_running.json
@@ -2,7 +2,14 @@
"system-as": "65000",
"parameters": {
"router-id": "192.0.1.1",
- "log-neighbor-changes": {}
+ "log-neighbor-changes": {},
+ "bestpath": {
+ "as-path": "multipath-relax"
+ },
+ "confederation": {
+ "identifier": "100",
+ "peers": ["65001", "65002"]
+ }
},
"neighbor": {
"192.0.2.1": {
@@ -11,6 +18,11 @@
"timers": {
"holdtime": "30",
"keepalive": "10"
+ },
+ "address-family": {
+ "ipv4-unicast": {
+ "nexthop-self": {}
+ }
}
},
"192.0.2.2": {
diff --git a/tests/unit/fixtures/firewall_interfaces_running.json b/tests/unit/fixtures/firewall_interfaces_running.json
index b0ce2d5..af120ce 100644
--- a/tests/unit/fixtures/firewall_interfaces_running.json
+++ b/tests/unit/fixtures/firewall_interfaces_running.json
@@ -5,7 +5,12 @@
"default-action": "accept",
"rule": {
"10": { "action": "accept", "state": "established" },
- "20": { "action": "drop", "state": "invalid" }
+ "20": {
+ "action": "drop",
+ "state": "invalid",
+ "source": { "address": "10.0.0.0/8" },
+ "destination": { "port": "22" }
+ }
}
}
},
@@ -18,6 +23,13 @@
"filter": {
"default-action": "accept"
}
+ },
+ "name": {
+ "my-ruleset": {
+ "rule": {
+ "1": { "action": "accept" }
+ }
+ }
}
},
"ipv6": {
diff --git a/tests/unit/fixtures/ha_running.json b/tests/unit/fixtures/ha_running.json
new file mode 100644
index 0000000..ee7a257
--- /dev/null
+++ b/tests/unit/fixtures/ha_running.json
@@ -0,0 +1,44 @@
+{
+ "disable": {},
+ "virtual-server": {
+ "s1": {
+ "address": "10.10.10.5",
+ "algorithm": "round-robin",
+ "port": "80",
+ "protocol": "tcp",
+ "real-server": {
+ "10.10.50.2": { "port": "8443" }
+ }
+ }
+ },
+ "vrrp": {
+ "global-parameters": {
+ "startup-delay": "30",
+ "garp": { "master-repeat": "6" }
+ },
+ "snmp": {},
+ "group": {
+ "g1": {
+ "interface": "eth0",
+ "vrid": "20",
+ "priority": "100",
+ "peer-address": "192.168.1.3",
+ "address": { "192.168.1.100/24": {} },
+ "no-preempt": {},
+ "track": { "interface": ["eth1", "eth2"] }
+ },
+ "g2": {
+ "interface": "eth1",
+ "vrid": "21",
+ "priority": "50",
+ "address": "192.168.2.100/24"
+ }
+ },
+ "sync-group": {
+ "sg1": {
+ "member": "g1",
+ "health-check": { "failure-count": "5", "ping": "192.168.1.1" }
+ }
+ }
+ }
+}
diff --git a/tests/unit/fixtures/nat_running.json b/tests/unit/fixtures/nat_running.json
new file mode 100644
index 0000000..abaede0
--- /dev/null
+++ b/tests/unit/fixtures/nat_running.json
@@ -0,0 +1,80 @@
+{
+ "nat": {
+ "source": {
+ "rule": {
+ "100": {
+ "description": "Source rule 100",
+ "outbound-interface": { "name": "eth0" },
+ "translation": { "address": "masquerade" },
+ "load-balance": {
+ "hash": "random",
+ "backend": {
+ "192.168.1.10": { "weight": "50" },
+ "192.168.1.11": {}
+ }
+ }
+ },
+ "101": {
+ "outbound-interface": { "name": "eth1" },
+ "translation": { "address": "masquerade" }
+ }
+ }
+ },
+ "destination": {
+ "rule": {
+ "200": {
+ "protocol": "tcp",
+ "inbound-interface": { "name": "eth0" },
+ "destination": { "address": "198.51.100.10", "port": "80" },
+ "translation": { "address": "192.168.1.10", "port": "8080" }
+ }
+ }
+ },
+ "static": {
+ "rule": {
+ "300": {
+ "inbound-interface": "eth0",
+ "destination": { "address": "198.51.100.20" },
+ "translation": { "address": "192.168.1.20" }
+ }
+ }
+ },
+ "cgnat": {
+ "log-allocation": {},
+ "pool": {
+ "external": {
+ "EXT1": {
+ "external-port-range": "1024-65535",
+ "range": {
+ "203.0.113.1-203.0.113.10": { "seq": "1" }
+ }
+ }
+ },
+ "internal": {
+ "INT1": {
+ "range": ["10.0.0.0/24", "10.0.1.0/24"]
+ }
+ }
+ },
+ "rule": {
+ "1": {
+ "destination": { "group": { "address-group": "CGNAT-DST" } }
+ }
+ }
+ }
+ },
+ "nat64": {
+ "source": {
+ "rule": {
+ "10": {
+ "source": { "prefix": "2001:db8::/96" },
+ "translation": {
+ "pool": {
+ "1": { "address": "192.168.100.10", "port": "1-65535" }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/unit/fixtures/route_maps_running.json b/tests/unit/fixtures/route_maps_running.json
index acf733b..0ae4939 100644
--- a/tests/unit/fixtures/route_maps_running.json
+++ b/tests/unit/fixtures/route_maps_running.json
@@ -4,11 +4,18 @@
"rule": {
"10": {
"action": "permit",
- "match": { "peer": "192.0.2.32" },
+ "match": {
+ "peer": "192.0.2.32",
+ "ip": {
+ "address": { "prefix-list": "PL-MATCH" },
+ "nexthop": { "address": "10.0.0.1" }
+ }
+ },
"set": {
"aggregator": { "as": "100" },
"as-path": { "exclude": "111" },
- "metric": "5"
+ "metric": "5",
+ "community": { "add": ["no-export", "no-advertise"] }
}
}
}
diff --git a/tests/unit/fixtures/snmp_server_running.json b/tests/unit/fixtures/snmp_server_running.json
index 7acc59f..47d1067 100644
--- a/tests/unit/fixtures/snmp_server_running.json
+++ b/tests/unit/fixtures/snmp_server_running.json
@@ -10,6 +10,9 @@
"20.1.1.1": {},
"100.1.2.1": { "port": "33" }
},
+ "trap-target": {
+ "203.0.113.5": { "community": "public", "port": "162" }
+ },
"v3": {
"engineid": "000000000000000000000002",
"group": {
@@ -30,6 +33,14 @@
},
"view": {
"default": { "oid": { "1": {} } }
+ },
+ "trap-target": {
+ "198.51.100.5": {
+ "port": "162",
+ "protocol": "udp",
+ "type": "inform",
+ "auth": { "type": "sha", "encrypted-password": "def456" }
+ }
}
}
}
diff --git a/tests/unit/fixtures/system_running.json b/tests/unit/fixtures/system_running.json
new file mode 100644
index 0000000..1193645
--- /dev/null
+++ b/tests/unit/fixtures/system_running.json
@@ -0,0 +1,11 @@
+{
+ "config-management": { "commit-revisions": "100" },
+ "console": { "device": { "ttyS0": { "speed": "115200" } } },
+ "host-name": "vyos150",
+ "domain-name": "lab.example.com",
+ "login": {
+ "user": { "vyos": { "authentication": { "encrypted-password": "$6$abc" } } }
+ },
+ "name-server": ["8.8.8.8", "8.8.4.4"],
+ "syslog": { "local": {} }
+}
diff --git a/tests/unit/fixtures/vlan_running.json b/tests/unit/fixtures/vlan_running.json
new file mode 100644
index 0000000..80edcb1
--- /dev/null
+++ b/tests/unit/fixtures/vlan_running.json
@@ -0,0 +1,24 @@
+{
+ "ethernet": {
+ "eth1": {
+ "hw-id": "52:54:00:xx",
+ "vif": {
+ "10": {
+ "description": "VLAN10",
+ "address": "192.168.10.1/24"
+ },
+ "20": {
+ "description": "VLAN20"
+ }
+ }
+ },
+ "eth2": {
+ "hw-id": "52:54:00:yy",
+ "vif": {
+ "10": {
+ "description": "VLAN10"
+ }
+ }
+ }
+ }
+}