mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Fix eapi tests to use become (#40838)
* Return the expected prompt character based on become status * Update eos_banner tests for eapi * Update eos_config tests for eapi * Update eos_facts tests for eapi * Update eos_interface tests for eapi * Update eos_l3_interface tests for eapi * Update eos_lldp tests for eapi * Update eos_logging tests for eapi * Update eos_smoke tests for eapi * Update eos_system tests for eapi
This commit is contained in:
@@ -8,11 +8,13 @@
|
||||
lines: hostname {{ inventory_hostname_short }}
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
|
||||
- name: get current running-config
|
||||
eos_command:
|
||||
commands: show running-config
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
register: config
|
||||
|
||||
- name: configure hostname
|
||||
@@ -20,6 +22,7 @@
|
||||
lines: hostname foo
|
||||
config: "{{ config.stdout[0] }}"
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
@@ -31,6 +34,7 @@
|
||||
eos_command:
|
||||
commands: show running-config
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
register: config
|
||||
|
||||
- name: teardown
|
||||
@@ -38,6 +42,7 @@
|
||||
lines: hostname {{ inventory_hostname_short }}
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
|
||||
# hit block and diffs
|
||||
- block:
|
||||
@@ -52,6 +57,7 @@
|
||||
after: exit
|
||||
match: strict
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
|
||||
- name: configure sub level command using block replace
|
||||
eos_config:
|
||||
@@ -65,6 +71,7 @@
|
||||
after: exit
|
||||
provider: "{{ eapi }}"
|
||||
match: line
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
@@ -88,6 +95,7 @@
|
||||
after: exit
|
||||
provider: "{{ eapi }}"
|
||||
match: exact
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
always:
|
||||
@@ -96,5 +104,6 @@
|
||||
lines: no ip access-list test
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/common_config.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
- no ip route 192.168.3.0/24 192.168.0.1
|
||||
authorize: yes
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
|
||||
- name: configure static route
|
||||
eos_static_route:
|
||||
@@ -20,6 +21,7 @@
|
||||
admin_distance: 2
|
||||
authorize: yes
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
@@ -34,6 +36,7 @@
|
||||
admin_distance: 2
|
||||
authorize: yes
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
@@ -47,6 +50,7 @@
|
||||
- no ip route 192.168.3.0/24 192.168.0.1
|
||||
authorize: yes
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
|
||||
- debug: msg="END cli/common_utils.yaml on connection={{ ansible_connection }}"
|
||||
|
||||
@@ -63,4 +67,5 @@
|
||||
rx_rate: ge(0)
|
||||
authorize: yes
|
||||
provider: "{{ eapi }}"
|
||||
become: yes
|
||||
register: result
|
||||
|
||||
Reference in New Issue
Block a user