From 8cef2adf49d3f3df4110c62a665db6393b0537c7 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Wed, 21 Dec 2016 16:26:13 -0500 Subject: [PATCH 1/1] Lava: Get the Lava API key from the environment rather than the cli arguments Signed-off-by: Francis Deslauriers --- scripts/lttng-baremetal-tests/lava-submit.py | 10 ++++++++-- .../lttng-baremetal-tests/run-baremetal-benchmarks.sh | 2 -- scripts/lttng-baremetal-tests/run-baremetal-tests.sh | 2 -- scripts/lttng-baremetal-tests/run-kvm-tests.sh | 2 -- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/lttng-baremetal-tests/lava-submit.py b/scripts/lttng-baremetal-tests/lava-submit.py index 36f6fb5..2115718 100644 --- a/scripts/lttng-baremetal-tests/lava-submit.py +++ b/scripts/lttng-baremetal-tests/lava-submit.py @@ -338,7 +338,6 @@ def main(): parser.add_argument('-k', '--kernel', required=True) parser.add_argument('-km', '--kmodule', required=True) parser.add_argument('-lm', '--lmodule', required=True) - parser.add_argument('-l', '--lava-key', required=True) parser.add_argument('-tc', '--tools-commit', required=True) parser.add_argument('-uc', '--ust-commit', required=False) args = parser.parse_args() @@ -353,6 +352,13 @@ def main(): print('argument -t/--type {} unrecognized. Exiting...'.format(args.type)) return -1 + lava_api_key = None + try: + lava_api_key = os.environ['LAVA_FRDESO_TOKEN'] + except Exception, e: + print('LAVA_FRDESO_TOKEN not found in the environment variable. Exiting...') + return -1 + if test_type is TestType.baremetal_benchmarks: j = create_new_job(args.jobname, build_device='x86') j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.kmodule, args.lmodule)) @@ -389,7 +395,7 @@ def main(): else: assert False, 'Unknown test type' - server = xmlrpclib.ServerProxy('http://%s:%s@%s/RPC2' % (USERNAME, args.lava_key, HOSTNAME)) + server = xmlrpclib.ServerProxy('http://%s:%s@%s/RPC2' % (USERNAME, lava_api_key, HOSTNAME)) jobid = server.scheduler.submit_job(json.dumps(j)) diff --git a/scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh b/scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh index 4e2a1ee..724afa6 100644 --- a/scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh +++ b/scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh @@ -18,11 +18,9 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' git clone https://github.com/lttng/lttng-ci -set +x python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \ -t baremetal-benchmarks \ -j "$JOB_NAME" \ - -l "$LAVA_FRDESO_TOKEN" \ -k "$STORAGE_KERNEL_IMAGE" \ -km "$STORAGE_LINUX_MODULES" \ -lm "$STORAGE_LTTNG_MODULES" \ diff --git a/scripts/lttng-baremetal-tests/run-baremetal-tests.sh b/scripts/lttng-baremetal-tests/run-baremetal-tests.sh index abe5619..da991f4 100644 --- a/scripts/lttng-baremetal-tests/run-baremetal-tests.sh +++ b/scripts/lttng-baremetal-tests/run-baremetal-tests.sh @@ -18,11 +18,9 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' git clone https://github.com/lttng/lttng-ci -set +x python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \ -t baremetal-tests \ -j "$JOB_NAME" \ - -l "$LAVA_FRDESO_TOKEN" \ -k "$STORAGE_KERNEL_IMAGE" \ -km "$STORAGE_LINUX_MODULES" \ -lm "$STORAGE_LTTNG_MODULES" \ diff --git a/scripts/lttng-baremetal-tests/run-kvm-tests.sh b/scripts/lttng-baremetal-tests/run-kvm-tests.sh index 417a5e5..8b52fe1 100644 --- a/scripts/lttng-baremetal-tests/run-kvm-tests.sh +++ b/scripts/lttng-baremetal-tests/run-kvm-tests.sh @@ -18,11 +18,9 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' git clone https://github.com/lttng/lttng-ci -set +x python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \ -t kvm-tests \ -j "$JOB_NAME" \ - -l "$LAVA_FRDESO_TOKEN" \ -k "$STORAGE_KERNEL_IMAGE" \ -km "$STORAGE_LINUX_MODULES" \ -lm "$STORAGE_LTTNG_MODULES" \ -- 2.34.1