Files
@ 5283779cf2aa
Branch filter:
Location: majic-ansible-roles/roles/backup_server/molecule/default/tests/conftest.py - annotation
5283779cf2aa
1.0 KiB
text/x-python
MAR-168: Clean-up references to database_server root password:
- Updated role reference documentation.
- Updated usage instructions.
- Updated test configurations.
- Remvoed unused files/variables.
- Updated test site configuration.
- Updated role reference documentation.
- Updated usage instructions.
- Updated test configurations.
- Remvoed unused files/variables.
- Updated test site configuration.
770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f 770551dc8c6f | import os
import pytest
@pytest.fixture(scope='session')
def prepare_ssh_client_private_key_permissions():
"""
Helper fixture used to fix the file permissions of client private
keys that are used directly from the local machine to test
connectivity towards the server.
Permissions are set-up in such a way that the ssh tool does not
report any errors (e.g. setting the mode to 0600).
The fixture will restore old permissions once the tests have been
completed.
The fixture is used with the session scope.
The following private keys will be processed:
- tests/data/ssh/client1
- tests/data/ssh/client2
"""
private_keys = [
"tests/data/ssh/client1",
"tests/data/ssh/client2"
]
private_key_old_permissions = {}
for private_key in private_keys:
private_key_old_permissions[private_key] = os.stat(private_key).st_mode
os.chmod(private_key, 0o600)
yield
for private_key in private_keys:
os.chmod(private_key, private_key_old_permissions[private_key])
|