Skip to contentSkip to conversation

ASLTS: provide proper PATH for acpibin in tests

PATCH New Al Stone 1 participant 1 message Sep 27, 2017 ACPI component architecture (acpica)

lore
Share & tools
lore

Al Stone

author
#0 lore raw

PATCH 1/1 ASLTS: provide proper PATH for acpibin in tests

Recent versions of ASLTS now use the acpibin utility, much like they use acpiexec. However, when use of acpibin was added, it was not treated like acpiexec and was assumed to exist in whatever PATH a user had set when running the tests. When trying to use ASLTS in a very pristine environment (i.e., no previous version of ACPICA user space tools is available), portions of the test suite will produce false failures because acpibin cannot be found and run.

This patch fixes ASLTS so that the use of acpibin is treated exactly the same as acpiexec -- an environment variable must be defined (in this case, $acpibin) with the location of the executable, aslts.sh makes sure a value for the variable is set, Do uses $acpibin (instead of assuming acpibin exists in a user's PATH), and the various bits of documentation are updated to note the new environment variable.

Signed-off-by Al Stone <ahs3(a)redhat.com>
---
 tests/aslts.sh             | 10 ++++++++--
 tests/aslts/HOW_TO_INSTALL |  6 +++++-
 tests/aslts/HOW_TO_USE     |  4 ++++
 tests/aslts/bin/Do         | 11 +++++++++--
 4 files changed, 26 insertions(+), 5 deletions(-)
tests/aslts.sh +8 -2
index 8df422fbc..d8b364be4 100755
@@ -7,6 +7,7 @@
 postfix=`date +%H%M%S`
 tmp_iasl=/tmp/iasl-$postfix
 tmp_acpiexec=/tmp/acpiexec-$postfix
+tmp_acpibin=/tmp/acpibin-$postfix
 
 TEST_CASES=
 TEST_MODES=
@@ -65,6 +66,7 @@ setup_environment() {
 
 	export ASL=$tmp_iasl
 	export acpiexec=$tmp_acpiexec		
+	export acpibin=$tmp_acpibin
 	export ASLTSDIR=$aslts_dir
 	export PATH=$ASLTSDIR/bin:$PATH
 }
@@ -75,7 +77,7 @@ build_acpi_tools() {
 
 	restore_dir=$PWD
 	cd ${generation_dir}
-	rm -f $tmp_iasl $tmp_acpiexec
+	rm -f $tmp_iasl $tmp_acpiexec $tmp_acpibin
 
 	# Build native-width iASL compiler and acpiexec
 	if [ ! -e bin/iasl -o ! -e bin/acpiexec ]; then
@@ -91,6 +93,7 @@ build_acpi_tools() {
 		echo "Installing ACPICA tools"
 		cp bin/iasl $tmp_iasl
 		cp bin/acpiexec $tmp_acpiexec
+		cp bin/acpibin $tmp_acpibin
 	else
 		echo "Could not find iASL/acpiexec tools"
 		exit
@@ -103,6 +106,9 @@ build_acpi_tools() {
 	elif [ ! -f $tmp_acpiexec ] ; then
 		echo "acpiexec utility not found"
 		exit
+	elif [ ! -f $tmp_acpibin ] ; then
+		echo "acpibin utility not found"
+		exit
 	fi
 
 	cd $restore_dir
@@ -140,7 +146,7 @@ run_aslts() {
 		echo "ASL Test Suite Finished: `date`"
 		echo "                Started: $start_time"
 
-		rm -f $tmp_iasl $tmp_acpiexec
+		rm -f $tmp_iasl $tmp_acpiexec $tmp_acpibin
 	fi;
 }
 
tests/aslts/HOW_TO_INSTALL +5 -1
index 44648e2fe..300a86310 100644
@@ -49,12 +49,16 @@ ENVIRONMENT
             > export ASL="c:/acpica/libraries/iasl.exe"
 
 
-   For test execution, two additional variables are required:
+   For test execution, three additional variables are required:
 
         acpiexec - path to acpiexec utility: (example)
 
             > export acpiexec="c:/acpica/libraries/acpiexec.exe"
 
+        acpibin - path to acpibin utility: (example)
+
+            > export acpibin="c:/acpica/libraries/acpibin.exe"
+
         ASLTSDIR - path to the aslts directory: (example)
 
             > export ASLTSDIR="c:/acpica/tests/aslts"
tests/aslts/HOW_TO_USE +4 -0
index 233fdbb03..d60945802 100644
@@ -32,6 +32,10 @@ How to execute the run-time tests
 
             > export acpiexec="c:/acpica/libraries/acpiexec.exe"
 
+        acpibin - path to acpibin utility: (example)
+
+            > export acpibin="c:/acpica/libraries/acpibin.exe"
+
         ASLTSDIR - path to the aslts directory: (example)
 
             > export ASLTSDIR="c:/acpica/tests/aslts"
tests/aslts/bin/Do +2 -1
index d034072d4..f4742eda1 100755
@@ -20,12 +20,13 @@
 #
 #     ASL      - iASL compiler
 #     acpiexec - AcpiExec utility
+#     acpibin  - AcpiBin utility
 #     ASLTSDIR - pathname of root directory of aslts test suite
 #
 # External definitions required for particular command:
 #
 #     0 - ASLTSDIR, ASL
-#     1 - ASLTSDIR, acpiexec
+#     1 - ASLTSDIR, acpiexec, acpibin
 #     2 - ASLTSDIR
 #     3 - none
 #     4 - ASLTSDIR
@@ -346,7 +347,7 @@ binary_compare()
                 if [ ! -f "$normal_compile_dir/$filename" ]; then
 			echo "  binary compare $mode the following file does not exist:

$normal_compile_dir/$filename"
else
- acpibin -a "$f" "$normal_compile_dir/$filename" > /dev/null
+ $acpibin -a "$f" "$normal_compile_dir/$filename" > /dev/null
if [ $? -ne 0 ]; then
echo " [[ Error: $mode Binary compare for $filename failed ]]"
else
@@ -809,6 +810,12 @@ elif [ $CMD == $RUNTESTS ]; then
do_exit 1 "Undefined acpiexec variable! Set it to pathname of AcpiExec utility."
fi

+ # Check access to AcpiBin utility
+
+ if [ ! -f "$acpibin" ]; then
+ do_exit 1 "Undefined acpibin variable! Set it to pathname of AcpiBin utility."
+ fi
+
shift 1
ASLTSRUN_PARAMS=

Signature · 1 line
2.13.5