Merge ~sylvain-pineau/plainbox-provider-checkbox:bye-chameleon into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 8aa7d7f62f3005865df85b3767860d4cae6820b3
Merged at revision: 6a157f7a7ec302fb4cb4cc186ecb74c263f5a571
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:bye-chameleon
Merge into: plainbox-provider-checkbox:master
Diff against target: 276 lines (+0/-112)
3 files modified
dev/null (+0/-74)
units/monitor/jobs.pxu (+0/-21)
units/monitor/test-plan.pxu (+0/-17)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+388041@code.launchpad.net

Description of the change

Final cleanup of all chameleon jobs & scripts.

Nota: data/chameleon_edids was removed by:

$ git filter-repo --path data/chameleon_edids/ --invert-paths

and pushed to master.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/chameleon_edid_stress.py b/bin/chameleon_edid_stress.py
2deleted file mode 100755
3index 8cc007d..0000000
4--- a/bin/chameleon_edid_stress.py
5+++ /dev/null
6@@ -1,115 +0,0 @@
7-#!/usr/bin/env python3
8-
9-import glob
10-import os
11-import subprocess as sp
12-import sys
13-import time
14-
15-import xmlrpc.client
16-
17-
18-def Chameleon(host, port=9992):
19- """
20- Get a proxy object that is used to control the Chameleon board.
21-
22- The interface definition for this object can be found at:
23- https://chromium.googlesource.com/chromiumos/platform/chameleon/+/refs/heads/master/chameleond/interface.py
24- """
25- print('== Chameleon connection ==')
26- print('Target device: {}:{}'.format(host, port))
27- proxy = xmlrpc.client.ServerProxy('http://{}:{}'.format(host, port))
28- try:
29- # test the proxy works
30- mac = proxy.GetMacAddress()
31- print('MAC address: {}'.format(mac))
32- except OSError as e:
33- print(e)
34- raise SystemExit('ERROR connecting to Chameleon board')
35- print()
36- return proxy
37-
38-
39-def get_hdmi_port(chameleon):
40- supported_ports = chameleon.GetSupportedPorts()
41- for port in supported_ports:
42- port_type = chameleon.GetConnectorType(port)
43- if port_type == 'HDMI':
44- return port
45-
46-
47-def get_hdmi_status(drm_id):
48- path = '/sys/class/drm/{}/status'.format(drm_id)
49- with open(path) as sys_f:
50- return sys_f.readline().strip()
51-
52-
53-def get_hdmi_edid(drm_id):
54- path = '/sys/class/drm/{}/edid'.format(drm_id)
55- output = sp.run(['edid-decode', path], check=False, stdout=sp.PIPE).stdout
56- for line in output.decode(sys.stdout.encoding).splitlines():
57- if 'Manufacturer:' in line:
58- return line.strip()
59-
60-
61-def edid_from_file(filename):
62- with open(filename, 'r') as file:
63- if filename.upper().endswith('.TXT'):
64- # Convert the EDID text format returned from xrandr.
65- hex = file.read().replace('\n', '')
66- data = bytes.fromhex(hex)
67- else:
68- data = open(filename).read()
69- return data
70-
71-
72-if __name__ == '__main__':
73- if len(sys.argv) != 3:
74- raise SystemExit('ERROR: please specify drm card and chameleon IP')
75-
76- drm_id = sys.argv[1]
77- c = Chameleon(sys.argv[2])
78-
79- edid_dir = os.path.expandvars(
80- '$PLAINBOX_PROVIDER_DATA/chameleon_edids/daily')
81- print('Loading EDIDs from {}'.format(edid_dir))
82- edids = glob.glob(edid_dir + os.path.sep + '[A-Z][A-Z][A-Z]_*.txt')
83-
84- port_num = get_hdmi_port(c)
85- c.Unplug(port_num)
86-
87- fails = []
88- for edid in edids:
89- edid_base = os.path.basename(edid)
90- print('=={}=='.format(edid_base))
91- print('Send EDID to Chameleon')
92- edid_id = c.CreateEdid(edid_from_file(edid))
93- c.ApplyEdid(port_num, edid_id)
94- print('Plug HDMI')
95- c.Plug(port_num)
96- time.sleep(2)
97-
98- # TODO: make this an actual test
99- if get_hdmi_status(drm_id) == 'connected':
100- manufacturer_str = get_hdmi_edid(drm_id)
101- print(manufacturer_str)
102- if edid_base[:3] not in manufacturer_str:
103- print('Manufacturer {} not found')
104- fails.append(edid_base)
105- else:
106- print('HDMI not connected')
107- fails.append(edid_base)
108-
109- print('Unplug HDMI')
110- c.Unplug(port_num)
111- time.sleep(2)
112- print('Free EDID data')
113- c.DestroyEdid(edid_id)
114- print('====\n', flush=True)
115-
116- if fails:
117- print("Failed EDIDs:")
118- for f in fails:
119- print(f)
120- raise SystemExit("Total {}/{}".format(len(fails), len(edids)))
121- print('PASS')
122diff --git a/bin/chameleon_hdmi_hotplug.py b/bin/chameleon_hdmi_hotplug.py
123deleted file mode 100755
124index 7366886..0000000
125--- a/bin/chameleon_hdmi_hotplug.py
126+++ /dev/null
127@@ -1,74 +0,0 @@
128-#!/usr/bin/env python3
129-
130-import sys
131-import time
132-
133-import xmlrpc.client
134-
135-
136-def Chameleon(host, port=9992):
137- """
138- Get a proxy object that is used to control the Chameleon board.
139-
140- The interface definition for this object can be found at:
141- https://chromium.googlesource.com/chromiumos/platform/chameleon/+/refs/heads/master/chameleond/interface.py
142- """
143- print('== Chameleon connection ==')
144- print('Target device: {}:{}'.format(host, port))
145- proxy = xmlrpc.client.ServerProxy('http://{}:{}'.format(host, port))
146- try:
147- # test the proxy works
148- mac = proxy.GetMacAddress()
149- print('MAC address: {}'.format(mac))
150- except OSError as e:
151- print(e)
152- raise SystemExit('ERROR connecting to Chameleon board')
153- print()
154- return proxy
155-
156-
157-def get_hdmi_port(chameleon):
158- supported_ports = chameleon.GetSupportedPorts()
159- for port in supported_ports:
160- port_type = chameleon.GetConnectorType(port)
161- if port_type == 'HDMI':
162- return port
163-
164-
165-def get_hdmi_status(drm_id):
166- path = '/sys/class/drm/{}/status'.format(drm_id)
167- with open(path) as sys_f:
168- return sys_f.readline().strip()
169-
170-
171-if __name__ == '__main__':
172- drm_id = sys.argv[1]
173- c = Chameleon(sys.argv[2])
174-
175- start = get_hdmi_status(drm_id)
176- print('Starting status: {}'.format(start))
177- print(flush=True)
178-
179- port_num = get_hdmi_port(c)
180-
181- print('chameleon> plug hdmi')
182- c.Plug(port_num)
183- time.sleep(10)
184-
185- new_status = get_hdmi_status(drm_id)
186- print('Status after plug request: {}'.format(new_status))
187- print(flush=True)
188- if new_status != 'connected':
189- raise SystemExit('FAIL: hdmi not connected')
190-
191- print('chameleon> unplug hdmi')
192- c.Unplug(port_num)
193- time.sleep(10)
194-
195- final_status = get_hdmi_status(drm_id)
196- print('Status after unplug request: {}'.format(final_status))
197- print(flush=True)
198- if final_status != 'disconnected':
199- raise SystemExit('FAIL: hdmi did not disconnect')
200-
201- print('PASS')
202diff --git a/units/monitor/jobs.pxu b/units/monitor/jobs.pxu
203index 0ec67d3..4a6ae9a 100644
204--- a/units/monitor/jobs.pxu
205+++ b/units/monitor/jobs.pxu
206@@ -395,24 +395,3 @@ _steps:
207 _verification:
208 Was the interface displayed correctly on the screen?
209 flags: also-after-suspend
210-
211-id: monitor/hdmi-hotplug-automated
212-flags: also-after-suspend
213-estimated_duration: 15.0
214-plugin: shell
215-category_id: com.canonical.plainbox::monitor
216-_summary: Automated HDMI hotplug test
217-_description:
218- Use chamleon board to simulate connection/disconnection of an HDMI monitor.
219-environ: HDMI_PORT CHAMELEON_IP
220-command:
221- chameleon_hdmi_hotplug.py "$HDMI_PORT" "$CHAMELEON_IP"
222-
223-id: monitor/edid-stress-automated
224-estimated_duration: 30m
225-plugin: shell
226-category_id: com.canonical.plainbox::monitor
227-_summary: Stress DUT by switching through large EDID set
228-environ: HDMI_PORT CHAMELEON_IP
229-command:
230- chameleon_edid_stress.py "$HDMI_PORT" "$CHAMELEON_IP"
231diff --git a/units/monitor/test-plan.pxu b/units/monitor/test-plan.pxu
232index fd4c507..b893acb 100644
233--- a/units/monitor/test-plan.pxu
234+++ b/units/monitor/test-plan.pxu
235@@ -262,7 +262,6 @@ _description: QA monitor tests for Snappy Ubuntu Core devices
236 include:
237 nested_part:
238 monitor-manual
239- monitor-automated
240
241 id: monitor-manual
242 unit: test plan
243@@ -275,14 +274,6 @@ include:
244 monitor/hdmi-to-vga
245 monitor/displayport_hotplug
246
247-id: monitor-automated
248-unit: test plan
249-_name: Automated monitor tests
250-_description: Automated monitor tests for Snappy Ubuntu Core devices
251-include:
252- monitor/hdmi-hotplug-automated
253- monitor/edid-stress-automated
254-
255 id: after-suspend-monitor-full
256 unit: test plan
257 _name: Monitor tests (after suspend)
258@@ -290,7 +281,6 @@ _description: QA monitor tests for Snappy Ubuntu Core devices
259 include:
260 nested_part:
261 after-suspend-monitor-manual
262- after-suspend-monitor-automated
263
264 id: after-suspend-monitor-manual
265 unit: test plan
266@@ -302,10 +292,3 @@ include:
267 after-suspend-monitor/dvi-to-vga
268 after-suspend-monitor/hdmi-to-vga
269 after-suspend-monitor/displayport_hotplug
270-
271-id: after-suspend-monitor-automated
272-unit: test plan
273-_name: Automated monitor tests (after suspend)
274-_description: Automated monitor tests for Snappy Ubuntu Core devices
275-include:
276- after-suspend-monitor/hdmi-hotplug-automated

Subscribers

People subscribed via source and target branches