From f647769d943db3f7418bc245ec4b385985371959 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Mon, 23 Dec 2019 10:37:44 -0500 Subject: [PATCH] Add default rsvd_intf_len for Zuul CI --- .../nxos_l3_interfaces/tasks/main.yaml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/integration/targets/nxos_l3_interfaces/tasks/main.yaml b/test/integration/targets/nxos_l3_interfaces/tasks/main.yaml index 4657eb28f78f4a..44edf825814470 100644 --- a/test/integration/targets/nxos_l3_interfaces/tasks/main.yaml +++ b/test/integration/targets/nxos_l3_interfaces/tasks/main.yaml @@ -1,11 +1,18 @@ --- -# mgmt0 is included in L3 facts but excluded from result.before/after, so check -# for an IP on mgmt0 to account for the possible extra interface in facts. +# The interface-count asserts need to also account for mgmt0 which is a reserved +# interface; i.e. it will be included in L3 facts when it has non-default values +# but excluded from result.before/after because it's not allowed to be managed. - set_fact: - mgmt: - "{{ intdataraw|selectattr('interface', 'equalto', 'mgmt0')|list}}" -- set_fact: - rsvd_intf_len: - "{{ 1 if (mgmt and 'ip_addr' in mgmt[0]) else 0}}" + # Zuul CI skips prepare_nxos but will have dhcp configured on mgmt0 + rsvd_intf_len: 1 + +- block: + - set_fact: + mgmt: + "{{ intdataraw|selectattr('interface', 'equalto', 'mgmt0')|list}}" + - set_fact: + rsvd_intf_len: + "{{ 1 if (mgmt and 'ip_addr' in mgmt[0]) else 0}}" + when: prepare_nxos_tests_task | default(True) | bool - { include: cli.yaml, tags: ['cli'] }