From de0fba3b99b23ddcbe6ed4a8e9bee56c4faa32f7 Mon Sep 17 00:00:00 2001 From: Johnny Bieren Date: Nov 08 2018 13:41:48 +0000 Subject: Add remote version of test_local.yml Signed-off-by: Johnny Bieren --- diff --git a/misc/ltp/test_remote.yml b/misc/ltp/test_remote.yml new file mode 100644 index 0000000..6ec8864 --- /dev/null +++ b/misc/ltp/test_remote.yml @@ -0,0 +1,111 @@ +--- +- hosts: all + vars: + artifacts: ./artifacts + ltpgit: https://github.com/linux-test-project/ltp.git + testarea: /mnt/testarea + ltpdir: "{{testarea}}/ltp" + ctlogs: "{{artifacts}}/ctlogs" + ltpgitver: HEAD + builddir: ./ltp + userspacetargets: + - containers + - controllers + - hugetlb + - mm + - numa + - sched + - syscalls + tasks: + - name: Install dependencies + dnf: + name: "{{item}}" + state: latest + with_items: + - automake + - autoconf + - bison + - flex + - util-linux + - gcc + - git + - patch + + - name: Fetch ltp + git: + repo: "{{ltpgit}}" + dest: "{{builddir}}" + version: "{{ltpgitver}}" + + - name: Add swap if there isn't over 7.2G + block: + - name: Create swapfile + command: dd if=/dev/zero of=/swapfile bs=1024 count=8388608 + + - name: Format swap + command: mkswap /swapfile + + - name: Turn swap on + command: swapon /swapfile + + - name: Enable swap for reboots + lineinfile: + dest: /etc/fstab + line: "/swapfile swap swap defaults 0 0" + state: present + when: ansible_swaptotal_mb < 7200 + + - name: Patch ltp + patch: + src: ltp-pan-ltp-testname-stamps-in-dmesg-and-console.patch + basedir: "{{builddir}}" + strip: 1 + + - name: Clear existing logs + file: + path: "{{ltpdir}}" + state: absent + ignore_errors: yes + + - name: Run autotools for ltp + make: + chdir: "{{builddir}}" + target: autotools + + - name: Configure ltp + shell: ./configure --prefix {{ltpdir}} + args: + chdir: "{{builddir}}" + + - name: Build ltp + make: + chdir: "{{builddir}}" + + - name: Install ltp + make: + chdir: "{{builddir}}" + target: install + + - name: Copy knownissues.sh and runtest.sh to remote host + copy: + src: "{{ item }}" + dest: "{{ builddir }}" + with_items: + - ./knownissues.sh + - ./runtest.sh + + - name: Get known issues + command: {{ builddir }}/knownissues.sh > {{ltpdir}}/ltp.skip + + - name: Run ltp + command: "{{ builddir }}/runtest.sh {{ ltpdir }} {{ item }}" + ignore_errors: yes + with_items: + - "{{ userspacetargets }}" + + - name: Fail play if testing failed + shell: "egrep '^Total Failures' {{ ltpdir }}/logs/{{ item }}/ltp.log | awk '{print $3}'" + register: number_failures + failed_when: number_failures.stdout != "0" + with_items: + - "{{ userspacetargets }}"