Fix ios integration test failures (#35333)

This commit is contained in:
Ganesh Nalawade 2018-01-25 12:26:17 +05:30 committed by GitHub
parent dd949c5b65
commit c216473c82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 2 deletions

View file

@ -184,7 +184,7 @@ def validate_param_values(module, obj, param=None):
def parse_shutdown(configobj, name): def parse_shutdown(configobj, name):
cfg = configobj['interface %s' % name] cfg = configobj['interface %s' % name]
cfg = '\n'.join(cfg.children) cfg = '\n'.join(cfg.children)
match = re.search(r'shutdown', cfg, re.M) match = re.search(r'^shutdown', cfg, re.M)
if match: if match:
return True return True
else: else:

View file

@ -8,6 +8,16 @@
authorize: yes authorize: yes
register: result register: result
- name: Setup - Ensure interfaces are switchport
ios_config:
lines:
- no shutdown
parents:
- "interface {{ item }}"
loop:
- "{{ test_interface }}"
- "{{ test_interface2 }}"
- name: Configure interface ipv4 address - name: Configure interface ipv4 address
ios_l3_interface: ios_l3_interface:
name: "{{ test_interface }}" name: "{{ test_interface }}"

View file

@ -1,4 +1,16 @@
--- ---
- debug: msg="START ios cli/ios_static_route.yaml on connection={{ ansible_connection }}"
- name: delete static route - setup
net_static_route:
prefix: 172.16.31.0
mask: 255.255.255.0
next_hop: 10.0.0.8
admin_distance: 1
state: absent
authorize: yes
register: result
- name: create static route - name: create static route
ios_static_route: ios_static_route:
prefix: 172.16.31.0 prefix: 172.16.31.0
@ -127,3 +139,5 @@
that: that:
- 'result.changed == true' - 'result.changed == true'
- 'result.commands == ["no ip route 172.16.32.0 255.255.255.0 10.0.0.8", "no ip route 172.16.34.0 255.255.255.0 10.0.0.8"]' - 'result.commands == ["no ip route 172.16.32.0 255.255.255.0 10.0.0.8", "no ip route 172.16.34.0 255.255.255.0 10.0.0.8"]'
- debug: msg="END ios cli/ios_static_route.yaml on connection={{ ansible_connection }}"

View file

@ -9,7 +9,7 @@
prefix: 172.16.31.0 prefix: 172.16.31.0
mask: 255.255.255.0 mask: 255.255.255.0
next_hop: 10.0.0.8 next_hop: 10.0.0.8
admin_distance: 2 admin_distance: 1
state: absent state: absent
authorize: yes authorize: yes
register: result register: result