jjb: lava: Move fuzzing test to its own lava job
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 15 Aug 2017 20:20:31 +0000 (16:20 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 16 Aug 2017 18:35:01 +0000 (14:35 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
jobs/lttng-baremetal-tests.yaml
scripts/lttng-baremetal-tests/lava-submit.py
scripts/lttng-baremetal-tests/run-kvm-fuzzing-tests.sh [new file with mode: 0644]

index ab498f9c657f89c04163ccd4653d40dd82e0d229..8e05a33c4fe55bcec71ef279c267b572e6f75734 100644 (file)
           properties-file: properties.txt
       - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-kvm-tests.sh
 
+- defaults:
+    name: vm_tests_kmainline
+    defaults: vm_tests
+    triggers:
+      - pollscm:
+          cron: "0 1 * * 1-5"
+    wrappers:
+      - workspace-cleanup
+      - timestamps
+      - ansicolor
+      - credentials-binding:
+          - text:
+              credential-id: jenkins_lava_key
+              variable: LAVA_JENKINS_TOKEN
+      - inject:
+          properties-content: |
+            TOOLS_BRANCH={toolsversion}
+            MODULES_BRANCH={modulesversion}
+            UST_BRANCH={ustversion}
+            BUILD_DEVICE=baremetal
+    scm:
+      - git:
+          url: git://git-mirror.internal.efficios.com/lttng/lttng-tools.git
+          branches:
+            - "{toolsversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/lttng-tools
+      - git:
+          url: git://git-mirror.internal.efficios.com/lttng/lttng-modules.git
+          branches:
+            - "{modulesversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/lttng-modules
+      - git:
+          url: git://git-mirror.internal.efficios.com/kernel/torvalds/linux.git
+          refspec: "+refs/tags/*:refs/remotes/origin/tags/*"
+          branches:
+            - "master"
+          fastpoll: true
+          basedir: src/linux
+
 - defaults:
     name: baremetal_tests
     description: |
     defaults: baremetal_benchmarks
     triggers:
       - timed: "0 1 * * 1-5"
-
 - job-template:
     name: vm_tests_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}
-    defaults: vm_tests
-    triggers:
-      - pollscm:
-          cron: "0 1 * * 1-5"
-    wrappers:
-      - workspace-cleanup
-      - timestamps
-      - ansicolor
-      - credentials-binding:
-          - text:
-              credential-id: jenkins_lava_key
-              variable: LAVA_JENKINS_TOKEN
+    defaults: vm_tests_kmainline
+
+- job-template:
+    name: vm_tests_fuzzing_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}
+    defaults: vm_tests_kmainline
+
+    builders:
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/generate-properties-master.sh
+      - trigger-builds:
+        - project: "build_kernel_PARAM"
+          property-file: 'properties.txt'
+          block: true
       - inject:
-          properties-content: |
-            TOOLS_BRANCH={toolsversion}
-            MODULES_BRANCH={modulesversion}
-            UST_BRANCH={ustversion}
-            BUILD_DEVICE=baremetal
-    scm:
-      - git:
-          url: git://git-mirror.internal.efficios.com/lttng/lttng-tools.git
-          branches:
-            - "{toolsversion}"
-          shallow-clone: true
-          skip-tag: true
-          fastpoll: true
-          basedir: src/lttng-tools
-      - git:
-          url: git://git-mirror.internal.efficios.com/lttng/lttng-modules.git
-          branches:
-            - "{modulesversion}"
-          shallow-clone: true
-          skip-tag: true
-          fastpoll: true
-          basedir: src/lttng-modules
-      - git:
-          url: git://git-mirror.internal.efficios.com/kernel/torvalds/linux.git
-          refspec: "+refs/tags/*:refs/remotes/origin/tags/*"
-          branches:
-            - "master"
-          fastpoll: true
-          basedir: src/linux
+          properties-file: properties.txt
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-kvm-fuzzing-tests.sh
 
 - job-template:
     name: baremetal_tests_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}
       - stable-2.9
     jobs:
       - 'vm_tests_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}'
+      - 'vm_tests_fuzzing_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}'
       - 'baremetal_tests_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}'
       - 'baremetal_benchmarks_kmainline_t{toolsversion}_m{modulesversion}_u{ustversion}'
index 8ef9ad48c081c711fa93e46d3c4bf03edf78867c..a2d721ab6cf66b4b7925bd66db95b0220eb5c127 100644 (file)
@@ -32,6 +32,7 @@ class TestType(Enum):
     baremetal_benchmarks=1
     baremetal_tests=2
     kvm_tests=3
+    kvm_fuzzing_tests=4
 
 def get_job_bundle_content(server, job):
     try:
@@ -394,6 +395,8 @@ def main():
         test_type = TestType.baremetal_tests
     elif args.type in 'kvm-tests':
         test_type = TestType.kvm_tests
+    elif args.type in 'kvm-fuzzing-tests':
+        test_type = TestType.kvm_fuzzing_tests
     else:
         print('argument -t/--type {} unrecognized. Exiting...'.format(args.type))
         return -1
@@ -411,7 +414,7 @@ def main():
     elif test_type is TestType.baremetal_tests:
         j = create_new_job(args.jobname, build_device='x86')
         j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.kmodule, args.lmodule))
-    elif test_type  is TestType.kvm_tests:
+    elif test_type  is TestType.kvm_tests or test_type is TestType.kvm_fuzzing_tests:
         j = create_new_job(args.jobname, build_device='kvm')
         j['actions'].append(get_deploy_cmd_kvm(args.jobname, args.kernel, args.kmodule, args.lmodule))
 
@@ -437,6 +440,13 @@ def main():
         j['actions'].append(get_config_cmd('kvm'))
         j['actions'].append(get_env_setup_cmd('kvm', args.tools_commit, args.ust_commit))
         j['actions'].append(get_kvm_tests_cmd())
+        j['actions'].append(get_results_cmd(stream_name='tests-kernel'))
+    elif test_type is TestType.kvm_fuzzing_tests:
+        if args.ust_commit is None:
+            print('Tests runs need -uc/--ust-commit options. Exiting...')
+            return -1
+        j['actions'].append(get_config_cmd('kvm'))
+        j['actions'].append(get_env_setup_cmd('kvm', args.tools_commit, args.ust_commit))
         j['actions'].append(get_kprobes_test_cmd())
         j['actions'].append(get_results_cmd(stream_name='tests-kernel'))
     else:
diff --git a/scripts/lttng-baremetal-tests/run-kvm-fuzzing-tests.sh b/scripts/lttng-baremetal-tests/run-kvm-fuzzing-tests.sh
new file mode 100644 (file)
index 0000000..a7ba525
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash -xeu
+# Copyright (C) 2017 - Francis Deslauriers <francis.deslauriers@efficios.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+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 "$LTTNG_CI_PATH"
+
+python3 -u "$LTTNG_CI_PATH"/scripts/lttng-baremetal-tests/lava-submit.py \
+                          -t kvm-fuzzing-tests \
+                          -j "$JOB_NAME" \
+                          -k "$STORAGE_KERNEL_IMAGE" \
+                          -km "$STORAGE_LINUX_MODULES" \
+                          -lm "$STORAGE_LTTNG_MODULES" \
+                          -tc "$LTTNG_TOOLS_COMMIT_ID" \
+                          -uc "$LTTNG_UST_COMMIT_ID"
This page took 0.032164 seconds and 4 git commands to generate.