-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1113 from moreati/ssh-password-tests
tests: Simplify Ansible ssh password tests, test priority
- Loading branch information
Showing
3 changed files
with
52 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- import_playbook: config.yml | ||
- import_playbook: password.yml | ||
- import_playbook: timeouts.yml | ||
- import_playbook: variables.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
- name: integration/ssh/password.yml | ||
hosts: test-targets[0] | ||
gather_facts: false | ||
vars: | ||
ansible_user: mitogen__user1 | ||
tasks: | ||
- meta: reset_connection | ||
- name: ansible_password | ||
vars: | ||
ansible_password: user1_password | ||
ping: | ||
|
||
- meta: reset_connection | ||
- name: ansible_ssh_pass | ||
vars: | ||
ansible_ssh_pass: user1_password | ||
ping: | ||
|
||
- meta: reset_connection | ||
- name: absent password should fail | ||
ping: | ||
ignore_errors: true | ||
ignore_unreachable: true | ||
register: ssh_no_password_result | ||
- assert: | ||
that: | ||
- ssh_no_password_result.unreachable == True | ||
fail_msg: ssh_no_password_result={{ ssh_no_password_result }} | ||
|
||
- meta: reset_connection | ||
- name: ansible_ssh_pass should override ansible_password | ||
ping: | ||
vars: | ||
ansible_password: wrong | ||
ansible_ssh_pass: user1_password | ||
|
||
# Tests that ansible_ssh_pass has priority over ansible_password | ||
# and that a wrong password causes a target to be marked unreachable. | ||
- meta: reset_connection | ||
- name: ansible_password should not override | ||
vars: | ||
ansible_password: user1_password | ||
ansible_ssh_pass: wrong | ||
ping: | ||
ignore_errors: true | ||
ignore_unreachable: true | ||
register: ssh_wrong_password_result | ||
- assert: | ||
that: | ||
- ssh_wrong_password_result.unreachable == True | ||
fail_msg: ssh_wrong_password_result={{ ssh_wrong_password_result }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters