summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-05-28 10:11:54 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-05-28 10:11:54 -0400
commit3058a67394a337b1a18be68b12963274b8472df3 (patch)
tree357f8334fdab4988e84f8cbb1dfac60f27dfa1ca
parent48943006048e289465edd243dddf0e9335351bdf (diff)
downloadphoronix-test-suite-upstream-3058a67394a337b1a18be68b12963274b8472df3.tar.gz
phoronix-test-suite-upstream-3058a67394a337b1a18be68b12963274b8472df3.tar.xz
phoronix-test-suite-upstream-3058a67394a337b1a18be68b12963274b8472df3.zip
Add compliance-acpi test for checking if some ACPI features are working
on the test system.
-rw-r--r--CHANGE-LOG1
-rw-r--r--pts/test-profiles/compliance-acpi.xml18
-rw-r--r--pts/test-resources/compliance-acpi/install.sh65
-rw-r--r--pts/test-resources/compliance-acpi/parse-results.php1
4 files changed, 85 insertions, 0 deletions
diff --git a/CHANGE-LOG b/CHANGE-LOG
index 2cdb16b..1b711d2 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -22,6 +22,7 @@ Phoronix Test Suite
- Update PTS External Dependencies with some profiles previously missing some packages, etc. (CentOS maintainer needs to update centos-packages.xml still)
- Rename pcqs-graphics to pcqs-desktop-graphics... pcqs-graphics is now a composite suite of both pcqs-desktop-graphics and pcqs-workstation-graphics
- Add compliance-sensors test for checking if some important LM_Sensors sensors are properly detected and working
+- Add compliance-acpi test for checking if some ACPI features are working on the test system
- Many bug fixes
Phoronix Test Suite 0.8.0
diff --git a/pts/test-profiles/compliance-acpi.xml b/pts/test-profiles/compliance-acpi.xml
new file mode 100644
index 0000000..168e299
--- /dev/null
+++ b/pts/test-profiles/compliance-acpi.xml
@@ -0,0 +1,18 @@
+<PhoronixTestSuite>
+ <TestProfile>
+ <Version>0.9.0</Version>
+ <TestType>System</TestType>
+ <SoftwareType>Benchmark</SoftwareType>
+ <License>FREE</License>
+ <Status>VERIFIED</Status>
+ <Maintainer>Michael Larabel</Maintainer>
+ <EnvironmentSize>0.01</EnvironmentSize>
+ </TestProfile>
+ <TestInformation>
+ <Title>Advanced Configuration and Power Interface</Title>
+ <SubTitle>ACPI Compliance</SubTitle>
+ <ResultScale>Brightness Control, CPU Power Management, Thermal Zones, Suspend</ResultScale>
+ <Description>This is a test checking if what ACPI (Advanced Configuration and Power Interface) features are supported by the system.</Description>
+ <ResultFormat>MULTI_PASS_FAIL</ResultFormat>
+ </TestInformation>
+</PhoronixTestSuite>
diff --git a/pts/test-resources/compliance-acpi/install.sh b/pts/test-resources/compliance-acpi/install.sh
new file mode 100644
index 0000000..ec17dda
--- /dev/null
+++ b/pts/test-resources/compliance-acpi/install.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+cat > acpi-checks << 'EOT'
+<?php
+function read_delimit($contents, $match)
+{
+ $value = "";
+ $cpuinfo_lines = explode("\n", $contents);
+
+ for($i = 0; $i < count($cpuinfo_lines) && $value == ""; $i++)
+ {
+ $line = explode(": ", $cpuinfo_lines[$i]);
+ $this_attribute = trim($line[0]);
+
+ if(count($line) > 1)
+ $this_value = trim($line[1]);
+ else
+ $this_value = "";
+
+ if($this_attribute == $match)
+ $value = $this_value;
+ }
+ return $value;
+}
+
+$acpi_results = array();
+
+$acpi_battery = "FAIL";
+foreach(glob("/proc/acpi/video/*/*/brightness") as $brightness_file)
+ if($acpi_battery == "FAIL")
+ {
+ $brightness_file_contents = file_get_contents($brightness_file);
+ if(strpos($brightness_file_contents, "levels") !== FALSE && strpos($brightness_file_contents, "current") !== FALSE)
+ $acpi_battery = "PASS";
+ }
+array_push($acpi_results, $acpi_battery);
+
+$acpi_cpupm = "FAIL";
+foreach(glob("/proc/acpi/processor/*/info") as $cpu_info_file)
+ if(read_delimit(file_get_contents($cpu_info_file), "power management") == "yes")
+ $acpi_cpupm = "PASS";
+array_push($acpi_results, $acpi_cpupm);
+
+$acpi_thermal_zone = "FAIL";
+foreach(glob("/proc/acpi/thermal_zone/*/temperature") as $temperature_file)
+ if($acpi_thermal_zone == "FAIL")
+ if(strlen(read_delimit(file_get_contents($temperature_file), "temperature")) > 1)
+ $acpi_thermal_zone = "PASS";
+array_push($acpi_results, $acpi_thermal_zone);
+
+$acpi_suspend = "FAIL";
+if(is_file("/proc/acpi/sleep") && strpos(($sleep_file = file_get_contents("/proc/acpi/sleep")), "S3") > 0 && strpos($sleep_file, "S4") > 0)
+ $acpi_suspend = "PASS";
+array_push($acpi_results, $acpi_suspend);
+
+echo implode(",", $acpi_results) . "\n";
+
+?>
+EOT
+
+cat > compliance-acpi << 'EOT'
+#!/bin/sh
+php acpi-checks
+EOT
+chmod +x compliance-acpi
diff --git a/pts/test-resources/compliance-acpi/parse-results.php b/pts/test-resources/compliance-acpi/parse-results.php
new file mode 100644
index 0000000..82509cf
--- /dev/null
+++ b/pts/test-resources/compliance-acpi/parse-results.php
@@ -0,0 +1 @@
+<?php echo trim($argv[1]); ?>