-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun-ltp.yaml
83 lines (74 loc) · 1.85 KB
/
run-ltp.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
- hosts: guest
tasks:
- name: copy ltp skip case file to /opt/ltp
copy:
src: skip.ltp
dest: /opt/ltp
become: yes
- name: clean results and output folders
file:
path: "/opt/ltp/{{ item }}"
state: absent
loop:
- results
- output
become: yes
- name: run ltp test
command: "./runltp -p -q -f {{ item }} -o {{ instance_type }}-{{ item }}.console -l {{ instance_type }}-{{ item }}.result -S skip.ltp"
become: yes
become_user: root
args:
chdir: /opt/ltp/
loop:
- hyperthreading
- commands
- connectors
- crypto
- dio
- fcntl-locktests
- fs_bind
- fs_perms_simple
- fsx
- input
- ipc
- math
- mm
- nptl
- power_management_tests
- sched
- uevent
- net.tcp_cmds
- net.ipv6
- net_stress.interface
register: ltp_results
ignore_errors: True
- name: set result FAIL by default
set_fact:
ltp_result: "FAIL"
- name: set result PASS if all tests passed
set_fact:
ltp_result: "PASS"
when: ltp_results is succeeded
- name: fetch log and result folder back
ansible.posix.synchronize:
mode: pull
src: "/opt/ltp/{{ item }}"
dest: "{{ playbook_dir }}"
loop:
- results
- output
- name: write ltp report
template:
src: ltp_report.j2
dest: "{{ instance_type }}.{{ arch }}-ltp.report"
delegate_to: localhost
- name: write result to ltp.result file
copy:
content: "{{ ltp_result }}"
dest: ltp.result
delegate_to: localhost
- name: fail the test because ltp test failed
fail:
msg: ltp test failed
when: ltp_results is failed