Skip to content

Commit

Permalink
Import ISHTP and ECLITE test cases and plans from iiotg provider (New) (
Browse files Browse the repository at this point in the history
#895)

* Move ISHTP and ECLITE test cases from checkbox-iiotg-provider and iiotg provider

* Put the command field for eclite/temperature-reading-from-thermal-acpitz into shell script

* Add estimated_duration for the job eclite/temperature-reading-from-thermal-acpitz
  • Loading branch information
LiaoU3 authored Jan 9, 2024
1 parent 2a4a951 commit 49d7a4e
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 0 deletions.
35 changes: 35 additions & 0 deletions providers/base/bin/monitor_acpitz_thermal.sh
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
81 changes: 81 additions & 0 deletions providers/base/units/ishtp/jobs.pxu
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions providers/base/units/ishtp/manifest.pxu
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions providers/base/units/ishtp/testplan.pxu
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 49d7a4e

Please sign in to comment.