From 969efe7e8499329889a54ff6a37ad10fe67a8739 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Tue, 2 Jul 2019 15:02:36 -0600 Subject: [PATCH] Add a CI test to see if tables created by acpidump can be read by acpixtract Signed-off-by: Al Stone --- tests/acpixtract/PURPOSE | 3 +++ tests/acpixtract/runtest.sh | 39 +++++++++++++++++++++++++++++++++++++ tests/test_acpixtract.yml | 26 +++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 tests/acpixtract/PURPOSE create mode 100755 tests/acpixtract/runtest.sh create mode 100644 tests/test_acpixtract.yml diff --git a/tests/acpixtract/PURPOSE b/tests/acpixtract/PURPOSE new file mode 100644 index 0000000..0f97fb3 --- /dev/null +++ b/tests/acpixtract/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of tests/acpixtract +Description: sanity check that ACPI tables created by acpidump can be read +Author: Al Stone diff --git a/tests/acpixtract/runtest.sh b/tests/acpixtract/runtest.sh new file mode 100755 index 0000000..9610ad8 --- /dev/null +++ b/tests/acpixtract/runtest.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# simple script to run acpixtract 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 acpixtract-dump + 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 acpixtract-size + exit $RET +fi + +# see if acpixtract runs +$BINDIR/acpixtract -a /tmp/acpi.tables 2>&1 +RET=$? +if [ $RET -ne 0 ] +then + echo FAIL acpixtract-read + exit $RET +fi + +echo PASS acpixtract +exit $RET diff --git a/tests/test_acpixtract.yml b/tests/test_acpixtract.yml new file mode 100644 index 0000000..964f79f --- /dev/null +++ b/tests/test_acpixtract.yml @@ -0,0 +1,26 @@ +- hosts: localhost + vars: + - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}" + tags: + - classic + roles: + - role: standard-test-basic + tests: + - acpixtract + required_packages: + - acpica-tools + remote_user: root + tasks: + - name: acpixtract + block: + - name: run acpixtract + shell: exec > /tmp/acpixtract.test.log 2>&1 && ./acpixtract/runtest.sh + + always: + - name: pull out results + fetch: + dest: "{{ artifacts }}/" + src: "{{ item }}" + flat: yes + with_items: + - /tmp/acpixtract.test.log