Merge #2 Add acpica-tools internal tests
This commit is contained in:
commit
7c71f4c5a5
56
tests/acpica-tools-tests/aslts/Makefile
Normal file
56
tests/acpica-tools-tests/aslts/Makefile
Normal file
@ -0,0 +1,56 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/aslts
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Author, maintainer and description of the test
|
||||
AUTHOR=Mike Gahagan <mgahagan@redhat.com>
|
||||
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)
|
36
tests/acpica-tools-tests/aslts/PURPOSE
Normal file
36
tests/acpica-tools-tests/aslts/PURPOSE
Normal file
@ -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).
|
||||
|
||||
|
61
tests/acpica-tools-tests/aslts/runtest.sh
Executable file
61
tests/acpica-tools-tests/aslts/runtest.sh
Executable file
@ -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 <mgahagan@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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
|
64
tests/acpica-tools-tests/include/Makefile
Normal file
64
tests/acpica-tools-tests/include/Makefile
Normal file
@ -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 <mgahagan@redhat.com>
|
||||
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)
|
8
tests/acpica-tools-tests/include/PURPOSE
Normal file
8
tests/acpica-tools-tests/include/PURPOSE
Normal file
@ -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
|
||||
-
|
112
tests/acpica-tools-tests/include/include.sh
Normal file
112
tests/acpica-tools-tests/include/include.sh
Normal file
@ -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
|
||||
}
|
||||
|
6
tests/acpica-tools-tests/include/runtest.sh
Normal file
6
tests/acpica-tools-tests/include/runtest.sh
Normal file
@ -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
|
||||
|
56
tests/acpica-tools-tests/misc/Makefile
Normal file
56
tests/acpica-tools-tests/misc/Makefile
Normal file
@ -0,0 +1,56 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/misc
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Author, maintainer and description of the test
|
||||
AUTHOR=Mike Gahagan <mgahagan@redhat.com>
|
||||
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)
|
4
tests/acpica-tools-tests/misc/PURPOSE
Normal file
4
tests/acpica-tools-tests/misc/PURPOSE
Normal file
@ -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
|
||||
|
||||
|
62
tests/acpica-tools-tests/misc/runtest.sh
Executable file
62
tests/acpica-tools-tests/misc/runtest.sh
Executable file
@ -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 <mgahagan@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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
|
56
tests/acpica-tools-tests/templates/Makefile
Normal file
56
tests/acpica-tools-tests/templates/Makefile
Normal file
@ -0,0 +1,56 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/acpica-tools/acpica-tools-tests/templates
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Author, maintainer and description of the test
|
||||
AUTHOR=Mike Gahagan <mgahagan@redhat.com>
|
||||
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)
|
2
tests/acpica-tools-tests/templates/PURPOSE
Normal file
2
tests/acpica-tools-tests/templates/PURPOSE
Normal file
@ -0,0 +1,2 @@
|
||||
Create, comple, then disassemble various ASL templates to confirm proper operation of iasl(1)
|
||||
|
59
tests/acpica-tools-tests/templates/runtest.sh
Executable file
59
tests/acpica-tools-tests/templates/runtest.sh
Executable file
@ -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 <mgahagan@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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
|
22
tests/test_acpica-tools-tests.yml
Normal file
22
tests/test_acpica-tools-tests.yml
Normal file
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user