Skip to content

Commit

Permalink
Add QEP test cases and plans from iiotg provider (New) (#901)
Browse files Browse the repository at this point in the history
* Add QEP test cases and plans from checkbox-iiotg-providers and iiotg provider

* Apply suggestions from code review

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>

* Add qep testplan

---------

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>
  • Loading branch information
LiaoU3 and pieqq authored Jan 10, 2024
1 parent cfd8002 commit 36d08c9
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 13 deletions.
3 changes: 3 additions & 0 deletions providers/base/units/qep/category.pxu
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
unit: category
id: qep
_name: Quadrature Encoder Peripherals
58 changes: 58 additions & 0 deletions providers/base/units/qep/jobs.pxu
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
unit: job
category_id: qep
id: qep/qep-devices
plugin: resource
_summary: test QEP
_description: Generates the 4 QEP devices to be used in the template test jobs
command:
DEVICES="4bc3 4b81 4b82 4b83"
for d in $DEVICES; do
echo "qep-device: $d"
echo
done

unit: template
template-resource: qep/qep-devices
template-unit: job
id: qep/qep-device-driver-for-{qep-device}
category_id: qep
_summary: Verify PCI Device {qep-device} is using the correct driver
_description:
Checks that the device exists in lspci and that the device driver associated is correct.
Device ID should be 8086:{qep-device} and the driver is always intel_qep.
imports: from com.canonical.plainbox import manifest
requires:
manifest.has_qep == 'True'
plugin: shell
command:
echo "Verifying: 8086:{qep-device} is using intel_qep driver"
lspci -nnkd 8086:{qep-device} | grep intel_qep

unit: template
template-resource: qep/qep-devices
template-unit: job
id: qep/qep-device-node-for-{qep-device}
category_id: qep
_summary: Verify device directory exists for {qep-device}
_description:
Detects if the device's directory exists.
First needs to find the PCI ID from lspci
Then tests if the PCI device directory exists.
The PCI ID is always ##:##.# (e.g. 18:00.2)
The PCI device directory is always in the format of 0000:$PCI_ID
imports: from com.canonical.plainbox import manifest
requires:
manifest.has_qep == 'True'
plugin: shell
command:
echo "Test for: "{qep-device}
echo "Find PCI ID for "{qep-device}
PCI=$(lspci -nd 8086:{qep-device} | cut -c 1-7)
echo "PCI ID is: $PCI"
if [ -d "/sys/bus/pci/devices/0000:$PCI" ]
then
echo "path /sys/bus/pci/devices/0000:$PCI exists"
else
echo "path /sys/bus/pci/devices/0000:$PCI does not exist"
exit 1
fi
File renamed without changes.
25 changes: 25 additions & 0 deletions providers/base/units/qep/test-plan.pxu
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
id: qep-full
_name: Quadrature Encoder Peripheral (QEP) tests
unit: test plan
include:
bootstrap_include:
qep/qep-devices
nested_part:
qep-manual
qep-automated

id: qep-manual
_name: Quadrature Encoder Peripheral (QEP) test (manual)
unit: test plan
bootstrap_include:
qep/qep-devices
include:

id: qep-automated
_name: Quadrature Encoder Peripheral (QEP) test (automated)
unit: test plan
bootstrap_include:
qep/qep-devices
include:
qep/qep-device-driver-for-.*
qep/qep-device-node-for-.*
3 changes: 0 additions & 3 deletions providers/iiotg/units/qep/category.pxu

This file was deleted.

10 changes: 0 additions & 10 deletions providers/iiotg/units/qep/jobs.pxu

This file was deleted.

0 comments on commit 36d08c9

Please sign in to comment.