summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoromnom62 <omnom62@outlook.com>2026-05-28 09:03:51 +1000
committeromnom62 <omnom62@outlook.com>2026-05-28 09:03:51 +1000
commit015e83683bb84ce565177a8ebae825635c755580 (patch)
treeb8609043b1e55b0052bd94f038f6d8b797e881c6
parentaeedc73003ddcf84bbf5c2880f982b6d4925e0c9 (diff)
downloadrest.vyos-015e83683bb84ce565177a8ebae825635c755580.tar.gz
rest.vyos-015e83683bb84ce565177a8ebae825635c755580.zip
SIT test framework
-rw-r--r--tests/integration/network-integration.cfg7
-rw-r--r--tests/integration/targets/vyos_banner/aliases2
-rw-r--r--tests/integration/targets/vyos_hostname/aliases2
-rw-r--r--tests/integration/targets/vyos_lldp_global/aliases2
-rw-r--r--tests/integration/targets/vyos_logging_global/aliases2
-rw-r--r--tests/integration/targets/vyos_ntp_global/aliases2
-rw-r--r--tests/integration/targets/vyos_ntp_global/tasks/main.yaml152
-rw-r--r--tests/integration/targets/vyos_prefix_lists/aliases2
-rw-r--r--tests/integration/targets/vyos_route_maps/aliases2
-rw-r--r--tests/integration/targets/vyos_snmp_server/aliases2
10 files changed, 16 insertions, 159 deletions
diff --git a/tests/integration/network-integration.cfg b/tests/integration/network-integration.cfg
index e510865..d12c1ef 100644
--- a/tests/integration/network-integration.cfg
+++ b/tests/integration/network-integration.cfg
@@ -1,3 +1,4 @@
-[default]
-# ansible-test network-integration config
-testcase=*
+[persistent_connection]
+command_timeout = 100
+connect_timeout = 100
+connect_retry_timeout = 100
diff --git a/tests/integration/targets/vyos_banner/aliases b/tests/integration/targets/vyos_banner/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_banner/aliases
+++ b/tests/integration/targets/vyos_banner/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_hostname/aliases b/tests/integration/targets/vyos_hostname/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_hostname/aliases
+++ b/tests/integration/targets/vyos_hostname/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_lldp_global/aliases b/tests/integration/targets/vyos_lldp_global/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_lldp_global/aliases
+++ b/tests/integration/targets/vyos_lldp_global/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_logging_global/aliases b/tests/integration/targets/vyos_logging_global/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_logging_global/aliases
+++ b/tests/integration/targets/vyos_logging_global/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_ntp_global/aliases b/tests/integration/targets/vyos_ntp_global/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_ntp_global/aliases
+++ b/tests/integration/targets/vyos_ntp_global/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_ntp_global/tasks/main.yaml b/tests/integration/targets/vyos_ntp_global/tasks/main.yaml
index 7c59a7f..b1f6193 100644
--- a/tests/integration/targets/vyos_ntp_global/tasks/main.yaml
+++ b/tests/integration/targets/vyos_ntp_global/tasks/main.yaml
@@ -1,149 +1,5 @@
---
-# tests/integration/targets/vyos_ntp_global/tasks/main.yaml
-# Run with: ansible-test network-integration vyos_ntp_global --inventory <inv>
-
-- name: TEARDOWN — delete all NTP config before tests
- vyos.rest.vyos_ntp_global:
- state: deleted
-
-# ------------------------------------------------------------------
-# MERGED
-# ------------------------------------------------------------------
-
-- name: MERGED — set initial NTP config
- register: result
- vyos.rest.vyos_ntp_global:
- config:
- allow_clients:
- - 10.6.6.0/24
- listen_addresses:
- - 10.1.3.1
- servers:
- - server: 203.0.113.0
- options:
- - prefer
- state: merged
-
-- name: ASSERT — merged changed
- assert:
- that:
- - result.changed == true
- - result.commands | length > 0
-
-- name: MERGED — idempotency check
- register: result
- vyos.rest.vyos_ntp_global:
- config:
- allow_clients:
- - 10.6.6.0/24
- listen_addresses:
- - 10.1.3.1
- servers:
- - server: 203.0.113.0
- options:
- - prefer
- state: merged
-
-- name: ASSERT — merged idempotent
- assert:
- that:
- - result.changed == false
- - result.commands | length == 0
-
-# ------------------------------------------------------------------
-# GATHERED
-# ------------------------------------------------------------------
-
-- name: GATHERED — read current config
- register: result
- vyos.rest.vyos_ntp_global:
- state: gathered
-
-- name: ASSERT — gathered returns correct data
- assert:
- that:
- - "'10.6.6.0/24' in result.gathered.allow_clients"
- - "'10.1.3.1' in result.gathered.listen_addresses"
- - "'203.0.113.0' in result.gathered.servers"
-
-# ------------------------------------------------------------------
-# REPLACED
-# ------------------------------------------------------------------
-
-- name: REPLACED — replace with different config
- register: result
- vyos.rest.vyos_ntp_global:
- config:
- allow_clients:
- - 10.99.99.0/24
- servers:
- - server: time1.vyos.net
- state: replaced
-
-- name: ASSERT — replaced changed
- assert:
- that:
- - result.changed == true
-
-- name: REPLACED — idempotency check
- register: result
- vyos.rest.vyos_ntp_global:
- config:
- allow_clients:
- - 10.99.99.0/24
- servers:
- - server: time1.vyos.net
- state: replaced
-
-- name: ASSERT — replaced idempotent
- assert:
- that:
- - result.changed == false
-
-- name: GATHER — verify old allow_client removed
- register: result
- vyos.rest.vyos_ntp_global:
- state: gathered
-
-- name: ASSERT — old allow_client not present
- assert:
- that:
- - "'10.6.6.0/24' not in result.gathered.allow_clients"
- - "'10.99.99.0/24' in result.gathered.allow_clients"
-
-# ------------------------------------------------------------------
-# DELETED
-# ------------------------------------------------------------------
-
-- name: DELETED — remove all NTP config
- register: result
- vyos.rest.vyos_ntp_global:
- state: deleted
-
-- name: ASSERT — deleted changed
- assert:
- that:
- - result.changed == true
-
-- name: DELETED — idempotency check
- register: result
- vyos.rest.vyos_ntp_global:
- state: deleted
-
-- name: ASSERT — deleted idempotent
- assert:
- that:
- - result.changed == false
-
-# ------------------------------------------------------------------
-# TEARDOWN
-# ------------------------------------------------------------------
-
-- name: TEARDOWN — restore default NTP servers
- vyos.rest.vyos_ntp_global:
- config:
- servers:
- - server: time1.vyos.net
- - server: time2.vyos.net
- - server: time3.vyos.net
- state: merged
+- name: Run httpapi tests
+ ansible.builtin.include_tasks: httpapi.yaml
+ tags:
+ - httpapi
diff --git a/tests/integration/targets/vyos_prefix_lists/aliases b/tests/integration/targets/vyos_prefix_lists/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_prefix_lists/aliases
+++ b/tests/integration/targets/vyos_prefix_lists/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_route_maps/aliases b/tests/integration/targets/vyos_route_maps/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_route_maps/aliases
+++ b/tests/integration/targets/vyos_route_maps/aliases
@@ -1 +1 @@
-network
+network/vyos
diff --git a/tests/integration/targets/vyos_snmp_server/aliases b/tests/integration/targets/vyos_snmp_server/aliases
index 992ae12..cc0afef 100644
--- a/tests/integration/targets/vyos_snmp_server/aliases
+++ b/tests/integration/targets/vyos_snmp_server/aliases
@@ -1 +1 @@
-network
+network/vyos