Peret checks PGP signed mails and extract submissions
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
850 B

import subprocess
from test import MailTest
def run_script(dest, script):
with subprocess.Popen(
["/bin/sh", script],
cwd=dest,
env={"LANG": 'C'},
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
) as p:
p.wait()
err = p.stdout.read().decode('utf-8', 'replace')
err += p.stderr.read().decode('utf-8', 'replace')
if p.returncode == 0:
yield MailTest("Preliminary tests:", details=err.replace(dest, "/rendu/"))
yield dest
elif p.returncode == 124 || p.returncode == 137:
yield MailTest("Preliminary tests aborted for too long execution:", 1, details=err.replace(dest, "/rendu/"))
else:
yield MailTest("An error occured during preliminary tests:", 1, details=err.replace(dest, "/rendu/"))