summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_facts
diff options
context:
space:
mode:
authoromnom62 <omnom62@outlook.com>2026-07-06 14:54:12 +1000
committerJohn Estabrook <jestabro@vyos.io>2026-08-21 14:02:19 -0500
commit45dc95873fd906c582fbbd5e6ca3838caf867399 (patch)
tree71b3e53e0080da60abf9fd2381705971dfe4d507 /tests/integration/targets/vyos_facts
parent7a6b5e4f3a7a021cfa75faa7bf833741dfc09cff (diff)
downloadrest.vyos-T8989_wave4.tar.gz
rest.vyos-T8989_wave4.zip
T8989: wave4 vyos_command, dict_op refactorT8989_wave4
* T8989: vyos_command module * T8989: vyos_command module UAT and SIT * T8989: vyos_command changelog * T8989: vyos_command linter * T8989: vyos_config module * T8989: vyos_config module changelog * T8989: Wave 4 vyos_config module with integration and unit tests * T8323: vyos_system module * T8332: vyos_system SIT and UAT * T8323: vyos_vlan module * T8323: vyos_vlan module * T8323: vyos_vlan module SIT and UAT * T8323: vyos_system module * T8989: Wave 4 vyos_vlan reworked with dict_op engine * T8989: Fix dict_op single-value string list handling, add vyos_system integration tests * T8989: logging_global refactor * T8989: migrate ntp_global, logging_global, firewall_global to dict_op engine * T8989: vyos_nat module for REST API collection * T8989: vyos_nat module for REST API collection, linter fixes * T8989: vyos_ha module for REST API collection * T8989: vyos_ha module for REST API collection * T8989: vyos_ha module sanity and linter fixes * T8989: vyos_ha module sanity and linter fixes * T8989: vyos_ha module linter fixes * T8989: vyos.rest AI comment fixes * T8323: vyos_nat AI comment fixes * T8989 ai fixes * T8989: vyos_bgp_address_family dict_op * T8989: vyos_bgp_address_family vyos_bgp_global dict_op * T8989: dict_op refactor for firewall_*, nat, user * T8989: dict_op refactor for firewall_*, nat, user * T8989: dict_op refactor for ntp_global, ha * T8989: snmp_server dict_op refactor * T8989: snmp_server dict_op refactor * T8989: route_map dict_op refactor
Diffstat (limited to 'tests/integration/targets/vyos_facts')
-rw-r--r--tests/integration/targets/vyos_facts/tasks/httpapi.yaml2
-rw-r--r--tests/integration/targets/vyos_facts/tests/httpapi/_populate_config.yaml16
-rw-r--r--tests/integration/targets/vyos_facts/tests/httpapi/_remove_config.yaml8
-rw-r--r--tests/integration/targets/vyos_facts/tests/httpapi/all.yaml5
-rw-r--r--tests/integration/targets/vyos_facts/tests/httpapi/default.yaml4
-rw-r--r--tests/integration/targets/vyos_facts/tests/httpapi/subsets.yaml25
6 files changed, 46 insertions, 14 deletions
diff --git a/tests/integration/targets/vyos_facts/tasks/httpapi.yaml b/tests/integration/targets/vyos_facts/tasks/httpapi.yaml
index 4147e6d..0ed3e42 100644
--- a/tests/integration/targets/vyos_facts/tasks/httpapi.yaml
+++ b/tests/integration/targets/vyos_facts/tasks/httpapi.yaml
@@ -9,7 +9,7 @@
- name: Set test_items
ansible.builtin.set_fact:
- test_items: "{{ test_cases.files | map(attribute='path') | list }}"
+ test_items: "{{ test_cases.files | map(attribute='path') | list | sort }}"
- name: Run test case (connection=httpapi)
ansible.builtin.include_tasks: "{{ test_case_to_run }}"
diff --git a/tests/integration/targets/vyos_facts/tests/httpapi/_populate_config.yaml b/tests/integration/targets/vyos_facts/tests/httpapi/_populate_config.yaml
new file mode 100644
index 0000000..690c0c8
--- /dev/null
+++ b/tests/integration/targets/vyos_facts/tests/httpapi/_populate_config.yaml
@@ -0,0 +1,16 @@
+---
+- name: Configure logging for facts testing
+ vyos.rest.vyos_logging_global:
+ config:
+ global_params:
+ facilities:
+ - facility: all
+ severity: notice
+ state: merged
+
+- name: Configure NTP for facts testing
+ vyos.rest.vyos_ntp_global:
+ config:
+ servers:
+ - server: time1.vyos.net
+ state: merged
diff --git a/tests/integration/targets/vyos_facts/tests/httpapi/_remove_config.yaml b/tests/integration/targets/vyos_facts/tests/httpapi/_remove_config.yaml
new file mode 100644
index 0000000..fbc2e73
--- /dev/null
+++ b/tests/integration/targets/vyos_facts/tests/httpapi/_remove_config.yaml
@@ -0,0 +1,8 @@
+---
+- name: Remove logging config
+ vyos.rest.vyos_logging_global:
+ state: deleted
+
+- name: Remove NTP config
+ vyos.rest.vyos_ntp_global:
+ state: deleted
diff --git a/tests/integration/targets/vyos_facts/tests/httpapi/all.yaml b/tests/integration/targets/vyos_facts/tests/httpapi/all.yaml
index 419634f..4d6ad53 100644
--- a/tests/integration/targets/vyos_facts/tests/httpapi/all.yaml
+++ b/tests/integration/targets/vyos_facts/tests/httpapi/all.yaml
@@ -3,6 +3,8 @@
msg: START vyos_facts all integration tests on connection={{ ansible_connection }}
- block:
+ - include_tasks: _populate_config.yaml
+
- name: Gather all facts
vyos.rest.vyos_facts:
gather_subset: all
@@ -14,3 +16,6 @@
- ansible_facts.vyos_users is defined
- ansible_facts.vyos_config is defined
- ansible_facts.vyos_logging is defined
+
+ always:
+ - include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_facts/tests/httpapi/default.yaml b/tests/integration/targets/vyos_facts/tests/httpapi/default.yaml
index ff1caee..b5937be 100644
--- a/tests/integration/targets/vyos_facts/tests/httpapi/default.yaml
+++ b/tests/integration/targets/vyos_facts/tests/httpapi/default.yaml
@@ -5,9 +5,9 @@
- block:
- name: Gather default facts
vyos.rest.vyos_facts:
+ gather_subset: default
- assert:
that:
- ansible_facts.vyos_hostname is defined
- - ansible_facts.vyos_interfaces is defined
- - ansible_facts.vyos_hostname | length > 0
+ - ansible_facts.vyos_config is defined
diff --git a/tests/integration/targets/vyos_facts/tests/httpapi/subsets.yaml b/tests/integration/targets/vyos_facts/tests/httpapi/subsets.yaml
index eb4ca4f..5151b4a 100644
--- a/tests/integration/targets/vyos_facts/tests/httpapi/subsets.yaml
+++ b/tests/integration/targets/vyos_facts/tests/httpapi/subsets.yaml
@@ -3,31 +3,34 @@
msg: START vyos_facts subsets integration tests on connection={{ ansible_connection }}
- block:
- - name: Gather hostname only
+ - include_tasks: _populate_config.yaml
+
+ - name: Gather logging subset
vyos.rest.vyos_facts:
gather_subset:
- - hostname
+ - logging
- assert:
that:
- - ansible_facts.vyos_hostname is defined
+ - ansible_facts.vyos_logging is defined
- - name: Gather users
+ - name: Gather ntp subset
vyos.rest.vyos_facts:
gather_subset:
- - users
+ - ntp
- assert:
that:
- - ansible_facts.vyos_users is defined
- - ansible_facts.vyos_users | selectattr('name', 'eq', 'vyos') | list | length == 1
+ - ansible_facts.vyos_ntp is defined
- - name: Gather config
+ - name: Gather interfaces subset
vyos.rest.vyos_facts:
gather_subset:
- - config
+ - interfaces
- assert:
that:
- - ansible_facts.vyos_config is defined
- - ansible_facts.vyos_config.system is defined
+ - ansible_facts.vyos_interfaces is defined
+
+ always:
+ - include_tasks: _remove_config.yaml