mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Changes to enable network_cli and netconf on iosxr integration tests. (#35269)
* * Changes to enable network_cli and netconf on modules. * limits connection local for single TC per playbook. * * adds a note on why only 1 TC is executed with connection: local
This commit is contained in:
parent
f49a782099
commit
56eeaf1b2f
25 changed files with 548 additions and 499 deletions
|
@ -6,12 +6,14 @@
|
|||
state: present
|
||||
configured_password: pass123
|
||||
provider: "{{ cli }}"
|
||||
connection: network_cli
|
||||
|
||||
- name: test login
|
||||
expect:
|
||||
command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no show version"
|
||||
responses:
|
||||
(?i)password: "pass123"
|
||||
connection: network_cli
|
||||
|
||||
- name: test login with invalid password (should fail)
|
||||
expect:
|
||||
|
@ -19,6 +21,7 @@
|
|||
responses:
|
||||
(?i)password: "badpass"
|
||||
ignore_errors: yes
|
||||
connection: network_cli
|
||||
register: results
|
||||
|
||||
- name: check that attempt failed
|
||||
|
@ -32,18 +35,21 @@
|
|||
state: present
|
||||
public_key_contents: "{{ lookup('file', \"{{ role_path }}/files/public.pub\") }}"
|
||||
provider: "{{ cli }}"
|
||||
connection: network_cli
|
||||
|
||||
- name: test login with private key
|
||||
expect:
|
||||
command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port|default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
|
||||
responses:
|
||||
(?i)password: 'pass123'
|
||||
connection: network_cli
|
||||
|
||||
- name: remove user and key
|
||||
iosxr_user:
|
||||
name: auth_user
|
||||
provider: "{{ cli }}"
|
||||
state: absent
|
||||
connection: network_cli
|
||||
|
||||
- name: test login with private key (should fail, no user)
|
||||
expect:
|
||||
|
@ -51,6 +57,7 @@
|
|||
responses:
|
||||
(?i)password: 'pass123'
|
||||
ignore_errors: yes
|
||||
connection: network_cli
|
||||
register: results
|
||||
|
||||
- name: create user with private key (path input)
|
||||
|
@ -59,6 +66,7 @@
|
|||
state: present
|
||||
public_key: "{{ role_path }}/files/public.pub"
|
||||
provider: "{{ cli }}"
|
||||
connection: network_cli
|
||||
|
||||
- name: test login with private key
|
||||
expect:
|
||||
|
@ -66,6 +74,7 @@
|
|||
responses:
|
||||
(?i)password: 'pass123'
|
||||
ignore_errors: yes
|
||||
connection: network_cli
|
||||
|
||||
- name: change private key for user
|
||||
iosxr_user:
|
||||
|
@ -73,6 +82,7 @@
|
|||
state: present
|
||||
public_key_contents: "{{ lookup('file', \"{{ role_path }}/files/public2.pub\") }}"
|
||||
provider: "{{ cli }}"
|
||||
connection: network_cli
|
||||
|
||||
# FIXME: pexpect fails with OSError: [Errno 5] Input/output error
|
||||
- name: test login with invalid private key (should fail)
|
||||
|
@ -81,6 +91,7 @@
|
|||
responses:
|
||||
(?i)password: "pass123"
|
||||
ignore_errors: yes
|
||||
connection: network_cli
|
||||
register: results
|
||||
|
||||
- name: check that attempt failed
|
||||
|
@ -94,4 +105,5 @@
|
|||
name: auth_user
|
||||
state: absent
|
||||
provider: "{{ cli }}"
|
||||
connection: network_cli
|
||||
register: result
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
- no username ansible2
|
||||
- no username ansible3
|
||||
provider: "{{ cli }}"
|
||||
connection: network_cli
|
||||
|
||||
- name: Create user (SetUp)
|
||||
iosxr_user:
|
||||
|
@ -13,6 +14,7 @@
|
|||
configured_password: password
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -28,6 +30,7 @@
|
|||
update_password: always
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -43,6 +46,7 @@
|
|||
update_password: on_create
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -58,6 +62,7 @@
|
|||
group: sysadmin
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -74,6 +79,7 @@
|
|||
group: sysadmin
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -90,6 +96,7 @@
|
|||
state: present
|
||||
group: sysadmin
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -111,6 +118,7 @@
|
|||
state: present
|
||||
group: sysadmin
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -130,6 +138,7 @@
|
|||
state: present
|
||||
group: sysadmin
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -145,6 +154,7 @@
|
|||
- name: ansible3
|
||||
state: absent
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -162,6 +172,7 @@
|
|||
- name: ansible3
|
||||
state: absent
|
||||
provider: "{{ netconf }}"
|
||||
connection: netconf
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue