From 882bd4ddf6e7cd29a17e0a5fcd9ff3d2d9cb9f37 Mon Sep 17 00:00:00 2001 From: Mike Gahagan Date: Thu, 18 Oct 2018 15:07:35 -0400 Subject: [PATCH] Add acpica-tools internal tests --- tests/acpica-tools-tests/aslts/Makefile | 56 +++++++++ tests/acpica-tools-tests/aslts/PURPOSE | 36 ++++++ tests/acpica-tools-tests/aslts/runtest.sh | 61 ++++++++++ tests/acpica-tools-tests/include/Makefile | 64 ++++++++++ tests/acpica-tools-tests/include/PURPOSE | 8 ++ tests/acpica-tools-tests/include/include.sh | 112 ++++++++++++++++++ tests/acpica-tools-tests/include/runtest.sh | 6 + tests/acpica-tools-tests/misc/Makefile | 56 +++++++++ tests/acpica-tools-tests/misc/PURPOSE | 4 + tests/acpica-tools-tests/misc/runtest.sh | 62 ++++++++++ tests/acpica-tools-tests/templates/Makefile | 56 +++++++++ tests/acpica-tools-tests/templates/PURPOSE | 2 + tests/acpica-tools-tests/templates/runtest.sh | 59 +++++++++ tests/test_acpica-tools-tests.yml | 22 ++++ tests/tests.yml | 2 + 15 files changed, 606 insertions(+) create mode 100644 tests/acpica-tools-tests/aslts/Makefile create mode 100644 tests/acpica-tools-tests/aslts/PURPOSE create mode 100755 tests/acpica-tools-tests/aslts/runtest.sh create mode 100644 tests/acpica-tools-tests/include/Makefile create mode 100644 tests/acpica-tools-tests/include/PURPOSE create mode 100644 tests/acpica-tools-tests/include/include.sh create mode 100644 tests/acpica-tools-tests/include/runtest.sh create mode 100644 tests/acpica-tools-tests/misc/Makefile create mode 100644 tests/acpica-tools-tests/misc/PURPOSE create mode 100755 tests/acpica-tools-tests/misc/runtest.sh create mode 100644 tests/acpica-tools-tests/templates/Makefile create mode 100644 tests/acpica-tools-tests/templates/PURPOSE create mode 100755 tests/acpica-tools-tests/templates/runtest.sh create mode 100644 tests/test_acpica-tools-tests.yml diff --git a/tests/acpica-tools-tests/aslts/Makefile b/tests/acpica-tools-tests/aslts/Makefile new file mode 100644 index 0000000..6c556b2 --- /dev/null +++ b/tests/acpica-tools-tests/aslts/Makefile @@ -0,0 +1,56 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/aslts +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Author, maintainer and description of the test +AUTHOR=Mike Gahagan +DESCRIPTION=ACPICA ASL grammar validation Test Suite (ASLTS) +PACKAGE=acpica-tools + +# The name of the test. +export TEST=/CoreOS/acpica-tools/acpica-tools-tests/aslts + +# Version of the test. Used with make tag. +export TESTVERSION=1.0 + + +# data files, .c files, scripts anything needed to either compile the test and/or run it. +FILES=$(METADATA) runtest.sh PURPOSE Makefile + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) $(FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ *.rpm + rm -f $(METADATA) + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: $(AUTHOR)" > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: $(DESCRIPTION)" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: $(PACKAGE)" >> $(METADATA) + @echo "Architectures: aarch64 i386 x86_64 ppc64 ppc64le" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "RhtsRequires: test(/CoreOS/acpica-tools/acpica-tools-tests/include)" >> $(METADATA) + @echo "Requires: $(PACKAGE)" >> $(METADATA) + @echo "Requires: @developer-tools" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: rpm-build" >> $(METADATA) + @echo "Requires: wget" >> $(METADATA) + rhts-lint $(METADATA) +# The include package takes care of all the dependencies +# Add any other dependencies there (/kernel/filesystems/xfs/include) diff --git a/tests/acpica-tools-tests/aslts/PURPOSE b/tests/acpica-tools-tests/aslts/PURPOSE new file mode 100644 index 0000000..de7f3fa --- /dev/null +++ b/tests/acpica-tools-tests/aslts/PURPOSE @@ -0,0 +1,36 @@ +from tests/aslts/README: + + ACPICA ASL grammar validation Test Suite (ASLTS) + + + ASLTS verifies, in "hardware-independent" mode, conformity of ACPICA +ASL compiler and interpreter to the ACPI ASL grammar specification. The +more common task of ASLTS is to check, in "hardware-independent" mode also, +all the functionality of ACPICA which can be initiated and then verified +from inside the test modules coded in ASL. The first local task is performed +by the test collection named 'functional', to achieve the second one the tests +of other collections are intended: complex, exceptions, etc. The conditional +difference between the tests of 'functional' and 'complex' collections is that +the tests of 'functional' collection checks specific functionality of the +particular ASL operator while the tests of 'complex' collection verify the +more common functionality. + + The testing is performed in "hardware-independent" mode without any +access to ACPI subsystem hardware. In this purpose the AcpiExec utility +is used which includes the entire ACPICA subsystem and allows to execute +the AML code and thus verify functionality of ACPICA subsystem. + + The ASL source code is compiled to AML code and then passed to +AcpiExec utility. In this relation one more type tests are provided, +so called ASL-compilation control test collection, which check ability +of ASL compiler to reveal and report incorrect ASL code. + + The tests of the exceptional conditions test collection +initiate and verify exceptional conditions, check that the +exceptions occur (or not occur) in the expected specified way. + + The testing is provided in both 32-bit and 64-bit modes +(option -r of ASL compiler) as well both normal and slack +modes (option -s of AcpiExec). + + diff --git a/tests/acpica-tools-tests/aslts/runtest.sh b/tests/acpica-tools-tests/aslts/runtest.sh new file mode 100755 index 0000000..51ab231 --- /dev/null +++ b/tests/acpica-tools-tests/aslts/runtest.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/acpica-tools/acpica-tools-tests/aslts +# Description: ACPICA ASL grammar validation Test Suite (ASLTS) +# Author: Mike Gahagan +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +#. /usr/bin/rhts-environment.sh +#. /usr/share/beakerlib/beakerlib.sh +TESTNAME=$(basename $TEST) +. ../include/include.sh + + +PACKAGE="acpica-tools" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun mk_test_dirs + rlRun acpica-tools_prep + rlPhaseEnd + + rlPhaseStartTest + rlShowRunningKernel + pushd ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests + rlRun "./aslts.sh -u > $log_dir/aslts.sh.out 2>&1" 0 "Running ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/aslts.sh... Logging to $log_dir/aslts.sh.out" + retval=$? + if [[ $retval -ne 0 || $DeBug -ne 0 ]] ; then + echo "Creating tarball: $log_dir/aslts_run_log.tar.xz of ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/aslts/tmp" + tar -Jcf $log_dir/aslts_run_log.tar.xz ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/aslts/tmp + fi + popd + rlPhaseEnd + + rlPhaseStartCleanup + submit_logs + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/acpica-tools-tests/include/Makefile b/tests/acpica-tools-tests/include/Makefile new file mode 100644 index 0000000..0543394 --- /dev/null +++ b/tests/acpica-tools-tests/include/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/include +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +AUTHOR=Mike Gahagan +DESCRIPTION=This virtual test case provides a common set of functions for numerous test cases. +PACKAGE=acpica-tools + +export TEST=/CoreOS/acpica-tools/acpica-tools-tests/include +export TESTVERSION=1.0 + +FILES=$(METADATA) Makefile PURPOSE *.sh + +.PHONY: all install download clean + +run: $(FILES) build + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) *.rpm + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: $(AUTHOR)" > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: $(DESCRIPTION)" >> $(METADATA) + @echo "Type: Library" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "Priority: High" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "RunFor: $(PACKAGE)" >> $(METADATA) + @echo "Requires: $(PACKAGE)" >> $(METADATA) + @echo "Requires: @developer-tools" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: rpm-build" >> $(METADATA) + @echo "Requires: wget" >> $(METADATA) + rhts-lint $(METADATA) diff --git a/tests/acpica-tools-tests/include/PURPOSE b/tests/acpica-tools-tests/include/PURPOSE new file mode 100644 index 0000000..5712ce5 --- /dev/null +++ b/tests/acpica-tools-tests/include/PURPOSE @@ -0,0 +1,8 @@ +Common library functions for acpica-tools-tests. + +This task includes library functions for other acpica-tools-tests tasks, do not schedule this task directly. + +includes: + - Download/install of binary acpica-tools package + - Download/install and build prep of acpica-tools .src.rpm + - diff --git a/tests/acpica-tools-tests/include/include.sh b/tests/acpica-tools-tests/include/include.sh new file mode 100644 index 0000000..26b5f86 --- /dev/null +++ b/tests/acpica-tools-tests/include/include.sh @@ -0,0 +1,112 @@ +#!/bin/bash +# /Coreos/acpica-tools/acpica-tools-tests/include/include.sh +# Constants +######################################## +# - debug turn off SELinux +#setenforce 0 +######################################## + +# Source the common test script helpers +. /usr/bin/rhts_environment.sh +. /usr/share/beakerlib/beakerlib.sh + +# Assume the test will fail. +DeBug=0 # Set to 1 to gather all logs from all tests. +packagename=acpica-tools +RPM_NAME=`rpm -q --queryformat '%{name}\n' $packagename` +RPM_VER=`rpm -q --queryformat '%{version}\n' $packagename` +RPM_REL=`rpm -q --queryformat '%{release}\n' $packagename` +#RPM_ARCH=`rpm -q --queryformat '%{arch}\n' $packagename` +OUTPUTDIR=/mnt/testarea/acpica-tools-tests + +# Functions + + +# Make log and output directories if needed +function mk_test_dirs() +{ +if test ! -d $OUTPUTDIR ; then + echo "Creating $OUTPUTDIR" | tee -a $OUTPUTFILE + mkdir -p $OUTPUTDIR || rlDie "Can't create directory ${OUTPUTDIR}!" +fi +log_dir=${OUTPUTDIR}/logs/${TESTNAME}-${$} +if test ! -d $log_dir ; then + echo "Creating $log_dir" | tee -a $OUTPUTFILE + mkdir -p $log_dir || rlDie "Can't create directory ${log_dir}!" +fi +RPMBUILDDIR=${OUTPUTDIR}/rpmbuild +if test ! -d $RPMBUILDDIR ; then + echo "Creating RPM build directorires" | tee -a $OUTPUTFILE + mkdir -p $RPMBUILDDIR/{BUILD,BUILDROOT,RPMS,SPECS,SOURCES,SRPMS} || rlDie "Can't create RPM build directories" +fi +export OUTPUTDIR log_dir RPMBUILDDIR +} + +# Grab src rpm from brew using wget requires package n v r +function get_srpm_from_koji() +{ + local name=$1 + local version=$2 + local release=$3 + local wget_opts="-Nnv" + local url2srcfile="http://kojipkgs.fedoraproject.org/packages/${name}/${version}/${release}/src/${name}-${version}-${release}.src.rpm" + wget $wget_opts $url2srcfile >> $OUTPUTFILE 2>&1 + if [ "$?" -eq "0" ] ; then + echo "***** Successfully downloaded ${name}-${version}-${release}.src.rpm from brewroot *****" | tee -a $OUTPUTFILE + fi +} + +# Install a src.rpm to a given buildroot +# Requires path to src.rpm and an existing buildroot directory to install to. +function install_srpm() +{ + local srpm=$1 + local buildroot=$2 + if [ -d "$buildroot" ] ; then + if [ -e $srpm ] ; then + rpm --define "_topdir $RPMBUILDDIR" -ivh $srpm + if [ "$?" -eq "0" ] ; then + echo "***** Successfully installed $srpm *****" | tee -a $OUTPUTFILE + else + echo "***** Unable to install $srpm *****" | tee -a $OUTPUTFILE + return 1 + fi + else + echo "***** $srpm file not found *****" | tee -a $OUTPUTFILE + return 1 + fi + else + echo "***** $buildroot does not exist *****" | tee -a $OUTPUTFILE + return 1 + fi +} + +# run rpm -bp on extracted acpi-tools src.rpm if needed +function rpmbp_acpica-tools() +{ + rpmbuild --define "_topdir $RPMBUILDDIR" -bp $RPMBUILDDIR/SPECS/acpica-tools.spec > ${log_dir}/rpm-bp-acpica-tools-${$}.log 2>&1 + [ $? -eq 0 ] && return 0 || return 1 +} + +function acpica-tools_prep() +{ + if [ ! -d ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER} ] ; then + rlRun "get_srpm_from_koji $RPM_NAME $RPM_VER $RPM_REL" + rlRun "install_srpm ${RPM_NAME}-${RPM_VER}-${RPM_REL}.src.rpm $RPMBUILDDIR" + rlRun rpmbp_acpica-tools + else + rlLog "acpica-tools source tree is already prepared for testing, skipping acpica-tools_prep()" + fi +} + + +# wrapper around rlFileSubmit to preserve path names of the log files and submit all files in the log directory +function submit_logs() +{ + for f in $log_dir/*; do + if [ -f $f ] ; then + rlFileSubmit $f + fi + done +} + diff --git a/tests/acpica-tools-tests/include/runtest.sh b/tests/acpica-tools-tests/include/runtest.sh new file mode 100644 index 0000000..0bf7eaf --- /dev/null +++ b/tests/acpica-tools-tests/include/runtest.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# /Coreos/acpica-tools/acpica-tools-tests/include/runtest.sh +echo "This task contains library functions for acpica-tools-tests." +echo "Please do not attempt to run this task directly. " +exit 1 + diff --git a/tests/acpica-tools-tests/misc/Makefile b/tests/acpica-tools-tests/misc/Makefile new file mode 100644 index 0000000..6d75214 --- /dev/null +++ b/tests/acpica-tools-tests/misc/Makefile @@ -0,0 +1,56 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/misc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Author, maintainer and description of the test +AUTHOR=Mike Gahagan +DESCRIPTION=sanity tests for iasl(1) to confirm it fails gracefully when given bad AML code to compile. +PACKAGE=acpica-tools + +# The name of the test. +export TEST=/CoreOS/acpica-tools/acpica-tools-tests/misc + +# Version of the test. Used with make tag. +export TESTVERSION=1.0 + + +# data files, .c files, scripts anything needed to either compile the test and/or run it. +FILES=$(METADATA) runtest.sh PURPOSE Makefile + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) $(FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ *.rpm + rm -f $(METADATA) + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: $(AUTHOR)" > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: $(DESCRIPTION)" >> $(METADATA) + @echo "TestTime: 12m" >> $(METADATA) + @echo "RunFor: $(PACKAGE)" >> $(METADATA) + @echo "Architectures: aarch64 i386 x86_64 ppc64 ppc64le" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "RhtsRequires: test(/CoreOS/acpica-tools/acpica-tools-tests/include)" >> $(METADATA) + @echo "Requires: $(PACKAGE)" >> $(METADATA) + @echo "Requires: @developer-tools" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: rpm-build" >> $(METADATA) + @echo "Requires: wget" >> $(METADATA) + rhts-lint $(METADATA) +# The include package takes care of all the dependencies +# Add any other dependencies there (/kernel/filesystems/xfs/include) diff --git a/tests/acpica-tools-tests/misc/PURPOSE b/tests/acpica-tools-tests/misc/PURPOSE new file mode 100644 index 0000000..5eeda5f --- /dev/null +++ b/tests/acpica-tools-tests/misc/PURPOSE @@ -0,0 +1,4 @@ +A set of sanity tests for iasl(1) to confirm it fails gracefully when given bad AML code to compile. + Included with the source distribution of acpica-tools + + diff --git a/tests/acpica-tools-tests/misc/runtest.sh b/tests/acpica-tools-tests/misc/runtest.sh new file mode 100755 index 0000000..e9f4acf --- /dev/null +++ b/tests/acpica-tools-tests/misc/runtest.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/acpica-tools/acpica-tools-tests/misc +# Description: sanity tests for iasl(1) to confirm it fails gracefully when given bad AML code to compile +# Author: Mike Gahagan +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +#. /usr/bin/rhts-environment.sh +#. /usr/share/beakerlib/beakerlib.sh +TESTNAME=$(basename $TEST) +. ../include/include.sh + + +PACKAGE="acpica-tools" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun mk_test_dirs + rlRun acpica-tools_prep + rlPhaseEnd + + rlPhaseStartTest + rlShowRunningKernel + pushd ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests + rlRun "./run-misc-tests.sh /usr/bin $RPM_VER > $log_dir/run-misc-tests.sh.out 2>&1" 0 "Running ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/run-misc-tests.sh...." + retval=$? + if [[ $retval -ne 0 || $DeBug -ne 0 ]] ; then + cp misc/badcode misc/badcode.asl.result misc/grammar misc/grammar.asl.result $log_dir + diff $log_dir/badcode $log_dir/badcode.asl.result > $log_dir/badcode.diff + diff $log_dir/grammar $log_dir/grammar.asl.result > $log_dir/grammar.diff + fi + popd + rlPhaseEnd + + rlPhaseStartCleanup + submit_logs + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/acpica-tools-tests/templates/Makefile b/tests/acpica-tools-tests/templates/Makefile new file mode 100644 index 0000000..b874f47 --- /dev/null +++ b/tests/acpica-tools-tests/templates/Makefile @@ -0,0 +1,56 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/templates +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Author, maintainer and description of the test +AUTHOR=Mike Gahagan +DESCRIPTION=Create, comple, then disassemble various ASL templates to confirm proper operation of iasl(1) +PACKAGE=acpica-tools + +# The name of the test. +export TEST=/CoreOS/acpica-tools/acpica-tools-tests/templates + +# Version of the test. Used with make tag. +export TESTVERSION=1.0 + + +# data files, .c files, scripts anything needed to either compile the test and/or run it. +FILES=$(METADATA) runtest.sh PURPOSE Makefile + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) $(FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ *.rpm + rm -f $(METADATA) + +# Include Common Makefile +include /usr/share/rhts/lib/rhts-make.include + +# Generate the testinfo.desc here: +$(METADATA): Makefile + @touch $(METADATA) + @echo "Owner: $(AUTHOR)" > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: $(DESCRIPTION)" >> $(METADATA) + @echo "TestTime: 12m" >> $(METADATA) + @echo "RunFor: $(PACKAGE)" >> $(METADATA) + @echo "Architectures: aarch64 i386 x86_64 ppc64 ppc64le" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "RhtsRequires: test(/CoreOS/acpica-tools/acpica-tools-tests/include)" >> $(METADATA) + @echo "Requires: $(PACKAGE)" >> $(METADATA) + @echo "Requires: @developer-tools" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: rpm-build" >> $(METADATA) + @echo "Requires: wget" >> $(METADATA) + rhts-lint $(METADATA) +# The include package takes care of all the dependencies +# Add any other dependencies there (/kernel/filesystems/xfs/include) diff --git a/tests/acpica-tools-tests/templates/PURPOSE b/tests/acpica-tools-tests/templates/PURPOSE new file mode 100644 index 0000000..243d109 --- /dev/null +++ b/tests/acpica-tools-tests/templates/PURPOSE @@ -0,0 +1,2 @@ +Create, comple, then disassemble various ASL templates to confirm proper operation of iasl(1) + diff --git a/tests/acpica-tools-tests/templates/runtest.sh b/tests/acpica-tools-tests/templates/runtest.sh new file mode 100755 index 0000000..f14bc4a --- /dev/null +++ b/tests/acpica-tools-tests/templates/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/acpica-tools/acpica-tools-tests/templates +# Description: Create, comple, then disassemble various ASL templates to confirm proper operation of iasl(1) +# Author: Mike Gahagan +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2015 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +#. /usr/bin/rhts-environment.sh +#. /usr/share/beakerlib/beakerlib.sh +TESTNAME=$(basename $TEST) +. ../include/include.sh + + +PACKAGE="acpica-tools" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun mk_test_dirs + rlRun acpica-tools_prep + rlPhaseEnd + + rlPhaseStartTest + rlShowRunningKernel + rlRun "make -C ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/templates > $log_dir/templates.out 2>&1" 0 "Running ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/templates/ test case....logging to $log_dir/templates.out" + retval=$? + if [[ $retval -ne 0 || $DeBug -ne 0 ]] ; then + echo "Creating tarball: ${log_dir}/templates_run_log.tar.xz of ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/templates" + tar -Jcf ${log_dir}/templates_run_log.tar.xz ${RPMBUILDDIR}/BUILD/acpica-unix2-${RPM_VER}/tests/templates + fi + rlPhaseEnd + + rlPhaseStartCleanup + submit_logs + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/test_acpica-tools-tests.yml b/tests/test_acpica-tools-tests.yml new file mode 100644 index 0000000..3f0996d --- /dev/null +++ b/tests/test_acpica-tools-tests.yml @@ -0,0 +1,22 @@ +--- +# Tests that run in classic, container and atomic context +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + - container + - atomic + tests: + - acpica-tools-tests/aslts + - acpica-tools-tests/misc + - acpica-tools-tests/templates + required_packages: + - acpica-tools + - rpm-build + - gcc + - wget + - bison + - flex + - patchutils + diff --git a/tests/tests.yml b/tests/tests.yml index 001580a..332d2e9 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -3,3 +3,5 @@ - import_playbook: test_grammar2.yml - import_playbook: test_converterSample.yml - import_playbook: test_dump-tables.yml +- import_playbook: test_acpica-tools-tests.yml +