mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Terminate gpg-agent after each test.
This is actual for gnupg 2.1 that requires the agent and starts it automatically. But since each test creates a new keystore tests become fail after the first one starts gpg-agent.
This commit is contained in:
parent
460af48f1f
commit
67e0c3e166
1 changed files with 13 additions and 0 deletions
|
@ -237,6 +237,19 @@ class DecryptGPGPillarTest(ModuleCase):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cmd = ['gpg-connect-agent', '--homedir', GPG_HOMEDIR]
|
||||
try:
|
||||
log.debug('Killing gpg-agent using: %s', cmd)
|
||||
output = subprocess.Popen(cmd,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=False).communicate(input=six.b('KILLAGENT'))[0]
|
||||
log.debug('Result:\n%s', output)
|
||||
except OSError:
|
||||
log.debug('No need to kill: old gnupg doesn\'t start the agent.')
|
||||
pass
|
||||
|
||||
if cls.created_gpg_homedir:
|
||||
try:
|
||||
shutil.rmtree(GPG_HOMEDIR)
|
||||
|
|
Loading…
Add table
Reference in a new issue