-
Notifications
You must be signed in to change notification settings - Fork 717
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [test cases] add back recover variable validity check base_sanity and interface were called from other tests that didn't define recover variable. When the test succeeds, everything is fine. Otherwise, the test will complain that recover is not defined. * [test case] add test case: port toggle This test tests following scenario: - disable all ports. - check to make sure that all ports were down. - enable all ports. - check all ports were up after a pause. * [port toggle] improve test performance
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
- name: build shell command string | ||
debug: msg="PORTS={{minigraph_ports.keys() | join(' ')}}; for port in $PORTS; do config interface shutdown $port; done" | ||
|
||
- name: turn off all ports on device | ||
shell: PORTS="{{minigraph_ports.keys() | join(' ')}}"; for port in $PORTS; do config interface shutdown $port; done | ||
become: yes | ||
|
||
- name: Get interface facts | ||
interface_facts: up_ports={{minigraph_ports}} | ||
|
||
- name: Verify interfaces are all down | ||
assert: { that: "{{ ansible_interface_link_down_ports | length }} == {{ minigraph_ports | length }}" } | ||
|
||
- always: | ||
- name: build shell command string | ||
debug: msg="PORTS={{minigraph_ports.keys() | join(' ')}}; for port in $PORTS; do config interface startup $port; done" | ||
|
||
- name: turn off all ports on device | ||
shell: PORTS="{{minigraph_ports.keys() | join(' ')}}"; for port in $PORTS; do config interface startup $port; done | ||
become: yes | ||
|
||
- name: wait 1 minute for ports to come up | ||
pause: seconds=60 | ||
|
||
- name: Get interface facts | ||
interface_facts: up_ports={{minigraph_ports}} | ||
|
||
- name: Verify interfaces are up correctly | ||
assert: { that: "{{ ansible_interface_link_down_ports | length }} == 0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters