From: Kienan Stewart Date: Fri, 19 May 2023 19:11:20 +0000 (-0400) Subject: lava: Parameterize host and protocol settings X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=005e75b441f41f3f7158e6fd732b32a309275f2f;p=lttng-ci.git lava: Parameterize host and protocol settings Change-Id: I43de2ff73e22ce100b0db08317908198825fd558 --- diff --git a/jobs/system-tests.yaml b/jobs/system-tests.yaml index 32298e5..3741141 100644 --- a/jobs/system-tests.yaml +++ b/jobs/system-tests.yaml @@ -47,6 +47,16 @@ name: 'LTTNG_CI_BRANCH' default: 'master' description: 'The branch of the CI repository to clone for job scripts' + - string: + name: 'LAVA_HOST' + default: 'lava-master-02.internal.efficios.com' + description: 'The hostname of the LAVA instance' + - choice: + name: 'LAVA_PROTO' + choices: + - 'http' + - 'https' + description: 'The protocol to use with the LAVA host' - publisher: name: 'system_tests_email_ext_default' @@ -108,6 +118,8 @@ LTTNG_VERSION={lttngversion} LTTNG_CI_REPO=${{LTTNG_CI_REPO}} LTTNG_CI_BRANCH=${{LTTNG_CI_BRANCH}} + LAVA_HOST=${{LAVA_HOST}} + LAVA_PROTO=${{LAVA_PROTO}} scm: - git: @@ -186,7 +198,8 @@ LTTNG_VERSION={lttngversion} LTTNG_CI_REPO=${{LTTNG_CI_REPO}} LTTNG_CI_BRANCH=${{LTTNG_CI_BRANCH}} - + LAVA_HOST=${{LAVA_HOST}} + LAVA_PROTO=${{LAVA_PROTO}} scm: - git: url: "${{LTTNG_CI_REPO}}" diff --git a/scripts/system-tests/generate-properties-master.sh b/scripts/system-tests/generate-properties-master.sh index ea70b3c..ee660a6 100644 --- a/scripts/system-tests/generate-properties-master.sh +++ b/scripts/system-tests/generate-properties-master.sh @@ -29,6 +29,9 @@ secret_key = echo123456 # Enable S3 v4 signature APIs signature_v2 = False" > "$WORKSPACE/s3cfg" +echo "LAVA_HOST=$LAVA_HOST" >> properties.txt +echo "LAVA_PROTO=$LAVA_PROTO" >> properties.txt + LTTNG_CI_PATH="$WORKSPACE/src/lttng-ci" echo "LTTNG_CI_PATH=$LTTNG_CI_PATH" >> properties.txt echo "LTTNG_CI_REPO=$LTTNG_CI_REPO" >> properties.txt diff --git a/scripts/system-tests/lava2-submit.py b/scripts/system-tests/lava2-submit.py index cc66ed9..8ff4c55 100644 --- a/scripts/system-tests/lava2-submit.py +++ b/scripts/system-tests/lava2-submit.py @@ -28,7 +28,8 @@ import yaml from jinja2 import Environment, FileSystemLoader USERNAME = 'lava-jenkins' -HOSTNAME = 'lava-master-02.internal.efficios.com' +HOSTNAME = os.environ.get('LAVA_HOST', 'lava-master-02.internal.efficios.com') +PROTO = os.environ.get('LAVA_PROTO', 'http') OBJSTORE_URL = "https://obj.internal.efficios.com/lava/results/" def parse_stable_version(stable_version_string): @@ -89,8 +90,8 @@ def check_job_all_test_cases_state_count(server, job): for testcase in testcases: if testcase['result'] != 'pass': print( - "\tFAILED {}\n\t\t See http://{}{}".format( - testcase['name'], HOSTNAME, testcase['url'] + "\tFAILED {}\n\t\t See {}://{}{}".format( + testcase['name'], PROTO, HOSTNAME, testcase['url'] ) ) failed_tests += 1 @@ -280,7 +281,7 @@ def main(): return 0 server = xmlrpc.client.ServerProxy( - 'http://%s:%s@%s/RPC2' % (USERNAME, lava_api_key, HOSTNAME) + '%s://%s:%s@%s/RPC2' % (PROTO, USERNAME, lava_api_key, HOSTNAME) ) for attempt in range(1, send_retry_limit + 1): @@ -307,8 +308,8 @@ def main(): print('Lava jobid:{}'.format(jobid)) print( - 'Lava job URL: http://lava-master-02.internal.efficios.com/scheduler/job/{}'.format( - jobid + 'Lava job URL: {}://{}/scheduler/job/{}'.format( + PROTO, HOSTNAME, jobid ) )