lava: Parameterize host and protocol settings
authorKienan Stewart <kstewart@efficios.com>
Fri, 19 May 2023 19:11:20 +0000 (15:11 -0400)
committerKienan Stewart <kstewart@efficios.com>
Wed, 24 May 2023 12:54:27 +0000 (08:54 -0400)
Change-Id: I43de2ff73e22ce100b0db08317908198825fd558

jobs/system-tests.yaml
scripts/system-tests/generate-properties-master.sh
scripts/system-tests/lava2-submit.py

index 32298e57b64d842fa6194cbdb202c0a85aadd39e..3741141993cfd027bc8eaf395726ae14f90c0bb2 100644 (file)
           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'
             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:
             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}}"
index ea70b3cdf4617f770941547311aff284e96e82f2..ee660a686623c67cff36677cd4bd3e8d5302cb10 100644 (file)
@@ -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
index cc66ed9b1cb6fb8df147227e12450ec312781db3..8ff4c55ed072efc817ce46128431ccaa592110e9 100644 (file)
@@ -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
         )
     )
 
This page took 0.025553 seconds and 4 git commands to generate.