Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible FreeIPA
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Ansible FreeIPA
Commits
d5179b52
Unverified
Commit
d5179b52
authored
Aug 27, 2020
by
Sergio Oliveira
Committed by
GitHub
Aug 27, 2020
Browse files
Options
Downloads
Plain Diff
Merge pull request #353 from rjeffman/tests_ssh_password
Add support for running pytest tests with ssh password.
parents
a250665a
d24bdbce
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/README.md
+8
-2
8 additions, 2 deletions
tests/README.md
tests/test_playbook_runs.py
+8
-0
8 additions, 0 deletions
tests/test_playbook_runs.py
with
16 additions
and
2 deletions
tests/README.md
+
8
−
2
View file @
d5179b52
...
@@ -29,6 +29,14 @@ environment variable. For example:
...
@@ -29,6 +29,14 @@ environment variable. For example:
ANSIBLE_REMOTE_USER=root IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest
ANSIBLE_REMOTE_USER=root IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest
```
```
If you want to use ssh with password, you must set
`IPA_SSH_PASSWORD`
environment variable. For example:
```
IPA_SSH_PASSWORD=<ipaserver_ssh_password> IPA_SERVER_HOST=<ipaserver_host_or_ip> pytest
```
To run a single test use the full path with the following format:
To run a single test use the full path with the following format:
```
```
...
@@ -99,5 +107,3 @@ See [Running the tests](#running-the-tests) section for more information on avai
...
@@ -99,5 +107,3 @@ See [Running the tests](#running-the-tests) section for more information on avai
*
A script to pre-config the complete test environment using virsh.
*
A script to pre-config the complete test environment using virsh.
*
A test matrix to run tests against different distros in parallel (probably using tox).
*
A test matrix to run tests against different distros in parallel (probably using tox).
*
Allow to connect to
`ipaserver`
using ssh and password.
This diff is collapsed.
Click to expand it.
tests/test_playbook_runs.py
+
8
−
0
View file @
d5179b52
...
@@ -19,6 +19,10 @@ def is_docker_env():
...
@@ -19,6 +19,10 @@ def is_docker_env():
return
True
return
True
def
get_ssh_password
():
return
os
.
getenv
(
"
IPA_SSH_PASSWORD
"
)
def
get_server_host
():
def
get_server_host
():
return
os
.
getenv
(
"
IPA_SERVER_HOST
"
)
return
os
.
getenv
(
"
IPA_SERVER_HOST
"
)
...
@@ -33,6 +37,10 @@ def get_inventory_content():
...
@@ -33,6 +37,10 @@ def get_inventory_content():
if
is_docker_env
():
if
is_docker_env
():
ipa_server_host
+=
"
ansible_connection=docker
"
ipa_server_host
+=
"
ansible_connection=docker
"
sshpass
=
get_ssh_password
()
if
sshpass
:
ipa_server_host
+=
"
ansible_ssh_pass=%s
"
%
sshpass
lines
=
[
lines
=
[
"
[ipaserver]
"
,
"
[ipaserver]
"
,
ipa_server_host
,
ipa_server_host
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment