From: Jonathan Rajotte Date: Wed, 31 Oct 2018 17:50:06 +0000 (-0400) Subject: Add debug option flag X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f23dc688a9e122c3daf4f97ce7b95926fd1d1a5c;p=lttng-ci.git Add debug option flag Signed-off-by: Jonathan Rajotte --- diff --git a/scripts/system-tests/lava-v2-submit.py b/scripts/system-tests/lava-v2-submit.py index 9981161..78ac542 100644 --- a/scripts/system-tests/lava-v2-submit.py +++ b/scripts/system-tests/lava-v2-submit.py @@ -414,6 +414,7 @@ def main(): parser.add_argument('-lm', '--lmodule', required=True) parser.add_argument('-tc', '--tools-commit', required=True) parser.add_argument('-uc', '--ust-commit', required=False) + parser.add_argument('-d', '--debug', required=False, action='store_true') args = parser.parse_args() if args.type not in TestType.values: @@ -425,11 +426,12 @@ def main(): test_type = TestType.values[args.type] lava_api_key = None - try: - lava_api_key = os.environ['LAVA_JENKINS_TOKEN'] - except Exception as e: - print('LAVA_JENKINS_TOKEN not found in the environment variable. Exiting...', e ) - return -1 + if not args.debug: + try: + lava_api_key = os.environ['LAVA_JENKINS_TOKEN'] + except Exception as e: + print('LAVA_JENKINS_TOKEN not found in the environment variable. Exiting...', e ) + return -1 if test_type is TestType.baremetal_benchmarks: j = create_new_job(args.jobname, build_device='x86') @@ -476,6 +478,10 @@ def main(): else: assert False, 'Unknown test type' + if args.debug: + print(json.dumps(j, indent=4, separators=(',', ': '))) + return 0 + server = xmlrpc.client.ServerProxy('http://%s:%s@%s/RPC2' % (USERNAME, lava_api_key, HOSTNAME)) jobid = server.scheduler.submit_job(json.dumps(j))