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

Fixes for the N3500 platform that uses the A8 image #36261

Merged
merged 4 commits into from
Feb 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
3 changes: 3 additions & 0 deletions lib/ansible/modules/network/nxos/nxos_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ def main():
cmds = get_commands(proposed, existing, state, module)

if cmds:
# On N35 A8 images, some features return a yes/no prompt
# on enablement or disablement. Bypass using terminal dont-ask
cmds.insert(0, 'terminal dont-ask')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to test these changes across our platform matrix.

if not module.check_mode:
load_config(module, cmds)
results['changed'] = True
Expand Down
3 changes: 3 additions & 0 deletions lib/ansible/modules/network/nxos/nxos_lldp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def main():
result['commands'] = commands

if commands:
# On N35 A8 images, some features return a yes/no prompt
# on enablement or disablement. Bypass using terminal dont-ask
commands.insert(0, 'terminal dont-ask')
if not module.check_mode:
load_config(module, commands)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- set_fact: testint2="{{ nxos_int2 }}"
- set_fact: testint3="{{ nxos_int3 }}"

- set_fact: ipv6_address=""
- set_fact: ipv6_address="33:db::2/8"
when: ipv6_supported

- name: Setup - remove address from interface prior to testing(Part1)
nxos_config:
lines:
Expand Down Expand Up @@ -69,7 +73,7 @@
nxos_l3_interface: &conf_agg
aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "33:db::2/8" }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ cli }}"
register: result

Expand All @@ -89,7 +93,7 @@
nxos_l3_interface: &rm_agg
aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "33:db::2/8" }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ cli }}"
state: absent
register: result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
- set_fact: testint2="{{ nxos_int2 }}"
- set_fact: testint3="{{ nxos_int3 }}"

- set_fact: ipv6_address=""
- set_fact: ipv6_address="33:db::2/8"
when: ipv6_supported

- name: Setup - Remove address from interfaces aggregate
nxos_l3_interface:
aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "33:db::2/8" }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ nxapi }}"
state: absent
ignore_errors: yes
Expand Down Expand Up @@ -59,7 +63,7 @@
nxos_l3_interface: &conf_agg
aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "33:db::2/8" }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ nxapi }}"
register: result

Expand All @@ -79,7 +83,7 @@
nxos_l3_interface: &rm_agg
aggregate:
- { name: "{{ testint2 }}", ipv4: 192.168.22.1/24 }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "33:db::2/8" }
- { name: "{{ testint3 }}", ipv4: 192.168.20.1/24, ipv6: "{{ ipv6_address }}" }
provider: "{{ nxapi }}"
state: absent
register: result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
- "interface {{ testint1 }}"
- "interface {{ testint2 }}"

- name: Put interface in L2 mode
nxos_interface:
aggregate:
- { name: "{{testint1}}" }
- { name: "{{testint2}}" }
mode: layer2
when: platform is match("N35")

- name: create linkagg
nxos_linkagg: &create
group: 20
Expand Down
5 changes: 3 additions & 2 deletions test/integration/targets/nxos_lldp/tests/cli/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
when: ansible_connection == "local"

- name: Make sure LLDP is not running before tests
nxos_config:
lines: no feature lldp
nxos_feature:
feature: lldp
state: disabled
provider: "{{ connection }}"

- name: Enable LLDP service
Expand Down
5 changes: 3 additions & 2 deletions test/integration/targets/nxos_lldp/tests/nxapi/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
when: ansible_connection == "local"

- name: Make sure LLDP is not running before tests
nxos_config:
lines: no feature lldp
nxos_feature:
feature: lldp
state: disabled
provider: "{{ connection }}"

- name: Enable LLDP service
Expand Down
4 changes: 4 additions & 0 deletions test/integration/targets/prepare_nxos_tests/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@
- debug: msg="IMAGE VERSION {{ image_version }}"
- debug: msg="IMAGE TAG {{ imagetag }}"
- debug: msg="IMAGE MR {{ imagemr }}"

- set_fact: ipv6_supported="true"
- set_fact: ipv6_supported="false"
when: platform is match("N35")
4 changes: 2 additions & 2 deletions test/units/modules/network/nxos/test_nxos_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def load_from_file(*args, **kwargs):
def test_nxos_feature_enable(self):
set_module_args(dict(feature='nve', state='enabled'))
result = self.execute_module(changed=True)
self.assertEqual(result['commands'], ['feature nv overlay'])
self.assertEqual(result['commands'], ['terminal dont-ask', 'feature nv overlay'])

def test_nxos_feature_disable(self):
set_module_args(dict(feature='ospf', state='disabled'))
result = self.execute_module(changed=True)
self.assertEqual(result['commands'], ['no feature ospf'])
self.assertEqual(result['commands'], ['terminal dont-ask', 'no feature ospf'])