From 2c4062e58b3f5e5f93482ba3fe45244e15d40746 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Fri, 15 Nov 2013 01:22:47 -0500 Subject: [PATCH] AC-641 Added pattern to respond to key unlock prompt for project update. --- awx/main/tasks.py | 1 + awx/main/tests/projects.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 6f260e8915..3dfd201cc0 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -671,6 +671,7 @@ class RunProjectUpdate(BaseTask): re.compile(r'^Password for.*:\s*?$', re.M): 'scm_password', re.compile(r'^Password:\s*?$', re.M): 'scm_password', re.compile(r'^\S+?@\S+?\'s\s+?password:\s*?$', re.M): 'scm_password', + re.compile(r'^Enter passphrase for .*:\s*?$', re.M): 'scm_key_unlock', # FIXME: Configure whether we should auto accept host keys? re.compile(r'^Are you sure you want to continue connecting \(yes/no\)\?\s*?$', re.M): 'yes', }) diff --git a/awx/main/tests/projects.py b/awx/main/tests/projects.py index 6874f194b8..dc1f28ce49 100644 --- a/awx/main/tests/projects.py +++ b/awx/main/tests/projects.py @@ -901,6 +901,7 @@ class ProjectUpdatesTest(BaseTransactionTest): self.assertEqual(pu.status, 'successful', pu.result_stdout + pu.result_traceback) else: + #print pu.result_stdout pass # If should_fail is None, we don't care. # Get the SCM URL from the job args, if it starts with a '/' we aren't # handling the URL correctly. @@ -1393,6 +1394,8 @@ class ProjectUpdatesTest(BaseTransactionTest): self.check_project_update(project, should_fail=None, scm_key_unlock=TEST_SSH_KEY_DATA_UNLOCK, project_update=project_update) + # Verify that we responded to ssh-agent prompt. + self.assertTrue('Identity added' in project_update.result_stdout) def create_test_job_template(self, **kwargs): opts = {