Fix integration test failures due to wrong files paths to ficture and (#33329)

missing ssh port
pull/33335/head
Kedar K 7 years ago committed by GitHub
parent 08f1d1972e
commit 717193b67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,7 @@
name: auth_user name: auth_user
state: present state: present
configured_password: pass123 configured_password: pass123
provider: "{{ cli }}"
- name: test login - name: test login
expect: expect:
@ -29,24 +30,26 @@
iosxr_user: iosxr_user:
name: auth_user name: auth_user
state: present state: present
public_key_contents: "{{ lookup('file', \"{{ output_dir }}/public.pub\") }}" public_key_contents: "{{ lookup('file', \"{{ role_path }}/files/public.pub\") }}"
provider: "{{ cli }}"
- name: test login with private key - name: test login with private key
expect: expect:
command: "ssh auth_user@{{ ansible_ssh_host }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{output_dir}}/private show version" command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses: responses:
(?i)passphrase: 'pass123' (?i)password: 'pass123'
- name: remove user and key - name: remove user and key
iosxr_user: iosxr_user:
name: auth_user name: auth_user
state: absent state: absent
provider: "{{ cli }}"
- name: test login with private key (should fail, no user) - name: test login with private key (should fail, no user)
expect: expect:
command: "ssh auth_user@{{ ansible_ssh_host }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{output_dir}}/private show version" command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses: responses:
(?i)passphrase: 'pass123' (?i)password: 'pass123'
ignore_errors: yes ignore_errors: yes
register: results register: results
@ -54,25 +57,29 @@
iosxr_user: iosxr_user:
name: auth_user name: auth_user
state: present state: present
public_key: "{{ output_dir }}/public.pub" public_key: "{{ role_path }}/files/public.pub"
provider: "{{ cli }}"
- name: test login with private key - name: test login with private key
expect: expect:
command: "ssh auth_user@{{ ansible_ssh_host }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{output_dir}}/private show version" command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses: responses:
(?i)passphrase: 'pass123' (?i)password: 'pass123'
ignore_errors: yes
- name: change private key for user - name: change private key for user
iosxr_user: iosxr_user:
name: auth_user name: auth_user
state: present state: present
public_key_contents: "{{ lookup('file', \"{{ output_dir }}/public2.pub\") }}" public_key_contents: "{{ lookup('file', \"{{ role_path }}/files/public2.pub\") }}"
provider: "{{ cli }}"
# FIXME: pexpect fails with OSError: [Errno 5] Input/output error
- name: test login with invalid private key (should fail) - name: test login with invalid private key (should fail)
expect: expect:
command: "ssh auth_user@{{ ansible_ssh_host }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{output_dir}}/private show version" command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_ssh_port }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ role_path }}/files/private show version"
responses: responses:
(?i)passphrase: "pass123" (?i)password: "pass123"
ignore_errors: yes ignore_errors: yes
register: results register: results
@ -86,4 +93,5 @@
iosxr_user: iosxr_user:
name: auth_user name: auth_user
state: absent state: absent
provider: "{{ cli }}"
register: result register: result

Loading…
Cancel
Save