Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix legacy Nexus 3k integration test and module issues. #40322

Merged
merged 6 commits into from May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/ansible/modules/network/nxos/nxos_facts.py
Expand Up @@ -499,7 +499,13 @@ def parse_module(self, data):
return objects

def parse_fan_info(self, data):
data = data['fandetails']['TABLE_faninfo']['ROW_faninfo']
objects = list()
if data.get('fandetails'):
data = data['fandetails']['TABLE_faninfo']['ROW_faninfo']
elif data.get('fandetails_3k'):
data = data['fandetails_3k']['TABLE_faninfo']['ROW_faninfo']
else:
return objects
objects = list(self.transform_iterable(data, self.FAN_MAP))
return objects

Expand Down
Expand Up @@ -8,6 +8,7 @@
lines: no ip access-list test
provider: "{{ connection }}"
match: none
ignore_errors: yes

- name: configure sub level command using block replace
nxos_config:
Expand Down
Expand Up @@ -3,6 +3,10 @@
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"

- set_fact: bidir="true"
- set_fact: bidir="false"
when: platform is match("N3L")

- block:
- name: "Disable feature PIM"
nxos_feature: &disable_feature
Expand All @@ -20,7 +24,7 @@
nxos_pim_rp_address: &configgl
rp_address: "10.1.1.20"
group_list: "224.0.0.0/8"
bidir: True
bidir: "{{ bidir }}"
state: present
provider: "{{ connection }}"
register: result
Expand All @@ -45,19 +49,23 @@
state: present
provider: "{{ connection }}"
register: result
when: platform is not match("N3L")

- assert: *true
when: platform is not match("N3L")

- name: Check idempotence rp_address + group_list remove bidir
nxos_pim_rp_address: *configglnb
register: result
when: platform is not match("N3L")

- assert: *false
when: platform is not match("N3L")

- name: Configure rp_address + bidir
nxos_pim_rp_address: &configbi
rp_address: "10.1.1.20"
bidir: True
bidir: "{{ bidir }}"
state: present
provider: "{{ connection }}"
register: result
Expand All @@ -77,14 +85,18 @@
state: present
provider: "{{ connection }}"
register: result
when: platform is not match("N3L")

- assert: *true
when: platform is not match("N3L")

- name: Check idempotence rp_address remove bidir
nxos_pim_rp_address: *confignbi
register: result
when: platform is not match("N3L")

- assert: *false
when: platform is not match("N3L")

- name: Remove rp_address + group_list
nxos_pim_rp_address: &configglr
Expand Down Expand Up @@ -121,7 +133,7 @@
nxos_pim_rp_address: &configpl
rp_address: "10.1.1.20"
prefix_list: "pim_prefix_list"
bidir: True
bidir: "{{ bidir }}"
state: present
provider: "{{ connection }}"
register: result
Expand All @@ -142,14 +154,18 @@
state: present
provider: "{{ connection }}"
register: result
when: platform is not match("N3L")

- assert: *true
when: platform is not match("N3L")

- name: Check idempotence rp_address + prefix_list
nxos_pim_rp_address: *configplnbi
register: result
when: platform is not match("N3L")

- assert: *false
when: platform is not match("N3L")

- name: Remove rp_address + prefix_list
nxos_pim_rp_address: &configplr
Expand All @@ -172,7 +188,7 @@
nxos_pim_rp_address: &configrm
rp_address: "10.1.1.20"
route_map: "pim_routemap"
bidir: True
bidir: "{{ bidir }}"
state: present
provider: "{{ connection }}"
register: result
Expand All @@ -193,14 +209,18 @@
state: present
provider: "{{ connection }}"
register: result
when: platform is not match("N3L")

- assert: *true
when: platform is not match("N3L")

- name: Check idempotence rp_address + route_map
nxos_pim_rp_address: *configrmnbi
register: result
when: platform is not match("N3L")

- assert: *false
when: platform is not match("N3L")

- name: Remove rp_address + route_map
nxos_pim_rp_address: &configrmr
Expand Down
4 changes: 2 additions & 2 deletions test/integration/targets/nxos_vrf/tests/common/sanity.yaml
Expand Up @@ -13,10 +13,10 @@
when: (platform is not match("N35|N7K")) and ((imagetag != 'I2'))

- set_fact: vnind="5000"
when: platform is not match("N35|N7K")
when: platform is not match("N35|N7K|N3L")

- set_fact: vnid="default"
when: platform is not match("N35|N7K")
when: platform is not match("N35|N7K|N3L")

- name: "Enable feature BGP"
nxos_feature:
Expand Down
Expand Up @@ -130,7 +130,7 @@

- assert: *false

when: not platform is search("N35")
when: not platform is search("N35|N3L")

always:
- name: Remove vrf
Expand Down
4 changes: 4 additions & 0 deletions test/integration/targets/prepare_nxos_tests/tasks/main.yml
Expand Up @@ -80,6 +80,10 @@
- set_fact: platform="N35NG"
when: ( chassis_type is search("C35")) and image_version is search("7.0\(3\)I7")

# Set platform to N3L(N3K Legacy) for C3048 platform.
- set_fact: platform="N3L"
when: ( chassis_type is search("C3048"))

# Create matrix of simple keys based on platform
# and image version for use within test playbooks.
- set_fact: imagetag=""
Expand Down