test-reboot.yml: test.log is mandatory, improve results format

According to
https://docs.fedoraproject.org/en-US/ci/standard-test-interface/#_invocation
every test must provide *test.log*.

Improve *results.yml* format.

Drop *avc.err.log* and log everything AVC denial related to *avc.log*
This commit is contained in:
Petr Lautrbach 2020-08-26 17:34:24 +02:00
parent 8c3ddf27e9
commit 74e5e49dca

View File

@ -33,9 +33,10 @@
shell: | shell: |
result=pass result=pass
dmesg | grep -i -e type=1300 -e type=1400 > /tmp/avc.log && result=fail dmesg | grep -i -e type=1300 -e type=1400 > /tmp/avc.log && result=fail
ausearch -m avc -m selinux_err -m user_avc -ts boot >> /tmp/avc.log 2> /tmp/avc.err.log ausearch -m avc -m selinux_err -m user_avc -ts boot &>> /tmp/avc.log
grep -q '<no matches>' /tmp/avc.err.log || result=fail grep -q '<no matches>' /tmp/avc.log || result=fail
echo -e "results:\n- test: reboot and collect AVC\n result: $result\n" > /tmp/results.yml echo -e "\nresults:\n- test: reboot and collect AVC\n result: $result\n logs:\n - avc.log\n\n" > /tmp/results.yml
( [ $result = "pass" ] && echo PASS test-reboot || echo FAIL test-reboot ) > /tmp/test.log
always: always:
- name: Pull out the artifacts - name: Pull out the artifacts
@ -44,6 +45,6 @@
src: "{{ item }}" src: "{{ item }}"
flat: yes flat: yes
with_items: with_items:
- /tmp/test.log
- /tmp/avc.log - /tmp/avc.log
- /tmp/avc.err.log
- /tmp/results.yml - /tmp/results.yml