From 5d9d9dc800f88d1632f69aaf633faf4ac5c0cdb1 Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Thu, 19 Sep 2019 15:20:24 +0200 Subject: modify edid-cycle test to use PIG --- bin/edid_cycle.py | 9 ++++++--- units/pig/jobs.pxu | 8 ++++++++ units/pig/resource.pxu | 5 +++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 units/pig/jobs.pxu create mode 100644 units/pig/resource.pxu diff --git a/bin/edid_cycle.py b/bin/edid_cycle.py index 7e3c97e..a6daf1c 100755 --- a/bin/edid_cycle.py +++ b/bin/edid_cycle.py @@ -10,6 +10,7 @@ https://docs.google.com/document/d/1kjgaazt2IMskn_HPjN7adXYx1O5zXc39DRayZ0PYh9Y The command-line argument for the program is the address of the RaspberryPi Host (optionally with a username), e.g.: pi@192.168.1.100 """ +import os import re import subprocess import sys @@ -27,8 +28,8 @@ def check_resolution(): def change_edid(host, edid_file): with open(edid_file, 'rb') as f: - cmd = ['ssh', host, 'v4l2-ctl', '--set-edid=file=-,format=raw', - '--fix-edid-checksums'] + cmd = ['ssh', host, '/snap/bin/pigbox', 'run', + '\'v4l2-ctl --set-edid=file=-,format=raw --fix-edid-checksums\''] subprocess.check_output(cmd, input=f.read()) @@ -38,7 +39,9 @@ def main(): failed = False for res in ['2560x1440', '1920x1080', '1280x1024']: print('changing EDID to {}'.format(res)) - change_edid(sys.argv[1], '{}.edid'.format(res)) + edid_file = os.path.expandvars(os.path.join( + '$PLAINBOX_PROVIDER_DATA', 'edids', '{}.edid'.format(res))) + change_edid(sys.argv[1], edid_file) time.sleep(1) print('checking resolution... ', end='') actual_res = check_resolution() diff --git a/units/pig/jobs.pxu b/units/pig/jobs.pxu new file mode 100644 index 0000000..2bbcaa6 --- /dev/null +++ b/units/pig/jobs.pxu @@ -0,0 +1,8 @@ +id: monitor/pig-edid +category_id: com.canonical.plainbox::monitor +plugin: shell +estimated_duration: 60 +_summary: Check if the system automatically changes the resolution based on EDID +requires: pig.hdmi_bridge == 'installed' +environ: PIG_HOST +command: edid_cycle.py $PIG_HOST diff --git a/units/pig/resource.pxu b/units/pig/resource.pxu new file mode 100644 index 0000000..eb62e22 --- /dev/null +++ b/units/pig/resource.pxu @@ -0,0 +1,5 @@ +id: pig +plugin: resource +_summary: Get Pig's capabilities +environ: PIG_HOST +command: ssh -q -o 'StrictHostKeyChecking=no' $PIG_HOST /snap/bin/pigbox capabilities -- cgit v1.2.3 From e204f8cf4e635ad973bd6a8ba77e594aeae9010c Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Tue, 24 Sep 2019 11:42:38 +0200 Subject: add pig-enabled test plan --- units/pig/test-plan.pxu | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 units/pig/test-plan.pxu diff --git a/units/pig/test-plan.pxu b/units/pig/test-plan.pxu new file mode 100644 index 0000000..071a927 --- /dev/null +++ b/units/pig/test-plan.pxu @@ -0,0 +1,16 @@ +id: pig-enabled-full +unit: test plan +_name: Tests using Pi Testing Rig +_description: Tests using Pi Testing Rig +include: +nested_part: + pig-enabled-automated + +id: pig-enabled-automated +unit: test plan +_name: Tests using Pi Testing Rig (Automated) +_description: Tests using Pi Testing Rig (Automated) +include: + monitor/pig-edid +bootstrap_include: + pig -- cgit v1.2.3 From b187caa7e59999e9f949ecb2f0312939e8094d26 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Thu, 26 Sep 2019 20:35:12 +0200 Subject: submission: Expose the full set of DMI devices in raw-devices-dmi attachment Fixes: lp:1839667 --- units/submission/jobs.pxu | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/units/submission/jobs.pxu b/units/submission/jobs.pxu index a2f5382..b433fd3 100644 --- a/units/submission/jobs.pxu +++ b/units/submission/jobs.pxu @@ -22,10 +22,8 @@ requires: dmi_present.state == 'supported' user: root command: - dmidecode -t bios -t system | python3 -m plainbox dev parse dmidecode | \ - jq '[.[0]._attributes + - {"category": .[0].category}, .[1]._attributes + - {"category": .[1].category}]' + dmidecode | python3 -m plainbox dev parse dmidecode | \ + jq '[.[] | ._attributes + {"category": .category}]' estimated_duration: 1 _description: Attaches dmidecode output _summary: Attaches json dumps of udev_resource raw dmi devices -- cgit v1.2.3