diff --git a/providers/base/bin/monitor_acpitz_thermal.sh b/providers/base/bin/monitor_acpitz_thermal.sh new file mode 100755 index 000000000..9c02f9eb9 --- /dev/null +++ b/providers/base/bin/monitor_acpitz_thermal.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +THERMAL_PATH="/sys/class/thermal/thermal_zone" +THERMALS=$(find $THERMAL_PATH*[0-9]) +ACPITZ_THERMAL_PATH="" +# Get the acpitz thermal +for t in $THERMALS; do + THERMAL_TYPE=$(cat "$t/type") + if [ "$THERMAL_TYPE" = "acpitz" ]; then + ACPITZ_THERMAL_PATH=$t + break + fi +done +# Check acpitz thermal can be found +if [ -z "$ACPITZ_THERMAL_PATH" ]; then + echo "Cannot find the acpitz thermal" + exit 1 +fi +echo "The path of acpitz thermal: $ACPITZ_THERMAL_PATH" +# Do testing and monitor the temperature +ACPITZ_TEMP="$ACPITZ_THERMAL_PATH/temp" +TEMP_BEFORE=$(cat "$ACPITZ_TEMP") +echo "Temperature before stress: $TEMP_BEFORE" +if ! [ "$TEMP_BEFORE" -gt 0 ]; then + echo "Invalid temperature, it should be more than 0" + exit 1 +fi +echo "Running stress for 5 minutes" +stress-ng --matrix 0 -t 5m +TEMP_AFTER=$(cat "$ACPITZ_TEMP") +echo "Temperature after stress: $TEMP_AFTER" +if ! [ "$TEMP_AFTER" -gt "$TEMP_BEFORE" ]; then + echo "The temperature after stress testing should be higher than before" + exit 1 +fi \ No newline at end of file diff --git a/providers/iiotg/units/ishtp/category.pxu b/providers/base/units/ishtp/category.pxu similarity index 100% rename from providers/iiotg/units/ishtp/category.pxu rename to providers/base/units/ishtp/category.pxu diff --git a/providers/base/units/ishtp/jobs.pxu b/providers/base/units/ishtp/jobs.pxu new file mode 100644 index 000000000..beb8df161 --- /dev/null +++ b/providers/base/units/ishtp/jobs.pxu @@ -0,0 +1,81 @@ +unit: job +category_id: intel-ishtp +id: ishtp/module-detect +plugin: shell +_summary: Verifies that the intel_ish_ipc module for ISHTP is loaded +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_ishtp == 'True' +flags: simple +command: + expected_modules='intel_ishtp_loader intel_ishtp_hid intel_ish_ipc intel_ishtp' + EXIT=0 + for m in $expected_modules + do + echo "Checking module: $m" + if ! lsmod | grep -qw "$m"; then + echo "FAIL: The '$m' module is not loaded!" + EXIT=1 + else + echo "PASS: It's loaded" + fi + echo + done + exit $EXIT + +unit: job +category_id: intel-ishtp +id: ishtp/device-detect +plugin: shell +_summary: Verify that at least 1 device entry exists in /sys/bus/ishtp/devices +depends: ishtp/module-detect +command: + DIR="/sys/bus/ishtp/devices/" + if ! [ -d "$DIR" ]; then + echo "ishtp devices directory does not exist!" + exit 1 + fi + if ! [ "$(ls -A $DIR)" ]; then + # empty, fail + echo "ishtp devices directory empty - no devices found!" + exit 1 + fi + echo "found ishtp devices" + exit 0 + +unit: job +category_id: intel-ishtp +id: eclite/module-detect +plugin: shell +_summary: Verifies that the ishtp_eclite module is loaded +flags: simple +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_eclite == 'True' +command: + if lsmod | grep -w ishtp_eclite; then + echo "ishtp_eclite module loaded" + else + echo "The 'ishtp_eclite' module isn't loaded!" + echo "Please make sure this feature is supported on this platform and check the BIOS setting." + exit 1 + fi + +unit: job +category_id: intel-ishtp +id: eclite/temperature-reading-from-thermal-acpitz +estimated_duration: 5m +_summary: Read the temperature of acpitz to make sure Eclite is functional +depends: eclite/module-detect +_description: + For testing the feature of Eclite, one way is to monitor the + temperature of acpitz thermal. + Read the CPU temperature, run stress-ng for 5 minutes, then check the CPU + temperature again. + The temperatures should be non-zero, and the temperature after the stress + test should be higher. + If any of these conditions is not true, the test fails. +plugin: shell +user: root +command: + monitor_acpitz_thermal.sh diff --git a/providers/base/units/ishtp/manifest.pxu b/providers/base/units/ishtp/manifest.pxu new file mode 100644 index 000000000..74778b1e3 --- /dev/null +++ b/providers/base/units/ishtp/manifest.pxu @@ -0,0 +1,9 @@ +unit: manifest entry +id: has_ishtp +_name: Has support for Intel Integrated Sensor Hub Tranport Protocol (ISHTP) +value-type: bool + +unit: manifest entry +id: has_eclite +_name: Has support for Intel ISHTP eclite controller Driver (ECLITE) +value-type: bool diff --git a/providers/base/units/ishtp/testplan.pxu b/providers/base/units/ishtp/testplan.pxu new file mode 100644 index 000000000..ebedc845d --- /dev/null +++ b/providers/base/units/ishtp/testplan.pxu @@ -0,0 +1,26 @@ +id: ishtp-full +_name: Intel Integrated Sensor Hub Transport Protocol (ISHTP) tests (Full) +unit: test plan +include: +nested_part: + ishtp-manual + ishtp-automated + +id: ishtp-manual +_name: Intel Integrated Sensor Hub Transport Protocol (ISHTP) tests (Manual) +unit: test plan +include: +nested_part: + +id: ishtp-automated +_name: Intel Integrated Sensor Hub Transport Protocol (ISHTP) tests (Automated) +unit: test plan +include: + ishtp/module-detect + ishtp/device-detect + eclite/module-detect + eclite/temperature-reading-from-thermal-acpitz +nested_part: +bootstrap_include: + device + module