From 78b2b53df5488b1f1f1b318b34aa6ab721fdeda5 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Wed, 22 Jul 2020 14:01:10 +0200 Subject: SPEC-3414: add tests used for testing releng-scripts When working on SPEC-3414, I did some test tool for releng-scripts. This patchs adds them. - test.sh scan artefacts and try to generated jobs with them - checkjobs.py check all ran jobs and try to detect if there was apps jobs and if they has errors. Change-Id: Iab21573741ab4fa3cdfc29fd0d7aab33c904d838 Bug-AGL: SPEC-3414 Signed-off-by: Corentin LABBE --- test/checkjobs.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/checkjobs.py (limited to 'test/checkjobs.py') diff --git a/test/checkjobs.py b/test/checkjobs.py new file mode 100755 index 0000000..529d2fb --- /dev/null +++ b/test/checkjobs.py @@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +import re +import yaml +import os +import xmlrpc.client + +lserver = xmlrpc.client.ServerProxy(os.getenv("LAVAURI"), allow_none=True) + +offset = 0 +while offset < 100: + jlist = lserver.scheduler.jobs.list('FINISHED', None, offset, 100, None, False) + for job in jlist: + if job["submitter"] == 'lava-health': + continue + jobid = job["id"] + print(jobid) + job_out_raw = lserver.scheduler.job_output(jobid) + job_out = yaml.safe_load(job_out_raw.data) + for job_out_line in job_out: + if job_out_line["lvl"] == 'debug' and isinstance(job_out_line["msg"], str) and re.search('APPURL=', job_out_line["msg"]): + print(job_out_line) + if job_out_line["lvl"] == 'target' and re.search('WGTNAME=', job_out_line["msg"]): + print(job_out_line) + if job_out_line["lvl"] == 'target' and re.search('ERROR', job_out_line["msg"]): + print(job_out_line) + offset += 100 -- cgit 1.2.3-korg