Add debug option flag
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 31 Oct 2018 17:50:06 +0000 (13:50 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 2 Nov 2018 20:48:49 +0000 (16:48 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
scripts/system-tests/lava-v2-submit.py

index 9981161a8a9144972377e9ab4f74334dc9c482e5..78ac542e002068f01fe0d0535af4f73df9f4c38c 100644 (file)
@@ -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))
This page took 0.023955 seconds and 4 git commands to generate.