From 1e3222cefed88299d3c3bd369598c141fdd46a1e Mon Sep 17 00:00:00 2001 From: Al Stone Date: Tue, 2 Jul 2019 15:00:39 -0600 Subject: [PATCH] Add a CI test to run acpidump Signed-off-by: Al Stone --- tests/acpidump/PURPOSE | 3 +++ tests/acpidump/runtest.sh | 30 ++++++++++++++++++++++++++++++ tests/test_acpidump.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 tests/acpidump/PURPOSE create mode 100755 tests/acpidump/runtest.sh create mode 100644 tests/test_acpidump.yml diff --git a/tests/acpidump/PURPOSE b/tests/acpidump/PURPOSE new file mode 100644 index 0000000..6742ec1 --- /dev/null +++ b/tests/acpidump/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of tests/acpidump +Description: sanity check that system ACPI tables can be read +Author: Al Stone diff --git a/tests/acpidump/runtest.sh b/tests/acpidump/runtest.sh new file mode 100755 index 0000000..df8b83d --- /dev/null +++ b/tests/acpidump/runtest.sh @@ -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 diff --git a/tests/test_acpidump.yml b/tests/test_acpidump.yml new file mode 100644 index 0000000..4bb772d --- /dev/null +++ b/tests/test_acpidump.yml @@ -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