fix tests

This commit is contained in:
Benoit Bayszczak 2020-08-26 09:46:05 +02:00
parent 00fc5f6b93
commit 7c8e5ace52

View File

@ -122,7 +122,8 @@ def source_cred_hashi_secret(organization):
"url": "https://secret.hash.example.com",
"token": "myApiKey",
"role_id": "role",
"secret_id": "secret"
"secret_id": "secret",
"auth_path": "/path/to/auth"
}
)
@ -142,7 +143,7 @@ def test_hashi_secret_credential_source(run_module, admin_user, organization, so
source_credential=source_cred_hashi_secret.name,
target_credential=tgt_cred.name,
input_field_name='password',
metadata={"secret_path": "/path/to/secret", "auth_path": "/path/to/auth", "secret_backend": "backend", "secret_key": "a_key"},
metadata={"secret_path": "/path/to/secret", "secret_backend": "backend", "secret_key": "a_key"},
state='present'
), admin_user)
@ -153,7 +154,6 @@ def test_hashi_secret_credential_source(run_module, admin_user, organization, so
cis = CredentialInputSource.objects.first()
assert cis.metadata['secret_path'] == "/path/to/secret"
assert cis.metadata['auth_path'] == "/path/to/auth"
assert cis.metadata['secret_backend'] == "backend"
assert cis.metadata['secret_key'] == "a_key"
assert cis.source_credential.name == source_cred_hashi_secret.name
@ -188,14 +188,14 @@ def test_hashi_ssh_credential_source(run_module, admin_user, organization, sourc
name='Test Machine Credential',
organization=organization,
credential_type=ct,
inputs={'username': 'bob'}
inputs={'username': 'bob', "auth_path": "/path/to/auth"}
)
result = run_module('tower_credential_input_source', dict(
source_credential=source_cred_hashi_ssh.name,
target_credential=tgt_cred.name,
input_field_name='password',
metadata={"secret_path": "/path/to/secret", "auth_path": "/path/to/auth", "role": "role", "public_key": "a_key", "valid_principals": "some_value"},
metadata={"secret_path": "/path/to/secret", "role": "role", "public_key": "a_key", "valid_principals": "some_value"},
state='present'
), admin_user)
@ -206,7 +206,6 @@ def test_hashi_ssh_credential_source(run_module, admin_user, organization, sourc
cis = CredentialInputSource.objects.first()
assert cis.metadata['secret_path'] == "/path/to/secret"
assert cis.metadata['auth_path'] == "/path/to/auth"
assert cis.metadata['role'] == "role"
assert cis.metadata['public_key'] == "a_key"
assert cis.metadata['valid_principals'] == "some_value"