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:
Nathaniel Case 2018-05-29 14:18:03 -04:00 committed by GitHub
commit 20f93816d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 217 additions and 490 deletions

View file

@ -9,8 +9,6 @@
become: yes
register: result
- assert:
that:
# _facts modules should never report a change

View file

@ -1,5 +1,5 @@
---
- debug: msg="START cli/not_hardware_facts.yaml on connection={{ ansible_connection }}"
- debug: msg="START cli/not_hardware.yaml on connection={{ ansible_connection }}"
- name: test not hardware
@ -27,4 +27,4 @@
# ... and not present
- "result.ansible_facts.ansible_net_filesystems is not defined"
- debug: msg="END cli/not_hardware_facts.yaml on connection={{ ansible_connection }}"
- debug: msg="END cli/not_hardware.yaml on connection={{ ansible_connection }}"

View file

@ -4,12 +4,13 @@
- name: Make sure LLDP is running (setup)
eos_config:
lines: lldp run
authorize: yes
become: yes
- name: test getting all facts
eos_facts:
gather_subset:
- all
become: yes
register: result
- assert:
@ -29,9 +30,4 @@
- "result.ansible_facts.ansible_net_memfree_mb > 1"
- "result.ansible_facts.ansible_net_memtotal_mb > 1"
- name: Make sure LLDP is running (teardown)
eos_config:
lines: no lldp run
authorize: yes
- debug: msg="END eapi/all_facts.yaml"

View file

@ -4,10 +4,11 @@
- name: Make sure LLDP is running (setup)
eos_config:
lines: lldp run
authorize: yes
become: yes
- name: test getting default facts
eos_facts:
become: yes
register: result
- assert:
@ -31,9 +32,4 @@
# ... and not present
- "result.ansible_facts.ansible_net_config is not defined" # config
- name: Make sure LLDP is running (setup)
eos_config:
lines: lldp run
authorize: yes
- debug: msg="END eapi/default.yaml"

View file

@ -1,15 +1,16 @@
---
- debug: msg="START eapi/not_hardware_facts.yaml"
- debug: msg="START eapi/not_hardware.yaml"
- name: Make sure LLDP is running (setup)
eos_config:
lines: lldp run
authorize: yes
become: yes
- name: test not hardware
eos_facts:
gather_subset:
- "!hardware"
become: yes
register: result
- assert:
@ -30,9 +31,4 @@
# ... and not present
- "result.ansible_facts.ansible_net_filesystems is not defined"
- name: Make sure LLDP is running (teardown)
eos_config:
lines: no lldp run
authorize: yes
- debug: msg="END eapi/not_hardware_facts.yaml"
- debug: msg="END eapi/not_hardware.yaml"