full test: decrypt and print messages

This commit is contained in:
s3lph 2022-04-18 22:08:17 +02:00
parent d122e9033e
commit 3af4ffe36c
2 changed files with 10 additions and 1 deletions

View file

@ -66,7 +66,6 @@ schleuder:
# Run a second time - should be idempotent and not trigger any new mails
- python3 -m coverage run --rcfile=setup.cfg -m multischleuder --config test/multischleuder.yml --verbose
- sleep 5 # wait for mail delivery
- cat /var/spool/mail/root
- test/report.py
- kill -9 ${API_DAEMON_PID} || true
- /usr/sbin/postmulti -i - -p stop

View file

@ -127,6 +127,16 @@ if msg2['Precedence'] != 'list':
print(f'Expected "Precedence: list", got {msg2["Precedence"]}')
exit(1)
gpg1 = subprocess.Popen(['/usr/bin/gpg2', '-d'],
stdin=msg1.get_payload()[1].get_payload(decode=True),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
gpg1o, _ = gpg2.communicate()
print(f'Key conflict message (decrypted):\n{gpg1o}')
gpg2 = subprocess.Popen(['/usr/bin/gpg2', '-d'],
stdin=msg2.get_payload()[1].get_payload(decode=True),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
gpg1o, _ = gpg2.communicate()
print(f'Admin report message (decrypted):\n{gpg2o}')
# Test conflict statefile