summaryrefslogtreecommitdiff
path: root/test/integration/targets/vyos_command
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/vyos_command')
-rw-r--r--test/integration/targets/vyos_command/aliases1
-rw-r--r--test/integration/targets/vyos_command/defaults/main.yaml3
-rw-r--r--test/integration/targets/vyos_command/tasks/cli.yaml22
-rw-r--r--test/integration/targets/vyos_command/tasks/main.yaml2
-rw-r--r--test/integration/targets/vyos_command/tests/cli/bad_operator.yaml19
-rw-r--r--test/integration/targets/vyos_command/tests/cli/cli_command.yaml41
-rw-r--r--test/integration/targets/vyos_command/tests/cli/contains.yaml20
-rw-r--r--test/integration/targets/vyos_command/tests/cli/invalid.yaml22
-rw-r--r--test/integration/targets/vyos_command/tests/cli/output.yaml44
-rw-r--r--test/integration/targets/vyos_command/tests/cli/timeout.yaml18
10 files changed, 0 insertions, 192 deletions
diff --git a/test/integration/targets/vyos_command/aliases b/test/integration/targets/vyos_command/aliases
deleted file mode 100644
index 539d9574..00000000
--- a/test/integration/targets/vyos_command/aliases
+++ /dev/null
@@ -1 +0,0 @@
-shippable/network
diff --git a/test/integration/targets/vyos_command/defaults/main.yaml b/test/integration/targets/vyos_command/defaults/main.yaml
deleted file mode 100644
index 9ef5ba51..00000000
--- a/test/integration/targets/vyos_command/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-testcase: "*"
-test_items: []
diff --git a/test/integration/targets/vyos_command/tasks/cli.yaml b/test/integration/targets/vyos_command/tasks/cli.yaml
deleted file mode 100644
index 890d3acf..00000000
--- a/test/integration/targets/vyos_command/tasks/cli.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-- name: collect all cli test cases
- find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
- delegate_to: localhost
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test case (connection=network_cli)
- include: "{{ test_case_to_run }} ansible_connection=network_cli"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
-
-- name: run test case (connection=local)
- include: "{{ test_case_to_run }} ansible_connection=local"
- with_first_found: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
diff --git a/test/integration/targets/vyos_command/tasks/main.yaml b/test/integration/targets/vyos_command/tasks/main.yaml
deleted file mode 100644
index 415c99d8..00000000
--- a/test/integration/targets/vyos_command/tasks/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- { include: cli.yaml, tags: ['cli'] }
diff --git a/test/integration/targets/vyos_command/tests/cli/bad_operator.yaml b/test/integration/targets/vyos_command/tests/cli/bad_operator.yaml
deleted file mode 100644
index bf3334f2..00000000
--- a/test/integration/targets/vyos_command/tests/cli/bad_operator.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-- debug: msg="START cli/bad_operator.yaml on connection={{ ansible_connection }}"
-
-- name: test bad operator
- vyos.vyos.vyos_command:
- commands:
- - show version
- - show interfaces
- wait_for:
- - result[0] is 'VyOS'
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - result.failed == true
- - result.msg is defined
-
-- debug: msg="END cli/bad_operator.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/vyos_command/tests/cli/cli_command.yaml b/test/integration/targets/vyos_command/tests/cli/cli_command.yaml
deleted file mode 100644
index 08a7675b..00000000
--- a/test/integration/targets/vyos_command/tests/cli/cli_command.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- debug:
- msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}"
-
-- block:
- - name: get output for single command
- network.cli.cli_command:
- command: show version
- register: result
-
- - assert:
- that:
- - "result.changed == false"
- - "result.stdout is defined"
-
- - name: send invalid command
- network.cli.cli_command:
- command: 'show foo'
- register: result
- ignore_errors: yes
-
- - assert:
- that:
- - "result.failed == true"
- - "result.msg is defined"
- when: "ansible_connection == 'network_cli'"
-
-- block:
- - name: test failure for local connection
- network.cli.cli_command:
- command: show version
- register: result
- ignore_errors: yes
-
- - assert:
- that:
- - 'result.failed == true'
- - "'Connection type local is not valid for this module' in result.msg"
- when: "ansible_connection == 'local'"
-
-- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/vyos_command/tests/cli/contains.yaml b/test/integration/targets/vyos_command/tests/cli/contains.yaml
deleted file mode 100644
index b8665fa7..00000000
--- a/test/integration/targets/vyos_command/tests/cli/contains.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-- debug: msg="START cli/contains.yaml on connection={{ ansible_connection }}"
-
-- name: test contains operator
- vyos.vyos.vyos_command:
- commands:
- - show version
- - show interface
- wait_for:
- - result[0] contains VyOS
- - result[1] contains eth0
- register: result
-
-- assert:
- that:
- - result.changed == false
- - result.stdout is defined
- - result.stdout_lines is defined
-
-- debug: msg="END cli/contains.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/vyos_command/tests/cli/invalid.yaml b/test/integration/targets/vyos_command/tests/cli/invalid.yaml
deleted file mode 100644
index 672f6e81..00000000
--- a/test/integration/targets/vyos_command/tests/cli/invalid.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-- debug: msg="START cli/invalid.yaml on connection={{ ansible_connection }}"
-
-- name: run invalid command
- vyos.vyos.vyos_command:
- commands: show foo
- register: result
- ignore_errors: yes
-
-- assert: { that: result.failed }
-
-- name: run commands that include invalid command
- vyos.vyos.vyos_command:
- commands:
- - show version
- - show foo
- register: result
- ignore_errors: yes
-
-- assert: { that: result.failed }
-
-- debug: msg="END cli/invalid.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/vyos_command/tests/cli/output.yaml b/test/integration/targets/vyos_command/tests/cli/output.yaml
deleted file mode 100644
index bdc8b2a8..00000000
--- a/test/integration/targets/vyos_command/tests/cli/output.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
----
-- debug: msg="START cli/output.yaml on connection={{ ansible_connection }}"
-
-- name: get output for single command
- vyos.vyos.vyos_command:
- commands: show version
- register: result
-
-- assert:
- that:
- - result.changed == false
- - result.stdout is defined
- - result.stdout_lines is defined
-
-- name: get output for multiple commands
- vyos.vyos.vyos_command:
- commands:
- - show version
- - show interfaces
- register: result
-
-- assert:
- that:
- - result.changed == false
- - result.stdout is defined
- - result.stdout | length == 2
-
-- name: Get output for multiple commands that call less explicitly
- vyos.vyos.vyos_command:
- commands:
- # NOTE: We only test show commands that will output <ANSIBLE_VYOS_TERMINAL_LENGTH
- # Otherwise you will get ": "command timeout triggered"
- - show hardware cpu detail
- - show hardware mem
- - show license
- register: result
-
-- assert:
- that:
- - result.changed == false
- - result.stdout_lines is defined
- - result.stdout_lines[2] | length >= 20
-
-- debug: msg="END cli/output.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/vyos_command/tests/cli/timeout.yaml b/test/integration/targets/vyos_command/tests/cli/timeout.yaml
deleted file mode 100644
index e4716ed6..00000000
--- a/test/integration/targets/vyos_command/tests/cli/timeout.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-- debug: msg="START cli/timeout.yaml on connection={{ ansible_connection }}"
-
-- name: test bad condition
- vyos.vyos.vyos_command:
- commands:
- - show version
- wait_for:
- - result[0] contains bad_value_string
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - result.failed == true
- - result.msg is defined
-
-- debug: msg="END cli/timeout.yaml on connection={{ ansible_connection }}"