Base jinja template for lava submission
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 30 Oct 2018 21:34:37 +0000 (17:34 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 2 Nov 2018 20:48:51 +0000 (16:48 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
scripts/system-tests/template_lava_job.jinja2 [new file with mode: 0644]

diff --git a/scripts/system-tests/template_lava_job.jinja2 b/scripts/system-tests/template_lava_job.jinja2
new file mode 100644 (file)
index 0000000..167b193
--- /dev/null
@@ -0,0 +1,164 @@
+device_type: {{ device_type }}
+job_name: {{ job_name }}
+timeouts:
+  job:
+    hours: 2
+priority: medium
+visibility: public
+
+{% if device_type is 'qemu' -%}
+context:
+  # tell the qemu template which architecture is being tested
+  # the template uses that to ensure that qemu-system-x86_64 is executed.
+  {# Used amd64 as a default #}
+  arch: amd64
+{% endif -%}
+
+
+{% if device_type is 'x86' -%}
+tags:
+  - dev-sda1
+{% endif -%}
+
+metadata:
+  jenkins_jobname: {{jenkins_job}}
+{% if test_type is 'kvm-fuzzing-tests' -%}
+  nb_iterations: {{ kprobe_round_nb }}
+{% endif -%}
+
+
+actions:
+- deploy:
+    timeout:
+      minutes: 10
+    to: tftp
+    kernel:
+      url: {{ kernel_url }}
+      type: zimage
+    modules:
+      url: {{ linux_modules_url }}
+      archive: tar
+      compression: gz
+    modules:
+      url: {{ lttng_modules_url }}
+      archive: tar
+      compression: gz
+    nfsrootfs:
+      url: {{ nfsrootfs_url }}
+      compression: gz
+    os: ubuntu
+
+- boot:
+    timeout:
+      minutes: 10
+{% if device_type is 'x86' -%}
+    method: ipxe
+    commands: ramdisk
+    prompts:
+      - 'root@linaro-server:~#'
+{% elif device_type is 'kvm' -%}
+    method: qemu-nfs
+    media: nfs
+    auto_login:
+      login_prompt: "kvm02 login:"
+      username: root
+    prompts:
+      - 'linaro-test'
+{% endif -%}}
+
+- test:
+    definitions:
+        # Base setup of environment #
+        - repository:
+            metadata:
+            format: Lava-Test Test Definition 1.0
+            name: x86-env-setup
+            description: "Basic environment setup for x86 board"
+            os:
+              - ubuntu
+            devices:
+              - x86
+            run:
+              steps:
+                - cat /etc/resolv.conf
+                - echo nameserver 172.18.0.12 > /etc/resolv.conf
+                - groupadd tracing
+{% if device_type is 'x86' -%}
+                - mount /dev/sda1 /tmp
+                - rm -rf /tmp/*
+{% endif -%}
+                - depmod -a
+                - locale-gen en_US.UTF-8
+                - apt-get update
+                - apt-get upgrade
+                - apt-get install -y {{ packages|join(' ') }}
+{% if test_type is not 'kvm-fuzzing-tests' -%}
+                - pip3 install --upgrade pip
+                - hash -r
+                - pip3 install vlttng
+                - {{ vlttng_cmd }}
+                - ln -s {{ vlttng_path }} /root/lttngvenv
+                - sync
+{% endif -%}
+          from: inline
+          name: x86-env-setup-inline
+          path: inline/x86-env-setup.yaml
+{% if test_type is 'baremetal-benchmarks' -%}
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/failing-close.yml
+          name: failing-close
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/failing-ioctl.yml
+          name: failing-ioctl
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/failing-open-efault.yml
+          name: failing-open-efault
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/success-dup-close.yml
+          name: success-dup-close
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/raw-syscall-getpid.yml
+          name: raw-syscall-getpid
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/failing-open-enoent.yml
+          name: failing-open-enoent
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/lttng-test-filter.yml
+          name: lttng-test-filter
+{% elif test_type is 'baremetal-tests' -%}
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/perf-tests.yml
+          name: perf-tests
+{% elif test_type is 'kvm-tests' -%}
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/kernel-tests.yml
+          name: kernel-tests
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/destructive-tests.yml
+          name: destructive-tests
+{% elif test_type is 'kvm-fuzzing-tests' -%}
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/kprobe-fuzzing-generate-data.yml
+          name: kprobe-fuzzing-generate-data
+          params:
+            RANDOM_SEED: {{ random_seed }}
+        {% for i in range(kprobe_round_nb) i-%}
+        - repository: https://github.com/lttng/lttng-ci.git
+          from: git
+          path: lava/system-tests/kprobe-fuzzing-tests.yml
+          name: kprobe-fuzzing-tests
+          params:
+            ROUND_NB: {{ i }}
+        {% endfor %}
+{% endif -%}
This page took 0.024372 seconds and 4 git commands to generate.