Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ISHTP and ECLITE test cases and plans from iiotg provider and checkbox-iiotg-provder (New) #895

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions providers/base/units/ishtp/jobs.pxu
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
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
LiaoU3 marked this conversation as resolved.
Show resolved Hide resolved
_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:
pieqq marked this conversation as resolved.
Show resolved Hide resolved
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
pieqq marked this conversation as resolved.
Show resolved Hide resolved
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
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
Loading