summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoromnom62 <omnom62@outlook.com>2026-06-03 21:15:28 +1000
committeromnom62 <omnom62@outlook.com>2026-06-03 21:15:28 +1000
commit00aa66292e3aab9215458e45da0f88dce695577a (patch)
tree9459b31d64c8d102736ea2c15f6dbddb7295fa22 /tests
parent2d6ca6bd1d3243269709805257947484ddd273ec (diff)
downloadrest.vyos-00aa66292e3aab9215458e45da0f88dce695577a.tar.gz
rest.vyos-00aa66292e3aab9215458e45da0f88dce695577a.zip
snmp_server uat
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/targets/prepare_vyos_tests/meta/main.yaml2
-rw-r--r--tests/integration/targets/prepare_vyos_tests/tasks/main.yaml5
-rw-r--r--tests/integration/targets/vyos_snmp_server/meta/main.yaml3
-rw-r--r--tests/integration/targets/vyos_snmp_server/tests/httpapi/_populate_config.yaml3
-rw-r--r--tests/integration/targets/vyos_snmp_server/tests/httpapi/_remove_config.yaml2
-rw-r--r--tests/integration/targets/vyos_snmp_server/tests/httpapi/deleted.yaml1
-rw-r--r--tests/integration/targets/vyos_snmp_server/tests/httpapi/gathered.yaml1
-rw-r--r--tests/integration/targets/vyos_snmp_server/tests/httpapi/merged.yaml2
-rw-r--r--tests/integration/targets/vyos_snmp_server/tests/httpapi/replaced.yaml1
9 files changed, 13 insertions, 7 deletions
diff --git a/tests/integration/targets/prepare_vyos_tests/meta/main.yaml b/tests/integration/targets/prepare_vyos_tests/meta/main.yaml
new file mode 100644
index 0000000..61d3ffe
--- /dev/null
+++ b/tests/integration/targets/prepare_vyos_tests/meta/main.yaml
@@ -0,0 +1,2 @@
+---
+allow_duplicates: true
diff --git a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml
new file mode 100644
index 0000000..9527685
--- /dev/null
+++ b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml
@@ -0,0 +1,5 @@
+---
+- name: Add dummy loopback address for SNMP listen test
+ vyos.rest.vyos_configure:
+ commands:
+ - set interfaces loopback lo address 20.1.1.1/32
diff --git a/tests/integration/targets/vyos_snmp_server/meta/main.yaml b/tests/integration/targets/vyos_snmp_server/meta/main.yaml
new file mode 100644
index 0000000..7413320
--- /dev/null
+++ b/tests/integration/targets/vyos_snmp_server/meta/main.yaml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - prepare_vyos_tests
diff --git a/tests/integration/targets/vyos_snmp_server/tests/httpapi/_populate_config.yaml b/tests/integration/targets/vyos_snmp_server/tests/httpapi/_populate_config.yaml
index c847765..d3762c1 100644
--- a/tests/integration/targets/vyos_snmp_server/tests/httpapi/_populate_config.yaml
+++ b/tests/integration/targets/vyos_snmp_server/tests/httpapi/_populate_config.yaml
@@ -1,4 +1,6 @@
---
+- ansible.builtin.include_tasks: _remove_config.yaml
+
- name: Populate snmp_server config for testing
vyos.rest.vyos_snmp_server:
config:
@@ -12,4 +14,3 @@
listen_addresses:
- address: 20.1.1.1
state: merged
- ignore_errors: true
diff --git a/tests/integration/targets/vyos_snmp_server/tests/httpapi/_remove_config.yaml b/tests/integration/targets/vyos_snmp_server/tests/httpapi/_remove_config.yaml
index c77493a..e954df7 100644
--- a/tests/integration/targets/vyos_snmp_server/tests/httpapi/_remove_config.yaml
+++ b/tests/integration/targets/vyos_snmp_server/tests/httpapi/_remove_config.yaml
@@ -1,5 +1,5 @@
+# _remove_config.yaml
---
- name: Remove pre-existing snmp_server config
vyos.rest.vyos_snmp_server:
state: deleted
- ignore_errors: true
diff --git a/tests/integration/targets/vyos_snmp_server/tests/httpapi/deleted.yaml b/tests/integration/targets/vyos_snmp_server/tests/httpapi/deleted.yaml
index 90ee0ae..a626a26 100644
--- a/tests/integration/targets/vyos_snmp_server/tests/httpapi/deleted.yaml
+++ b/tests/integration/targets/vyos_snmp_server/tests/httpapi/deleted.yaml
@@ -2,7 +2,6 @@
- debug:
msg: START vyos_snmp_server deleted integration tests on connection={{ ansible_connection }}
-- include_tasks: _remove_config.yaml
- include_tasks: _populate_config.yaml
- block:
diff --git a/tests/integration/targets/vyos_snmp_server/tests/httpapi/gathered.yaml b/tests/integration/targets/vyos_snmp_server/tests/httpapi/gathered.yaml
index 740446f..770845c 100644
--- a/tests/integration/targets/vyos_snmp_server/tests/httpapi/gathered.yaml
+++ b/tests/integration/targets/vyos_snmp_server/tests/httpapi/gathered.yaml
@@ -2,7 +2,6 @@
- debug:
msg: START vyos_snmp_server gathered integration tests on connection={{ ansible_connection }}
-- include_tasks: _remove_config.yaml
- include_tasks: _populate_config.yaml
- block:
diff --git a/tests/integration/targets/vyos_snmp_server/tests/httpapi/merged.yaml b/tests/integration/targets/vyos_snmp_server/tests/httpapi/merged.yaml
index 475b5fe..e1c6531 100644
--- a/tests/integration/targets/vyos_snmp_server/tests/httpapi/merged.yaml
+++ b/tests/integration/targets/vyos_snmp_server/tests/httpapi/merged.yaml
@@ -2,8 +2,6 @@
- debug:
msg: START vyos_snmp_server merged integration tests on connection={{ ansible_connection }}
-- include_tasks: _remove_config.yaml
-
- block:
- name: Merge snmp_server configuration
register: result
diff --git a/tests/integration/targets/vyos_snmp_server/tests/httpapi/replaced.yaml b/tests/integration/targets/vyos_snmp_server/tests/httpapi/replaced.yaml
index cd9bef2..d989272 100644
--- a/tests/integration/targets/vyos_snmp_server/tests/httpapi/replaced.yaml
+++ b/tests/integration/targets/vyos_snmp_server/tests/httpapi/replaced.yaml
@@ -2,7 +2,6 @@
- debug:
msg: START vyos_snmp_server replaced integration tests on connection={{ ansible_connection }}
-- include_tasks: _remove_config.yaml
- include_tasks: _populate_config.yaml
- block: