summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_banner
diff options
context:
space:
mode:
authorCaptTrews <capttrews@gmail.com>2020-01-16 15:50:24 +0000
committerCaptTrews <capttrews@gmail.com>2020-01-16 15:50:24 +0000
commit6b6166151faa3d811ae0ec3010a89e518a26287b (patch)
tree9cf59872c2ddc7e99595db4f47c72a7ce08b6c10 /tests/integration/targets/vyos_banner
parentd31b74ba6c74a6e3cdebd80b9eb5272aeb9b0fb4 (diff)
downloadvyos-ansible-old-6b6166151faa3d811ae0ec3010a89e518a26287b.tar.gz
vyos-ansible-old-6b6166151faa3d811ae0ec3010a89e518a26287b.zip
Updated from network content collector
Signed-off-by: CaptTrews <capttrews@gmail.com>
Diffstat (limited to 'tests/integration/targets/vyos_banner')
-rw-r--r--tests/integration/targets/vyos_banner/defaults/main.yaml2
-rw-r--r--tests/integration/targets/vyos_banner/tasks/cli.yaml14
-rw-r--r--tests/integration/targets/vyos_banner/tasks/main.yaml4
-rw-r--r--tests/integration/targets/vyos_banner/tests/cli/basic-no-login.yaml23
-rw-r--r--tests/integration/targets/vyos_banner/tests/cli/basic-post-login.yaml29
-rw-r--r--tests/integration/targets/vyos_banner/tests/cli/basic-pre-login.yaml29
6 files changed, 37 insertions, 64 deletions
diff --git a/tests/integration/targets/vyos_banner/defaults/main.yaml b/tests/integration/targets/vyos_banner/defaults/main.yaml
index 9ef5ba5..a845c24 100644
--- a/tests/integration/targets/vyos_banner/defaults/main.yaml
+++ b/tests/integration/targets/vyos_banner/defaults/main.yaml
@@ -1,3 +1,3 @@
---
-testcase: "*"
+testcase: '*'
test_items: []
diff --git a/tests/integration/targets/vyos_banner/tasks/cli.yaml b/tests/integration/targets/vyos_banner/tasks/cli.yaml
index 890d3ac..90f265f 100644
--- a/tests/integration/targets/vyos_banner/tasks/cli.yaml
+++ b/tests/integration/targets/vyos_banner/tasks/cli.yaml
@@ -1,22 +1,22 @@
---
- name: collect all cli test cases
find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
+ 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 }}"
+- name: run test case (connection=ansible.netcommon.network_cli)
+ include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.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 }}"
+ include: '{{ test_case_to_run }} ansible_connection=local'
+ with_first_found: '{{ test_items }}'
loop_control:
loop_var: test_case_to_run
diff --git a/tests/integration/targets/vyos_banner/tasks/main.yaml b/tests/integration/targets/vyos_banner/tasks/main.yaml
index d4cf26f..a3db933 100644
--- a/tests/integration/targets/vyos_banner/tasks/main.yaml
+++ b/tests/integration/targets/vyos_banner/tasks/main.yaml
@@ -1,2 +1,4 @@
---
-- {include: cli.yaml, tags: ['cli']}
+- include: cli.yaml
+ tags:
+ - cli
diff --git a/tests/integration/targets/vyos_banner/tests/cli/basic-no-login.yaml b/tests/integration/targets/vyos_banner/tests/cli/basic-no-login.yaml
index 5efdf8e..1ade232 100644
--- a/tests/integration/targets/vyos_banner/tests/cli/basic-no-login.yaml
+++ b/tests/integration/targets/vyos_banner/tests/cli/basic-no-login.yaml
@@ -1,41 +1,34 @@
---
- debug:
- msg: "cli/basic-no-login.yaml on connection={{ ansible_connection }}"
+ msg: cli/basic-no-login.yaml on connection={{ ansible_connection }}
- name: Setup
vyos.vyos.vyos_banner:
banner: pre-login
- text: |
- Junk pre-login banner
- over multiple lines
+ text: "Junk pre-login banner\nover multiple lines\n"
state: present
- name: remove pre-login
+ register: result
vyos.vyos.vyos_banner:
banner: pre-login
state: absent
- register: result
- debug:
- msg: "{{ result }}"
+ msg: '{{ result }}'
- assert:
that:
- - "result.changed == true"
+ - result.changed == true
- "'delete system login banner pre-login' in result.commands"
- name: remove pre-login (idempotent)
+ register: result
vyos.vyos.vyos_banner:
banner: pre-login
state: absent
- register: result
- assert:
that:
- - "result.changed == false"
- - "result.commands | length == 0"
-
-
-# FIXME add in tests for everything defined in docs
-# FIXME Test state:absent + test:
-# FIXME Without powers ensure "privileged mode required"
+ - result.changed == false
+ - result.commands | length == 0
diff --git a/tests/integration/targets/vyos_banner/tests/cli/basic-post-login.yaml b/tests/integration/targets/vyos_banner/tests/cli/basic-post-login.yaml
index ff6cbad..17cc07d 100644
--- a/tests/integration/targets/vyos_banner/tests/cli/basic-post-login.yaml
+++ b/tests/integration/targets/vyos_banner/tests/cli/basic-post-login.yaml
@@ -1,6 +1,6 @@
---
- debug:
- msg: "cli/basic-post-login.yaml on connection={{ ansible_connection }}"
+ msg: cli/basic-post-login.yaml on connection={{ ansible_connection }}
- name: setup - remove post-login
vyos.vyos.vyos_banner:
@@ -8,40 +8,29 @@
state: absent
- name: Set post-login
+ register: result
vyos.vyos.vyos_banner:
banner: post-login
- text: |
- this is my post-login banner
- that has a multiline
- string
+ text: "this is my post-login banner\nthat has a multiline\nstring\n"
state: present
- register: result
- debug:
- msg: "{{ result }}"
+ msg: '{{ result }}'
- assert:
that:
- - "result.changed == true"
+ - result.changed == true
- "'this is my post-login banner' in result.commands[0]"
- "'that has a multiline' in result.commands[0]"
- name: Set post-login again (idempotent)
+ register: result
vyos.vyos.vyos_banner:
banner: post-login
- text: |
- this is my post-login banner
- that has a multiline
- string
+ text: "this is my post-login banner\nthat has a multiline\nstring\n"
state: present
- register: result
- assert:
that:
- - "result.changed == false"
- - "result.commands | length == 0"
-
-
-# FIXME add in tests for everything defined in docs
-# FIXME Test state:absent + test:
-# FIXME Without powers ensure "privileged mode required"
+ - result.changed == false
+ - result.commands | length == 0
diff --git a/tests/integration/targets/vyos_banner/tests/cli/basic-pre-login.yaml b/tests/integration/targets/vyos_banner/tests/cli/basic-pre-login.yaml
index 8489d87..526c657 100644
--- a/tests/integration/targets/vyos_banner/tests/cli/basic-pre-login.yaml
+++ b/tests/integration/targets/vyos_banner/tests/cli/basic-pre-login.yaml
@@ -1,6 +1,6 @@
---
- debug:
- msg: "cli/basic-pre-login.yaml on connection={{ ansible_connection }}"
+ msg: cli/basic-pre-login.yaml on connection={{ ansible_connection }}
- name: setup - remove pre-login
vyos.vyos.vyos_banner:
@@ -8,40 +8,29 @@
state: absent
- name: Set pre-login
+ register: result
vyos.vyos.vyos_banner:
banner: pre-login
- text: |
- this is my pre-login banner
- that has a multiline
- string
+ text: "this is my pre-login banner\nthat has a multiline\nstring\n"
state: present
- register: result
- debug:
- msg: "{{ result }}"
+ msg: '{{ result }}'
- assert:
that:
- - "result.changed == true"
+ - result.changed == true
- "'this is my pre-login banner' in result.commands[0]"
- "'that has a multiline' in result.commands[0]"
- name: Set pre-login again (idempotent)
+ register: result
vyos.vyos.vyos_banner:
banner: pre-login
- text: |
- this is my pre-login banner
- that has a multiline
- string
+ text: "this is my pre-login banner\nthat has a multiline\nstring\n"
state: present
- register: result
- assert:
that:
- - "result.changed == false"
- - "result.commands | length == 0"
-
-
-# FIXME add in tests for everything defined in docs
-# FIXME Test state:absent + test:
-# FIXME Without powers ensure "privileged mode required"
+ - result.changed == false
+ - result.commands | length == 0