summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2023-01-22 22:29:56 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2023-01-22 22:29:56 +0100
commit8815baab6fae0f45d2985a42f3b518b159efdfc7 (patch)
treebe46d33a2bb65495e5aeef864c105fadaba512a7
parent9908706c55407d0324455ad577fff9d0c6c617a6 (diff)
support all exit codes that autopkgtest-cloud supports
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
-rw-r--r--app.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/app.py b/app.py
index e221686..f4022ea 100644
--- a/app.py
+++ b/app.py
@@ -85,6 +85,25 @@ def index_release(LPUSER, PPA, PACKAGE, RELEASE):
base_url=flask.request.base_url)
+
+
+def human_exitcode(code: int):
+ if code in (0, 2):
+ return 'pass'
+ if code in (4, 6, 12):
+ return 'fail'
+ if code in (8,):
+ return 'neutral'
+ if code == 99:
+ return 'denylisted'
+ if code == 16:
+ return 'tmpfail'
+ if code == 20:
+ return 'error'
+ return 'exit code %i' % code
+
+
+
@app.route("/<LPUSER>/<PPA>/<PACKAGE>/<RELEASE>/<ARCH>")
def index_results(LPUSER, PPA, PACKAGE, RELEASE, ARCH):
@@ -125,7 +144,7 @@ def index_results(LPUSER, PPA, PACKAGE, RELEASE, ARCH):
"date": date,
"duration": duration,
"requester": requester,
- "result": "pass" if exitcode == 0 else "fail",
+ "result": human_exitcode(exitcode),
"url_prefix": f"{autopkgtest_url_base}/{idx}",
}
package_results.append([result[h] for h in headers])