Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 3 additions & 78 deletions ansible/roles/test/tasks/portstat.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,4 @@
- name: Verify the portstat clear command works
# roles/test/tasks/portstat
include_tasks: portstat/portstat_clear.yml
- name: run test
include_tasks: roles/test/tasks/pytest_runner.yml
vars:
command: "{{ item }}"
with_items:
- portstat -c
- portstat --clear

- name: Test portstat delete all when no saved data # This command fails
include_tasks: portstat/portstat_delete_all_no_saved_stats.yml
vars:
command: "{{ item }}"
with_items:
- portstat -D
- portstat --delete-all

- name: Test portstat delete all with saved tags
include_tasks: portstat/portstat_delete_all_stats.yml
vars:
command: "{{ item }}"
with_items:
- portstat -D
- portstat --delete-all

- name: Test deleting a tag
include_tasks: portstat/portstat_delete_tag.yml
vars:
command: "{{ item }}"
with_items:
- portstat -d -t
- portstat -d --tag
- portstat --delete -t
- portstat --delete --tag

- name: Test display all
include_tasks: portstat/portstat_all_fields.yml
vars:
command: "{{ item }}"
with_items:
- portstat -a
- portstat --all

- name: Test display period
include_tasks: portstat/portstat_period.yml
vars:
command: "{{ item }}"
with_items:
- portstat -p 1
- portstat --period 1


# This test verifies the following command versions don't cause tracebacks
- block:
- name: list of commands to run
set_fact:
portstat_commands:
- portstat -h
- portstat --help
- portstat
- portstat -v
- portstat --version
- portstat -j #This test fails
- portstat --json #This test fails
- portstat -r #This test fails
- portstat --raw #This test fails

- name: Run the commands
shell: "{{ item }}"
with_items: "{{ portstat_commands }}"

always:
- name: Clear and reset counters
shell: portstat -D

rescue:
- name: A command failed
debug:
msg: One of the commands failed
test_node: portstat/test_portstat.py
41 changes: 0 additions & 41 deletions ansible/roles/test/tasks/portstat/portstat_all_fields.yml

This file was deleted.

64 changes: 0 additions & 64 deletions ansible/roles/test/tasks/portstat/portstat_clear.yml

This file was deleted.

This file was deleted.

50 changes: 0 additions & 50 deletions ansible/roles/test/tasks/portstat/portstat_delete_all_stats.yml

This file was deleted.

69 changes: 0 additions & 69 deletions ansible/roles/test/tasks/portstat/portstat_delete_tag.yml

This file was deleted.

39 changes: 0 additions & 39 deletions ansible/roles/test/tasks/portstat/portstat_period.yml

This file was deleted.

Loading