diff options
| author | omnom62 <75066712+omnom62@users.noreply.github.com> | 2026-08-22 01:36:21 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-21 10:36:21 -0500 |
| commit | 7a6b5e4f3a7a021cfa75faa7bf833741dfc09cff (patch) | |
| tree | 82dad9c7ca58b7c88ac25f2ef7b04413e259a260 /tests/unit/fixtures | |
| parent | cb738721c15ac01f49f66144dae80eb478331f77 (diff) | |
| download | rest.vyos-7a6b5e4f3a7a021cfa75faa7bf833741dfc09cff.tar.gz rest.vyos-7a6b5e4f3a7a021cfa75faa7bf833741dfc09cff.zip | |
T8989: wave3 user, bgp_global, bgp_address_family, facts, firewall_global
* T8989: vyos_user module
* T8989: Wave 3 vyos_user module with integration and unit tests
* T8989: Wave 3 vyos_bgp_global module with integration and unit tests
* T8989: Wave 3 vyos_bgp_address_family module with integration and unit tests
* T8989: Add overridden integration tests for vyos_bgp_global and vyos_bgp_address_family
* T8989: vyos_facts
* T8989: Add vyos_facts integration and unit tests with fixtures
* T8989: vyos_firewall_global module
* T8989: vyos_firewall_global module with integration and unit tests
* T8989: vyos_firewall_rules module
* T8989: vyos_firewall_rules module with integration and unit tests
* T8989: vyos_firewall_interfaces module
* T8989: vyos_firewall_interfaces module
* T8989: vyos_firewall_interfaces UAT & SIT
* T8989: vyos_firewall_interfaces UAT & SIT
Diffstat (limited to 'tests/unit/fixtures')
| -rw-r--r-- | tests/unit/fixtures/bgp_af_running.json | 29 | ||||
| -rw-r--r-- | tests/unit/fixtures/bgp_global_running.json | 27 | ||||
| -rw-r--r-- | tests/unit/fixtures/facts_interfaces.json | 11 | ||||
| -rw-r--r-- | tests/unit/fixtures/facts_system.json | 28 | ||||
| -rw-r--r-- | tests/unit/fixtures/firewall_global_running.json | 34 | ||||
| -rw-r--r-- | tests/unit/fixtures/firewall_interfaces_running.json | 30 | ||||
| -rw-r--r-- | tests/unit/fixtures/firewall_rules_running.json | 33 | ||||
| -rw-r--r-- | tests/unit/fixtures/user_running.json | 22 |
8 files changed, 214 insertions, 0 deletions
diff --git a/tests/unit/fixtures/bgp_af_running.json b/tests/unit/fixtures/bgp_af_running.json new file mode 100644 index 0000000..f9c36d9 --- /dev/null +++ b/tests/unit/fixtures/bgp_af_running.json @@ -0,0 +1,29 @@ +{ + "system-as": "65000", + "address-family": { + "ipv4-unicast": { + "network": { + "192.0.2.0/24": {}, + "192.0.3.0/24": {} + }, + "redistribute": { + "connected": { "metric": "10" }, + "static": {} + } + } + }, + "neighbor": { + "192.0.2.1": { + "remote-as": "65001", + "address-family": { + "ipv4-unicast": { + "nexthop-self": {}, + "soft-reconfiguration": { "inbound": {} } + }, + "ipv6-unicast": { + "soft-reconfiguration": { "inbound": {} } + } + } + } + } +} diff --git a/tests/unit/fixtures/bgp_global_running.json b/tests/unit/fixtures/bgp_global_running.json new file mode 100644 index 0000000..dc76159 --- /dev/null +++ b/tests/unit/fixtures/bgp_global_running.json @@ -0,0 +1,27 @@ +{ + "system-as": "65000", + "parameters": { + "router-id": "192.0.1.1", + "log-neighbor-changes": {} + }, + "neighbor": { + "192.0.2.1": { + "remote-as": "65001", + "description": "peer1", + "timers": { + "holdtime": "30", + "keepalive": "10" + } + }, + "192.0.2.2": { + "remote-as": "65002", + "ebgp-multihop": "2", + "update-source": "eth0" + } + }, + "peer-group": { + "PG1": { + "remote-as": "65003" + } + } +} diff --git a/tests/unit/fixtures/facts_interfaces.json b/tests/unit/fixtures/facts_interfaces.json new file mode 100644 index 0000000..b58e17f --- /dev/null +++ b/tests/unit/fixtures/facts_interfaces.json @@ -0,0 +1,11 @@ +{ + "ethernet": { + "eth0": { "address": "dhcp", "hw-id": "52:54:00:65:5a:24" }, + "eth1": { + "description": "uplink", + "hw-id": "52:54:00:96:42:93", + "mtu": "1500" + }, + "eth2": { "hw-id": "52:54:00:75:31:fa" } + } +} diff --git a/tests/unit/fixtures/facts_system.json b/tests/unit/fixtures/facts_system.json new file mode 100644 index 0000000..68091ed --- /dev/null +++ b/tests/unit/fixtures/facts_system.json @@ -0,0 +1,28 @@ +{ + "host-name": "vyos-test", + "login": { + "user": { + "vyos": { + "authentication": { + "encrypted-password": "$6$abc123" + } + }, + "alice": { + "full-name": "Alice Smith", + "authentication": { + "encrypted-password": "$6$def456", + "public-keys": { + "alice-key": { + "key": "AAAAB3...", + "type": "ssh-rsa" + } + } + } + } + } + }, + "syslog": { + "local": {}, + "console": {} + } +} diff --git a/tests/unit/fixtures/firewall_global_running.json b/tests/unit/fixtures/firewall_global_running.json new file mode 100644 index 0000000..9463cd7 --- /dev/null +++ b/tests/unit/fixtures/firewall_global_running.json @@ -0,0 +1,34 @@ +{ + "address-group": { + "SERVERS": { + "description": "Web servers", + "address": ["192.168.1.10", "192.168.1.11"] + }, + "DNS": { + "address": "8.8.8.8" + } + }, + "network-group": { + "LAN": { + "network": "192.168.0.0/16" + }, + "DMZ": { + "network": ["10.0.0.0/8", "172.16.0.0/12"] + } + }, + "port-group": { + "WEB-PORTS": { + "port": ["80", "443"] + } + }, + "interface-group": { + "LAN-IFACES": { + "interface": "eth1" + } + }, + "ipv6-network-group": { + "IPV6-LAN": { + "network": "2001:db8::/32" + } + } +} diff --git a/tests/unit/fixtures/firewall_interfaces_running.json b/tests/unit/fixtures/firewall_interfaces_running.json new file mode 100644 index 0000000..b0ce2d5 --- /dev/null +++ b/tests/unit/fixtures/firewall_interfaces_running.json @@ -0,0 +1,30 @@ +{ + "ipv4": { + "input": { + "filter": { + "default-action": "accept", + "rule": { + "10": { "action": "accept", "state": "established" }, + "20": { "action": "drop", "state": "invalid" } + } + } + }, + "forward": { + "filter": { + "default-action": "accept" + } + }, + "output": { + "filter": { + "default-action": "accept" + } + } + }, + "ipv6": { + "input": { + "filter": { + "default-action": "accept" + } + } + } +} diff --git a/tests/unit/fixtures/firewall_rules_running.json b/tests/unit/fixtures/firewall_rules_running.json new file mode 100644 index 0000000..8fbd12c --- /dev/null +++ b/tests/unit/fixtures/firewall_rules_running.json @@ -0,0 +1,33 @@ +{ + "ipv4": { + "name": { + "RULE-SET1": { + "default-action": "drop", + "rule": { + "10": { + "action": "accept", + "protocol": "tcp", + "source": { "address": "192.168.1.0/24" }, + "destination": { "port": "80" } + }, + "20": { + "action": "drop", + "state": "invalid" + } + } + } + } + }, + "ipv6": { + "name": { + "RULE-SET6": { + "default-action": "accept", + "rule": { + "10": { + "action": "accept" + } + } + } + } + } +} diff --git a/tests/unit/fixtures/user_running.json b/tests/unit/fixtures/user_running.json new file mode 100644 index 0000000..4bc9c19 --- /dev/null +++ b/tests/unit/fixtures/user_running.json @@ -0,0 +1,22 @@ +{ + "user": { + "vyos": { + "authentication": { + "encrypted-password": "$6$abc123", + "plaintext-password": "" + } + }, + "alice": { + "authentication": { + "encrypted-password": "$6$def456", + "public-keys": { + "alice-laptop": { + "key": "AAAAB3NzaC1yc2EAAAA", + "type": "ssh-rsa" + } + } + }, + "full-name": "Alice Smith" + } + } +} |
