From a2243f8997c2003ec552b7a7873f20c0ccd031d3 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Tue, 15 Aug 2017 16:20:31 -0400 Subject: [PATCH] jjb: lava: Move fuzzing test to its own lava job Signed-off-by: Francis Deslauriers --- jobs/lttng-baremetal-tests.yaml | 102 ++++++++++-------- scripts/lttng-baremetal-tests/lava-submit.py | 12 ++- .../run-kvm-fuzzing-tests.sh | 28 +++++ 3 files changed, 99 insertions(+), 43 deletions(-) create mode 100644 scripts/lttng-baremetal-tests/run-kvm-fuzzing-tests.sh diff --git a/jobs/lttng-baremetal-tests.yaml b/jobs/lttng-baremetal-tests.yaml index ab498f9..8e05a33 100644 --- a/jobs/lttng-baremetal-tests.yaml +++ b/jobs/lttng-baremetal-tests.yaml @@ -160,6 +160,51 @@ 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: | @@ -264,51 +309,23 @@ 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} @@ -524,5 +541,6 @@ - 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}' diff --git a/scripts/lttng-baremetal-tests/lava-submit.py b/scripts/lttng-baremetal-tests/lava-submit.py index 8ef9ad4..a2d721a 100644 --- a/scripts/lttng-baremetal-tests/lava-submit.py +++ b/scripts/lttng-baremetal-tests/lava-submit.py @@ -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 index 0000000..a7ba525 --- /dev/null +++ b/scripts/lttng-baremetal-tests/run-kvm-fuzzing-tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash -xeu +# Copyright (C) 2017 - Francis Deslauriers +# +# 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 . + +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" -- 2.34.1