Chameleon: Implement a stress test to switch EDID from among a large pool
This test switches Chameleon EDID from among a large pool of EDIDs, tests
DUT recognizes the emulated monitor and emits the correct video signal to
Chameleon.
The first batch of EDIDs come from the monitors in use by the QA team and
the previous reported bugs.
Add the support of importing text format (xrandr output) in the EDID library.
BUG=chromium:366421, chromium:344247
TEST=Tested the new test on Link:
$ test_that --args "chameleon_host=$CHAMELEON" $DUT display_EdidStress
Change-Id: I83c851d4d6eaa62385237891207d12193bc9e317
Reviewed-on: https://chromium-review.googlesource.com/196735
Reviewed-by: Hung-ying Tyan <tyanh@chromium.org>
Tested-by: Wai-Hong Tam <waihong@chromium.org>
Commit-Queue: Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/chameleon/display_client.py b/server/cros/chameleon/display_client.py
index 351e270..f0b091f 100644
--- a/server/cros/chameleon/display_client.py
+++ b/server/cros/chameleon/display_client.py
@@ -174,3 +174,13 @@
self._client.run(command)
self._client.get_file(remote_path, file_path)
return open(file_path).read()
+
+
+ def get_resolution(self):
+ """Gets the external resolution on framebuffer.
+
+ @return The resolution tuple (width, height)
+ """
+ output = self.get_connector_name()
+ width, height, _, _ = self._display_xmlrpc_client.get_resolution(output)
+ return (width, height)
diff --git a/server/cros/chameleon/edid.py b/server/cros/chameleon/edid.py
index c55df8c..9f94d82 100644
--- a/server/cros/chameleon/edid.py
+++ b/server/cros/chameleon/edid.py
@@ -63,7 +63,13 @@
if not os.path.exists(filename):
raise ValueError('EDID file %r does not exist' % filename)
- data = open(filename).read()
+ if filename.upper().endswith('.TXT'):
+ # Convert the EDID text format, returning from xrandr.
+ data = reduce(operator.add,
+ map(lambda s: s.strip().decode('hex'),
+ open(filename).readlines()))
+ else:
+ data = open(filename).read()
return cls(data)
diff --git a/server/site_tests/display_EdidStress/control b/server/site_tests/display_EdidStress/control
new file mode 100644
index 0000000..077c3a4
--- /dev/null
+++ b/server/site_tests/display_EdidStress/control
@@ -0,0 +1,31 @@
+# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from autotest_lib.server import utils
+
+AUTHOR = "chromeos-chameleon"
+NAME = "display_EdidStress"
+PURPOSE = "Stress DUT by switching EDID from among a large pool of EDIDs."
+CRITERIA = "This test will fail if DUT does not see the emulated monitor."
+SUITE = "chameleon"
+TIME = "SHORT"
+TEST_CATEGORY = "Functional"
+TEST_CLASS = "display"
+TEST_TYPE = "server"
+DEPENDENCIES = 'chameleon'
+
+DOC = """
+This test switches Chameleon EDID from among a large pool of EDIDs, tests
+DUT recognizes the emulated monitor and emits the correct video signal to
+Chameleon.
+"""
+
+args_dict = utils.args_to_dict(args)
+chameleon_args = hosts.CrosHost.get_chameleon_arguments(args_dict)
+
+def run(machine):
+ host = hosts.create_host(machine, chameleon_args=chameleon_args)
+ job.run_test("display_EdidStress", host=host)
+
+parallel_simple(run, machines)
diff --git a/server/site_tests/display_EdidStress/display_EdidStress.py b/server/site_tests/display_EdidStress/display_EdidStress.py
new file mode 100644
index 0000000..18e415d
--- /dev/null
+++ b/server/site_tests/display_EdidStress/display_EdidStress.py
@@ -0,0 +1,72 @@
+# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""This is a server side stressing DUT by switching Chameleon EDID."""
+
+import glob
+import logging
+import os
+
+from autotest_lib.client.common_lib import error
+from autotest_lib.server.cros.chameleon import chameleon_test
+from autotest_lib.server.cros.chameleon import edid
+
+
+class display_EdidStress(chameleon_test.ChameleonTest):
+ """Server side external display test.
+
+ This test switches Chameleon EDID from among a large pool of EDIDs, tests
+ DUT recognizes the emulated monitor and emits the correct video signal to
+ Chameleon.
+ """
+ version = 1
+
+
+ def initialize(self, host):
+ super(display_EdidStress, self).initialize(host)
+ self.backup_edid()
+
+
+ def cleanup(self):
+ super(display_EdidStress, self).cleanup()
+ self.restore_edid()
+
+
+ def run_once(self, host):
+ errors = []
+ edid_path = os.path.join(self.bindir, 'test_data', 'edids', '*')
+ logging.info('See the display on Chameleon: port %d (%s)',
+ self.chameleon_port.get_connector_id(),
+ self.chameleon_port.get_connector_type())
+
+ for filepath in glob.glob(edid_path):
+ filename = os.path.basename(filepath)
+ logging.info('Apply EDID: %s...', filename)
+ self.chameleon_port.apply_edid(edid.Edid.from_file(filepath))
+
+ try:
+ logging.info('Reconnect output...')
+ self.display_client.reconnect_output_and_wait()
+
+ chameleon_resolution = self.chameleon_port.get_resolution()
+ logging.info('See the resolution on Chameleon: %dx%d',
+ *chameleon_resolution)
+
+ framebuffer_resolution = self.display_client.get_resolution()
+ logging.info('See the resolution on framebuffer: %dx%d',
+ *framebuffer_resolution)
+ if chameleon_resolution == framebuffer_resolution:
+ logging.info('Resolutions match.')
+ else:
+ error_message = ('Resolutions not match on EDID %s: '
+ '(chameleon) %dx%d != %dx%d (dut)' %
+ ((filename, ) + chameleon_resolution +
+ framebuffer_resolution))
+ logging.error(error_message)
+ errors.append(error_message)
+ finally:
+ self.display_client.close_tab()
+
+ if errors:
+ raise error.TestFail('; '.join(errors))
diff --git a/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_CRBUG_220209_DVI.txt b/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_CRBUG_220209_DVI.txt
new file mode 100644
index 0000000..a3c5939
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_CRBUG_220209_DVI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0004720302bcb87714
+2f15010380331d782aee91a3544c9926
+0f5054b30c00714f818095008100d1c0
+010101010101023a801871382d40582c
+4500fe1f1100001e000000fd00384b1e
+5312000a202020202020000000ff004c
+51593038303039343230310a000000fc
+00416365722053323332484c0a20009f
diff --git a/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_DVI.txt b/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_DVI.txt
new file mode 100644
index 0000000..cad43ec
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_DVI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff000472030266a31721
+0b16010380331d782aee91a3544c9926
+0f5054b30c00714f818095008100d1c0
+010101010101023a801871382d40582c
+4500fe1f1100001e000000fd00384b1e
+5312000a202020202020000000ff004c
+51593038303039343230310a000000fc
+00416365722053323332484c0a200080
diff --git a/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_HDMI.txt
new file mode 100644
index 0000000..ef064ce
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/ACER_S232HL_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff000472030266a31721
+0b16010380331d782eee91a3544c9926
+0f5054bfef8081c08140714f81808100
+d1c001010101023a801871382d40582c
+4500fe1f1100001e000000fd00324b1e
+5010000a202020202020000000ff004c
+51593038303039343230310a000000fc
+00416365722053323332484c0a2001ac
+020314b24905040301121314101f6503
+0c0010008c0ad08a20e02d10103e9600
+fe1f11000018011d007251d01e206e28
+5500fe1f1100001e011d00bc52d01e20
+b8285540fe1f1100001e8c0ad0902040
+31200c405500fe1f1100001800000000
+00000000000000000000000000000000
+000000000000000000000000000000ed
diff --git a/server/site_tests/display_EdidStress/test_data/edids/AOC_215LM00015_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/AOC_215LM00015_HDMI.txt
new file mode 100644
index 0000000..1b5576d
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/AOC_215LM00015_HDMI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0005e34322d6010000
+2815010380301b782a3585a656489a24
+125054bfef00814081809500b300d1c0
+010101010101023a801871382d40582c
+4500dd0c1100001e000000fd00374b1e
+5311000a202020202020000000fc0032
+323433570a20202020202020000000ff
+0041435942414f4130303034373000bb
diff --git a/server/site_tests/display_EdidStress/test_data/edids/ASUS_VE258_DVI.txt b/server/site_tests/display_EdidStress/test_data/edids/ASUS_VE258_DVI.txt
new file mode 100644
index 0000000..0169735
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/ASUS_VE258_DVI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff000469f125f0c60100
+1d15010380371f782a7695a5544ba226
+115054bfef00714f81c0814081809500
+950fb300d1c0023a801871382d40582c
+450029372100001e000000ff0042374c
+4d54463131363436340a000000fd0032
+4b185311000a202020202020000000fc
+00415355532056453235380a2020008b
diff --git a/server/site_tests/display_EdidStress/test_data/edids/ASUS_VE258_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/ASUS_VE258_HDMI.txt
new file mode 100644
index 0000000..7c465c6
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/ASUS_VE258_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff000469f125f0c60100
+1d15010380371f782a7695a5544ba226
+115054b7ef00714f81c0814081809500
+b300d1c00101023a801871382d40582c
+450029372100001e000000ff0042374c
+4d54463131363436340a000000fd0032
+4b185311000a202020202020000000fc
+00415355532056453235380a20200134
+020322714f0102031112130414050e0f
+1d1e1f10230917078301000065030c00
+10008c0ad08a20e02d10103e96002937
+21000018011d007251d01e206e285500
+29372100001e011d00bc52d01e20b828
+554029372100001e8c0ad09020403120
+0c405500293721000018000000000000
+00000000000000000000000000000095
diff --git a/server/site_tests/display_EdidStress/test_data/edids/COBY_TV_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/COBY_TV_HDMI.txt
new file mode 100644
index 0000000..44d472d
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/COBY_TV_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff004e84c70001010101
+0c14010380291a780a9203a256489925
+144a4da1080095006140b30001010101
+010101010101662150b051001b304070
+3600ba882100001ea91a00a050001630
+30203700ba882100001a000000fc0053
+54442048444d492054560a20000000fd
+003b3d0f440f000a20202020202001e0
+02032671509005040203060711121314
+15161f01202609070715074083010000
+65030c001000023a801871382d40582c
+450070ea3100001e011d8018711c1620
+582c2500f4191100009e8c0ad08a20e0
+2d10103e960058c2210000188c0ad08a
+20e02d10103e960020c2310000180000
+00000000000000000000000000000039
diff --git a/server/site_tests/display_EdidStress/test_data/edids/DELL_U3011T_DVI.txt b/server/site_tests/display_EdidStress/test_data/edids/DELL_U3011T_DVI.txt
new file mode 100644
index 0000000..3f6d7fb
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/DELL_U3011T_DVI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0010ac63404c303032
+0c15010380402878ea8d85ad4f35b125
+0e5054a54b00714f81008180a940d100
+d14001010101e26800a0a0402e603020
+360081912100001a000000ff00504835
+4e5931334e3230304c0a000000fc0044
+454c4c2055333031310a2020000000fd
+0031561d711c000a20202020202000bd
diff --git a/server/site_tests/display_EdidStress/test_data/edids/DELL_U3011T_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/DELL_U3011T_HDMI.txt
new file mode 100644
index 0000000..0f92e31
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/DELL_U3011T_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff0010ac64404c303032
+0c15010380402878ea8d85ad4f35b125
+0e5054a54b00714f81008180d100a940
+010101010101283c80a070b023403020
+360081912100001a000000ff00504835
+4e5931334e3230304c0a000000fc0044
+454c4c2055333031310a2020000000fd
+0031561d5e12000a2020202020200138
+020329f1509005040302071601061112
+1513141f20230d7f07830f000067030c
+001000382de3050301023a801871382d
+40582c450081912100001e011d801871
+1c1620582c250081912100009e011d00
+7251d01e206e28550081912100001e8c
+0ad08a20e02d10103e96008191210000
+18000000000000000000000000000094
diff --git a/server/site_tests/display_EdidStress/test_data/edids/DELL_U3014_CRBUG_346692.txt b/server/site_tests/display_EdidStress/test_data/edids/DELL_U3014_CRBUG_346692.txt
new file mode 100644
index 0000000..4c65c66
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/DELL_U3014_CRBUG_346692.txt
@@ -0,0 +1,16 @@
+00ffffffffffff0010ac81404c393331
+0f170104b54028783a1df5ae4f35b325
+0d5054a54b008100b300d100714fa940
+8180d1c00101e26800a0a0402e603020
+360081912100001a000000ff00503156
+364e3334433133394c0a000000fc0044
+454c4c2055333031340a2020000000fd
+0031561d711c010a20202020202001e7
+02031df1509005040302071601061112
+1513141f2023091f0783010000023a80
+1871382d40582c450081912100001e01
+1d8018711c1620582c25008191210000
+9e011d007251d01e206e285500819121
+00001e8f0ad08a20e02d10103e960081
+91210000180000000000000000000000
+000000000000000000000000000000e6
diff --git a/server/site_tests/display_EdidStress/test_data/edids/DELL_UP3214Q_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/DELL_UP3214Q_HDMI.txt
new file mode 100644
index 0000000..4fc80ce
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/DELL_UP3214Q_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff0010ac924050303331
+2917010380462778ea73e0a35336b626
+0d5153a54b008100b300d100714fa940
+8180d1c0010104740030f2705a80b058
+8a00ba882100001e000000ff004b3352
+3930334137313330500a000000fc0044
+454c4c20555033323134510a000000fd
+001d4b1f8c1e000a20202020202001fb
+020323b1509005040302071601061112
+1513141f206d030c001000383c200060
+03020130750030f2705a80b0588a00ba
+882100001e023a801871382d40582c25
+00ba882100001e011d8018711c162058
+2c2500ba882100009e011d007251d01e
+206e285500ba882100001e8c0ad08a20
+e02d10103e9600ba88210000180000af
diff --git a/server/site_tests/display_EdidStress/test_data/edids/HP_ZR2440W_DVI.txt b/server/site_tests/display_EdidStress/test_data/edids/HP_ZR2440W_DVI.txt
new file mode 100644
index 0000000..86ca03b
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/HP_ZR2440W_DVI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0022f06a2801010101
+11150103803623782efc81a4554d9d25
+125054210800814081809500a940b300
+d1c001010101283c80a070b023403020
+360022602100001a000000fd003b3d18
+5011000a202020202020000000fc0048
+50205a523234770a20202020000000ff
+00434e54313137373052380a20200048
diff --git a/server/site_tests/display_EdidStress/test_data/edids/MONITOR_CRBUG_293015.txt b/server/site_tests/display_EdidStress/test_data/edids/MONITOR_CRBUG_293015.txt
new file mode 100644
index 0000000..b7230b6
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/MONITOR_CRBUG_293015.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0010ac16f04c44304b
+0515010380342078ea1ec5ae4f34b126
+0e5054a54b008180a940d100714f0101
+010101010101283c80a070b023403020
+360006442100001a000000ff00433539
+324d3131514b30444c0a000000fc0044
+454c4c2055323431300a2020000000fd
+00384c1e5111000a202020202020015d
diff --git a/server/site_tests/display_EdidStress/test_data/edids/MONROE_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/MONROE_HDMI.txt
new file mode 100644
index 0000000..c7f6067
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/MONROE_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff001e6d735a6a880200
+03180103802f1a78eaebf5a656519c26
+105054210800010181c0810081809500
+0101a9c0b300023a801871382d40582c
+45000f282100001e000000fd00383f1e
+530f000a202020202020000000fc0032
+3243563234310a2020202020000000ff
+003430334e44594734563939340a0108
+02031df14a900403011412051f101323
+0907078301000065030c001000023a80
+1871382d40582c4500fe221100001e01
+1d8018711c1620582c2500fe22110000
+9e011d007251d01e206e285500fe2211
+00001e8c0ad08a20e02d10103e9600fe
+22110000180000000000000000000000
+000000000000000000000000000000e6
diff --git a/server/site_tests/display_EdidStress/test_data/edids/PHILIPS_272P_CRBUG_346692.txt b/server/site_tests/display_EdidStress/test_data/edids/PHILIPS_272P_CRBUG_346692.txt
new file mode 100644
index 0000000..3fc1297
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/PHILIPS_272P_CRBUG_346692.txt
@@ -0,0 +1,16 @@
+00ffffffffffff00410cc50826060000
+11170104b53c22783a8e05ad4f33b026
+0d5054bd4b00d100d1c08180950f9500
+b30081c0a940565e00a0a0a029503020
+350055502100001e000000ff00415534
+31333137303031353734000000fc0050
+68696c697073203237325034000000fd
+00174c0f631e010a20202020202001f8
+020318f44b010203040590111213141f
+2309070783010000023a80d072382d40
+102c9680555021000018023a80187138
+2d40582c9600555021000018283c80a0
+70b023403020360055502100001a011d
+00bc52d01e20b828554055502100001e
+8c0ad090204031200c40550055502100
+00180000000000000000000000000003
diff --git a/server/site_tests/display_EdidStress/test_data/edids/PROJECTOR_CRBUG_273375_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/PROJECTOR_CRBUG_273375_HDMI.txt
new file mode 100644
index 0000000..0ed8a0d
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/PROJECTOR_CRBUG_273375_HDMI.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0038a31e7a01010101
+14170103800000782a7cdda15e4fa923
+0e4758bfef809040814081808bc0a9c0
+d1c09500b3009e20009051201f304880
+360000000000001c000000fd0030551f
+5c10000a202020202020000000fc004e
+502d4d333131570a20202020000000ff
+004733353030313035380a2020200101
diff --git a/server/site_tests/display_EdidStress/test_data/edids/SAMSUNG_TV_CRBUG_352795.txt b/server/site_tests/display_EdidStress/test_data/edids/SAMSUNG_TV_CRBUG_352795.txt
new file mode 100644
index 0000000..23182d1
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/SAMSUNG_TV_CRBUG_352795.txt
@@ -0,0 +1,8 @@
+00ffffffffffff0010ac7aa04c563530
+2815010380342078eaee95a3544c9926
+0f5054a1080081408180a940b300d1c0
+010101010101283c80a070b023403020
+360006442100001a000000ff004d3247
+43523139533035564c0a000000fc0044
+454c4c2055323431324d0a20000000fd
+00323d1e5311000a2020202020200018
diff --git a/server/site_tests/display_EdidStress/test_data/edids/TV_CRBUG_220235.txt b/server/site_tests/display_EdidStress/test_data/edids/TV_CRBUG_220235.txt
new file mode 100644
index 0000000..af2afda
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/TV_CRBUG_220235.txt
@@ -0,0 +1,8 @@
+00ffffffffffff004e14024201000000
+1b110103816237782bb1eca356499c24
+11484badcf0081406159a940714f81c0
+d1c0b30001011b2150a051001e304888
+3500d7283200001e000000fd0018580f
+5e11000a202020202020000000fc0053
+6365707472650a2020202020000000fc
+0058343247562d4b6f6d6f646f0a01c0
diff --git a/server/site_tests/display_EdidStress/test_data/edids/TV_CRBUG_253382.txt b/server/site_tests/display_EdidStress/test_data/edids/TV_CRBUG_253382.txt
new file mode 100644
index 0000000..b16dab1
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/TV_CRBUG_253382.txt
@@ -0,0 +1,8 @@
+00ffffffffffff004f2e2600340a0000
+18110103814728780b3f00a754469825
+11494b254a0081c00101010101010101
+010101010101201c50a0500016303020
+3500c6902100001ca91a00a050001630
+30207300c6902100001a000000fd0038
+4b0f3a08000a202020202020000000fc
+003233322d5331330a20202020200101
diff --git a/server/site_tests/display_EdidStress/test_data/edids/VIZIO_TV_HDMI.txt b/server/site_tests/display_EdidStress/test_data/edids/VIZIO_TV_HDMI.txt
new file mode 100644
index 0000000..6eef17f
--- /dev/null
+++ b/server/site_tests/display_EdidStress/test_data/edids/VIZIO_TV_HDMI.txt
@@ -0,0 +1,16 @@
+00ffffffffffff00593a500001010101
+0f130103804627780a4a7ba357479c25
+0f474aafce0001010101010101010101
+010101010101023a801871382d40582c
+4500ba892100001e000000fd00324d1f
+460f000a202020202020000000ff0053
+657269616c4e756d6265720a000000fc
+00564c3332304d0a202020202020018a
+02031e714b01030405901512131f1420
+230907038301000065030c003000011d
+00bc52d01e20b8285540ba892100001e
+011d80d0721c1620102c2580ba892100
+009e8c0ad08a20e02d10103e9600ba89
+21000018011d8018711c1620582c2500
+ba892100009e8c0ad090204031200c40
+5500ba892100001800000000000000de