Add a CI test to run acpidump

Signed-off-by: Al Stone <ahs3@redhat.com>
This commit is contained in:
Al Stone 2019-07-02 15:00:39 -06:00
parent b7f2c45191
commit 1e3222cefe
3 changed files with 60 additions and 0 deletions

3
tests/acpidump/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of tests/acpidump
Description: sanity check that system ACPI tables can be read
Author: Al Stone <ahs3@redhat.com>

30
tests/acpidump/runtest.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
#
# simple script to run acpidump and verify we got
# some output.
#
PWD=$(pwd)
BINDIR="/usr/bin"
# see if acpidump runs
rm -f /tmp/acpi.tables
$BINDIR/acpidump -o /tmp/acpi.tables 2>&1
RET=$?
if [ $RET -ne 0 ]
then
echo FAIL acpidump
exit $RET
fi
RET=2
sz=$(ls -s /tmp/acpi.tables | cut -d' ' -f1)
[[ $sz -gt 0 ]] && RET=0
if [ $RET -ne 0 ]
then
echo FAIL acpidump
exit $RET
fi
echo PASS acpidump
exit $RET

27
tests/test_acpidump.yml Normal file
View File

@ -0,0 +1,27 @@
- hosts: localhost
vars:
- artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
tags:
- classic
roles:
- role: standard-test-basic
tests:
- acpidump
required_packages:
- acpica-tools
remote_user: root
tasks:
- name: acpidump
block:
- name: run acpidump
shell: exec > /tmp/acpidump.test.log 2>&1 && ./acpidump/runtest.sh
always:
- name: pull out results
fetch:
dest: "{{ artifacts }}/"
src: "{{ item }}"
flat: yes
with_items:
- /tmp/acpidump.test.log
- /tmp/acpi.tables