mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
add pexpect test for net cred
This commit is contained in:
parent
48a0038f53
commit
9a199b99ac
@ -772,6 +772,22 @@ class TestJobCredentials(TestJobExecution):
|
||||
if expected_flag:
|
||||
assert expected_flag in ' '.join(args)
|
||||
|
||||
def test_net_password(self):
|
||||
net = CredentialType.defaults['net']()
|
||||
credential = Credential(
|
||||
pk=1,
|
||||
credential_type=net,
|
||||
inputs = {'username': 'bob', 'ssh_key_unlock': 'secret'}
|
||||
)
|
||||
credential.inputs['ssh_key_unlock'] = encrypt_field(credential, 'ssh_key_unlock')
|
||||
self.instance.credentials.add(credential)
|
||||
self.task.run(self.pk)
|
||||
|
||||
assert self.run_pexpect.call_count == 1
|
||||
call_args, call_kwargs = self.run_pexpect.call_args_list[0]
|
||||
|
||||
assert 'secret' in call_kwargs.get('expect_passwords').values()
|
||||
|
||||
def test_vault_password(self):
|
||||
vault = CredentialType.defaults['vault']()
|
||||
credential = Credential(
|
||||
|
Loading…
Reference in New Issue
Block a user