diff options
author | PMR <pmr@pmr-lander> | 2020-07-24 12:16:18 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2020-07-24 12:16:18 +0000 |
commit | 6a157f7a7ec302fb4cb4cc186ecb74c263f5a571 (patch) | |
tree | 6f61e8835b2c7ba8a394f9201e2444e4e84fa144 | |
parent | b6755ae063b50455eed2f226ee1794f92159a648 (diff) | |
parent | 8aa7d7f62f3005865df85b3767860d4cae6820b3 (diff) |
Merge #388041 from ~sylvain-pineau/plainbox-provider-checkbox:bye-chameleon
-rwxr-xr-x | bin/chameleon_edid_stress.py | 115 | ||||
-rwxr-xr-x | bin/chameleon_hdmi_hotplug.py | 74 | ||||
-rw-r--r-- | units/monitor/jobs.pxu | 21 | ||||
-rw-r--r-- | units/monitor/test-plan.pxu | 17 |
4 files changed, 0 insertions, 227 deletions
diff --git a/bin/chameleon_edid_stress.py b/bin/chameleon_edid_stress.py deleted file mode 100755 index 8cc007d9..00000000 --- a/bin/chameleon_edid_stress.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python3 - -import glob -import os -import subprocess as sp -import sys -import time - -import xmlrpc.client - - -def Chameleon(host, port=9992): - """ - Get a proxy object that is used to control the Chameleon board. - - The interface definition for this object can be found at: - https://chromium.googlesource.com/chromiumos/platform/chameleon/+/refs/heads/master/chameleond/interface.py - """ - print('== Chameleon connection ==') - print('Target device: {}:{}'.format(host, port)) - proxy = xmlrpc.client.ServerProxy('http://{}:{}'.format(host, port)) - try: - # test the proxy works - mac = proxy.GetMacAddress() - print('MAC address: {}'.format(mac)) - except OSError as e: - print(e) - raise SystemExit('ERROR connecting to Chameleon board') - print() - return proxy - - -def get_hdmi_port(chameleon): - supported_ports = chameleon.GetSupportedPorts() - for port in supported_ports: - port_type = chameleon.GetConnectorType(port) - if port_type == 'HDMI': - return port - - -def get_hdmi_status(drm_id): - path = '/sys/class/drm/{}/status'.format(drm_id) - with open(path) as sys_f: - return sys_f.readline().strip() - - -def get_hdmi_edid(drm_id): - path = '/sys/class/drm/{}/edid'.format(drm_id) - output = sp.run(['edid-decode', path], check=False, stdout=sp.PIPE).stdout - for line in output.decode(sys.stdout.encoding).splitlines(): - if 'Manufacturer:' in line: - return line.strip() - - -def edid_from_file(filename): - with open(filename, 'r') as file: - if filename.upper().endswith('.TXT'): - # Convert the EDID text format returned from xrandr. - hex = file.read().replace('\n', '') - data = bytes.fromhex(hex) - else: - data = open(filename).read() - return data - - -if __name__ == '__main__': - if len(sys.argv) != 3: - raise SystemExit('ERROR: please specify drm card and chameleon IP') - - drm_id = sys.argv[1] - c = Chameleon(sys.argv[2]) - - edid_dir = os.path.expandvars( - '$PLAINBOX_PROVIDER_DATA/chameleon_edids/daily') - print('Loading EDIDs from {}'.format(edid_dir)) - edids = glob.glob(edid_dir + os.path.sep + '[A-Z][A-Z][A-Z]_*.txt') - - port_num = get_hdmi_port(c) - c.Unplug(port_num) - - fails = [] - for edid in edids: - edid_base = os.path.basename(edid) - print('=={}=='.format(edid_base)) - print('Send EDID to Chameleon') - edid_id = c.CreateEdid(edid_from_file(edid)) - c.ApplyEdid(port_num, edid_id) - print('Plug HDMI') - c.Plug(port_num) - time.sleep(2) - - # TODO: make this an actual test - if get_hdmi_status(drm_id) == 'connected': - manufacturer_str = get_hdmi_edid(drm_id) - print(manufacturer_str) - if edid_base[:3] not in manufacturer_str: - print('Manufacturer {} not found') - fails.append(edid_base) - else: - print('HDMI not connected') - fails.append(edid_base) - - print('Unplug HDMI') - c.Unplug(port_num) - time.sleep(2) - print('Free EDID data') - c.DestroyEdid(edid_id) - print('====\n', flush=True) - - if fails: - print("Failed EDIDs:") - for f in fails: - print(f) - raise SystemExit("Total {}/{}".format(len(fails), len(edids))) - print('PASS') diff --git a/bin/chameleon_hdmi_hotplug.py b/bin/chameleon_hdmi_hotplug.py deleted file mode 100755 index 73668865..00000000 --- a/bin/chameleon_hdmi_hotplug.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import time - -import xmlrpc.client - - -def Chameleon(host, port=9992): - """ - Get a proxy object that is used to control the Chameleon board. - - The interface definition for this object can be found at: - https://chromium.googlesource.com/chromiumos/platform/chameleon/+/refs/heads/master/chameleond/interface.py - """ - print('== Chameleon connection ==') - print('Target device: {}:{}'.format(host, port)) - proxy = xmlrpc.client.ServerProxy('http://{}:{}'.format(host, port)) - try: - # test the proxy works - mac = proxy.GetMacAddress() - print('MAC address: {}'.format(mac)) - except OSError as e: - print(e) - raise SystemExit('ERROR connecting to Chameleon board') - print() - return proxy - - -def get_hdmi_port(chameleon): - supported_ports = chameleon.GetSupportedPorts() - for port in supported_ports: - port_type = chameleon.GetConnectorType(port) - if port_type == 'HDMI': - return port - - -def get_hdmi_status(drm_id): - path = '/sys/class/drm/{}/status'.format(drm_id) - with open(path) as sys_f: - return sys_f.readline().strip() - - -if __name__ == '__main__': - drm_id = sys.argv[1] - c = Chameleon(sys.argv[2]) - - start = get_hdmi_status(drm_id) - print('Starting status: {}'.format(start)) - print(flush=True) - - port_num = get_hdmi_port(c) - - print('chameleon> plug hdmi') - c.Plug(port_num) - time.sleep(10) - - new_status = get_hdmi_status(drm_id) - print('Status after plug request: {}'.format(new_status)) - print(flush=True) - if new_status != 'connected': - raise SystemExit('FAIL: hdmi not connected') - - print('chameleon> unplug hdmi') - c.Unplug(port_num) - time.sleep(10) - - final_status = get_hdmi_status(drm_id) - print('Status after unplug request: {}'.format(final_status)) - print(flush=True) - if final_status != 'disconnected': - raise SystemExit('FAIL: hdmi did not disconnect') - - print('PASS') diff --git a/units/monitor/jobs.pxu b/units/monitor/jobs.pxu index 0ec67d3a..4a6ae9a1 100644 --- a/units/monitor/jobs.pxu +++ b/units/monitor/jobs.pxu @@ -395,24 +395,3 @@ _steps: _verification: Was the interface displayed correctly on the screen? flags: also-after-suspend - -id: monitor/hdmi-hotplug-automated -flags: also-after-suspend -estimated_duration: 15.0 -plugin: shell -category_id: com.canonical.plainbox::monitor -_summary: Automated HDMI hotplug test -_description: - Use chamleon board to simulate connection/disconnection of an HDMI monitor. -environ: HDMI_PORT CHAMELEON_IP -command: - chameleon_hdmi_hotplug.py "$HDMI_PORT" "$CHAMELEON_IP" - -id: monitor/edid-stress-automated -estimated_duration: 30m -plugin: shell -category_id: com.canonical.plainbox::monitor -_summary: Stress DUT by switching through large EDID set -environ: HDMI_PORT CHAMELEON_IP -command: - chameleon_edid_stress.py "$HDMI_PORT" "$CHAMELEON_IP" diff --git a/units/monitor/test-plan.pxu b/units/monitor/test-plan.pxu index fd4c5070..b893acb3 100644 --- a/units/monitor/test-plan.pxu +++ b/units/monitor/test-plan.pxu @@ -262,7 +262,6 @@ _description: QA monitor tests for Snappy Ubuntu Core devices include: nested_part: monitor-manual - monitor-automated id: monitor-manual unit: test plan @@ -275,14 +274,6 @@ include: monitor/hdmi-to-vga monitor/displayport_hotplug -id: monitor-automated -unit: test plan -_name: Automated monitor tests -_description: Automated monitor tests for Snappy Ubuntu Core devices -include: - monitor/hdmi-hotplug-automated - monitor/edid-stress-automated - id: after-suspend-monitor-full unit: test plan _name: Monitor tests (after suspend) @@ -290,7 +281,6 @@ _description: QA monitor tests for Snappy Ubuntu Core devices include: nested_part: after-suspend-monitor-manual - after-suspend-monitor-automated id: after-suspend-monitor-manual unit: test plan @@ -302,10 +292,3 @@ include: after-suspend-monitor/dvi-to-vga after-suspend-monitor/hdmi-to-vga after-suspend-monitor/displayport_hotplug - -id: after-suspend-monitor-automated -unit: test plan -_name: Automated monitor tests (after suspend) -_description: Automated monitor tests for Snappy Ubuntu Core devices -include: - after-suspend-monitor/hdmi-hotplug-automated |