diff --git a/tests/integration/targets/vyos_firewall_global/tests/cli/_populate.yaml b/tests/integration/targets/vyos_firewall_global/tests/cli/_populate.yaml index ccd0f679..fe183aa6 100644 --- a/tests/integration/targets/vyos_firewall_global/tests/cli/_populate.yaml +++ b/tests/integration/targets/vyos_firewall_global/tests/cli/_populate.yaml @@ -1,11 +1,18 @@ --- - ansible.builtin.include_tasks: _remove_config.yaml - name: ensure facts include_tasks: _get_version.yaml +- name: Setup zone VRF prerequisites + vyos.vyos.vyos_config: + lines: "{{ zone_vrf_prereq_commands }}" + vars: + ansible_connection: ansible.netcommon.network_cli + when: zone_vrf_prereq_commands is defined + - name: Setup {{ vyos_version }} vyos.vyos.vyos_config: lines: "{{ populate_commands }}" vars: ansible_connection: ansible.netcommon.network_cli diff --git a/tests/integration/targets/vyos_firewall_global/vars/v1_5.yaml b/tests/integration/targets/vyos_firewall_global/vars/v1_5.yaml index 47820658..b44cb8c3 100644 --- a/tests/integration/targets/vyos_firewall_global/vars/v1_5.yaml +++ b/tests/integration/targets/vyos_firewall_global/vars/v1_5.yaml @@ -1,114 +1,120 @@ --- merged_commands: - set firewall group address-group MGMT-HOSTS address 192.0.1.1 - set firewall group address-group MGMT-HOSTS address 192.0.1.3 - set firewall group address-group MGMT-HOSTS address 192.0.1.5 - set firewall group address-group MGMT-HOSTS description 'This group has the Management hosts address list' - set firewall group address-group MGMT-HOSTS - set firewall group network-group MGMT network 192.0.1.0/24 - set firewall group network-group MGMT description 'This group has the Management network addresses' - set firewall group network-group MGMT - set firewall global-options ip-src-route 'enable' - set firewall global-options receive-redirects 'disable' - set firewall global-options send-redirects 'enable' - set firewall global-options state-policy established action 'accept' - set firewall global-options state-policy established log - set firewall global-options state-policy invalid action 'reject' - set firewall global-options broadcast-ping 'enable' - set firewall global-options all-ping 'enable' - set firewall global-options log-martians 'enable' - set firewall global-options twa-hazards-protection 'enable' - set firewall global-options syn-cookies 'enable' - set firewall global-options source-validation 'strict' - set firewall zone ZONE-TEST description 'zone-test test description' - set firewall zone ZONE-TEST member interface eth0.1234 - set firewall zone ZONE-TEST default-action 'drop' +# VyOS 1.5 refuses a VRF zone member unless the VRF already holds an +# interface in the running system (get_vrf_members() reads the kernel), +# so the VRF and its dummy member are committed before populate_commands. +zone_vrf_prereq_commands: + - set vrf name vrf_evpn1 table '1001' + - set interfaces dummy dum9756 vrf 'vrf_evpn1' + populate_commands: - set firewall global-options all-ping 'enable' - set firewall global-options broadcast-ping 'enable' - set firewall group address-group MGMT-HOSTS address '192.0.1.1' - set firewall group address-group MGMT-HOSTS address '192.0.1.3' - set firewall group address-group MGMT-HOSTS address '192.0.1.5' - set firewall group address-group MGMT-HOSTS description 'This group has the Management hosts address list' - set firewall group network-group MGMT description 'This group has the Management network addresses' - set firewall group network-group MGMT network '192.0.1.0/24' - set firewall global-options ip-src-route 'enable' - set firewall global-options log-martians 'enable' - set firewall global-options receive-redirects 'disable' - set firewall global-options send-redirects 'enable' - set firewall global-options source-validation 'strict' - set firewall global-options state-policy established action 'accept' - set firewall global-options state-policy established log - set firewall global-options state-policy invalid action 'reject' - set firewall global-options syn-cookies 'enable' - set firewall global-options twa-hazards-protection 'enable' - - set vrf name vrf_evpn1 table '1001' - set firewall zone ZONE-TEST member interface 'eth0.1234' - set firewall zone ZONE-TEST member vrf 'vrf_evpn1' - set firewall zone ZONE-TEST description 'zone-test test description' replaced_commands: - delete firewall group address-group MGMT-HOSTS - delete firewall zone ZONE-TEST - set firewall group address-group SALES-HOSTS address 192.0.2.1 - set firewall group address-group SALES-HOSTS address 192.0.2.2 - set firewall group address-group SALES-HOSTS address 192.0.2.3 - set firewall group address-group SALES-HOSTS description 'Sales office hosts address list' - set firewall group address-group SALES-HOSTS - set firewall group address-group ENG-HOSTS address 192.0.3.1 - set firewall group address-group ENG-HOSTS address 192.0.3.2 - set firewall group address-group ENG-HOSTS description 'Sales office hosts address list' - set firewall group address-group ENG-HOSTS - set firewall zone FZP-2 default-action 'reject' - set firewall zone FZP-2 default-log - set firewall zone FZP-2 description 'This is the Firewall zone fzp2' - set firewall zone FZP-2 member interface eth2 - set firewall zone FZP-2 member interface lo - set firewall zone FZP-2 member vrf vrf_evpn1 - set firewall zone FZP-2 intra-zone-filtering action accept rendered_commands: - set firewall group address-group SALES-HOSTS address 192.0.2.1 - set firewall group address-group SALES-HOSTS address 192.0.2.2 - set firewall group address-group SALES-HOSTS address 192.0.2.3 - set firewall group address-group SALES-HOSTS description 'Sales office hosts address list' - set firewall group address-group SALES-HOSTS - set firewall group address-group ENG-HOSTS address 192.0.3.1 - set firewall group address-group ENG-HOSTS address 192.0.3.2 - set firewall group address-group ENG-HOSTS description 'Sales office hosts address list' - set firewall group address-group ENG-HOSTS - set firewall group network-group MGMT network 192.0.1.0/24 - set firewall group network-group MGMT description 'This group has the Management network addresses' - set firewall group network-group MGMT - set firewall global-options ip-src-route 'enable' - set firewall global-options receive-redirects 'disable' - set firewall global-options send-redirects 'enable' - set firewall global-options state-policy established action 'accept' - set firewall global-options state-policy established log - set firewall global-options state-policy invalid action 'reject' - set firewall global-options broadcast-ping 'enable' - set firewall global-options all-ping 'enable' - set firewall global-options log-martians 'enable' - set firewall global-options twa-hazards-protection 'enable' - set firewall global-options syn-cookies 'enable' - set firewall global-options source-validation 'strict' - set firewall zone ZONE-TEST member interface eth0.1234 - set firewall zone ZONE-TEST member vrf vrf_evpn1 - set firewall zone ZONE-TEST description 'zone-test test description' - set firewall zone ZONE-TEST default-action 'drop' deleted_commands: - "delete firewall" parsed_config_file: "_parsed_config_1_5.cfg" replaced_diff: - '+ network "1.1.1.1/32"' - '- network "192.0.1.0/24"' merged_diff: - '+ network "1.1.1.1/32"' deleted_diff: - '- network "192.0.1.0/24"'