forked from cki-project/tests-beaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright (c) 2019 Red Hat, Inc. All rights reserved. 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 v.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: Al Stone <[email protected]> | ||
|
||
TOPLEVEL_NAMESPACE=kernel | ||
PACKAGE_NAME=acpi/acpitable | ||
|
||
export TESTVERSION=1.0 | ||
export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME) | ||
|
||
BUILT_FILES= | ||
FILES=$(METADATA) runtest.sh Makefile PURPOSE | ||
|
||
.PHONY: all install download clean | ||
|
||
run: $(FILES) build | ||
./runtest.sh | ||
|
||
build: $(BUILT_FILES) | ||
chmod a+x runtest.sh | ||
|
||
clean: | ||
rm -f *~ $(BUILT_FILES) | ||
|
||
# Include Common Makefile | ||
include /usr/share/rhts/lib/rhts-make.include | ||
|
||
# Generate the testinfo.desc here: | ||
$(METADATA): Makefile | ||
@touch $(METADATA) | ||
@echo "Owner: Al Stone <[email protected]>" > $(METADATA) | ||
@echo "Name: $(TEST)" >> $(METADATA) | ||
@echo "Path: $(TEST_DIR)" >> $(METADATA) | ||
@echo "Description: ACPI table Test Utility" >> $(METADATA) | ||
@echo "TestTime: 15m" >> $(METADATA) | ||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA) | ||
@echo "RunFor: $(TOPLEVEL_NAMESPACE)" >> $(METADATA) | ||
@echo "Priority: Normal" >> $(METADATA) | ||
@echo "License: GPLv2" >> $(METADATA) | ||
@echo "Confidential: no" >> $(METADATA) | ||
@echo "Destructive: no" >> $(METADATA) | ||
@echo "Requires: acpica-tools" >> $(METADATA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Verify ACPI Table is present in sysfs. | ||
acpidump will try to read files from /sys/firmware/acpi/tables, and capture a copy of the tables. | ||
The test will PASS when ACPI table is readable and can be captured. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ACPI table test suite | ||
Testing ACPI table is present in sysfs. \ | ||
Test Maintainer: [Al Stone](mailto:[email protected]) | ||
|
||
## How to run it | ||
Please refer to the top-level README.md for common dependencies. Test-specific dependencies will automatically be installed when executing 'make run'. For a complete detail, see PURPOSE file. | ||
|
||
### Execute the test | ||
```bash | ||
$ make run | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
#-------------------------------------------------------------------------------- | ||
# Copyright (c) 2019 Red Hat, Inc. All rights reserved. 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 v.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: Al Stone <[email protected]> | ||
#--------------------------------------------------------------------------------- | ||
# | ||
# Simple test: are ACPI tables present? | ||
# | ||
# There's no foolproof method to know, but we can check to see | ||
# if acpidump can read files from /sys/firmware/acpi/tables. An | ||
# added bonus is that we capture a copy of the tables, too. | ||
#--------------------------------------------------------------------------------- | ||
|
||
# Source the common test script helpers | ||
. /usr/bin/rhts-environment.sh || exit 1 | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
# Global variables | ||
ret=0 | ||
|
||
# make sure acpica-tools are installed | ||
pkg=$(rpm -qa | grep acpica-tools) | ||
if [ -z "$pkg" ] ; then | ||
report_result $TEST WARN | ||
rhts-abort -t recipe | ||
fi | ||
|
||
# verify ACPI is enabled in the kernel | ||
msg=$(journalctl -b 0 -o short-monotonic | grep "ACPI: Interpreter enabled") | ||
|
||
# no message found, so fail | ||
if [ -z "$msg" ] ; then | ||
ret=1 | ||
echo "ACPI: Intepreter disabled in the kernel!" | tee -a $OUTPUTFILE | ||
fi | ||
|
||
if [ $ret = 0 ] ; then | ||
# try to read ACPI tables from sysfs | ||
# run acpidump, which should succeed and write tables to stdout | ||
# (requires being run as root) | ||
mkdir -p /mnt/redhat/user/acpi/ | ||
acpidump > /mnt/redhat/user/acpi/acpitable.log 2>&1 | ||
ret=$? | ||
rhts_submit_log -l /mnt/redhat/user/acpi/acpitable.log | ||
fi | ||
|
||
echo "Test finished" | tee -a $OUTPUTFILE | ||
|
||
if [ $ret != 0 ] ; then | ||
report_result $TEST FAIL $ret | ||
else | ||
# all is well | ||
report_result $TEST PASS 0 | ||
fi |