faft: Add USB Type C PD infrastructure
Added support for Type C PD testing via the usbpd console. For case
where the usbpd console is the same as the ec console (glados, plankton, etc),
the usbpd conosle is assigned to be the same as the ec console.
Added changes to access both Plankton and a PD capable DUT (samus, glados, ..)
at the same time. The plankton servo host is only started if plankton servo
arguments are detected in the args section of the test script command line.
Inluded one example test PDConnect that disconnects then reconnects via
changing the dualrole setting, and verifies that a new PD contract is established.
BRANCH=none
BUG=chromium:561007
TEST=Manual
Tested both samus to plankton and glados to plankton cases using my own local machine.
Change-Id: Ic51173f02e9932f5c1d907288037bea54c8f1c3d
Signed-off-by: Scott Collyer <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/314252
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/faft/firmware_test.py b/server/cros/faft/firmware_test.py
index f31e228..a0dd9a5 100644
--- a/server/cros/faft/firmware_test.py
+++ b/server/cros/faft/firmware_test.py
@@ -21,7 +21,7 @@
from autotest_lib.server.cros.faft.utils import mode_switcher
from autotest_lib.server.cros.faft.utils.faft_checkers import FAFTCheckers
from autotest_lib.server.cros.servo import chrome_ec
-
+from autotest_lib.server.cros.servo import chrome_usbpd
ConnectionError = mode_switcher.ConnectionError
@@ -138,6 +138,14 @@
if self.faft_config.chrome_ec:
self.ec = chrome_ec.ChromeEC(self.servo)
+ # Check for presence of a USBPD console
+ if self.faft_config.chrome_usbpd:
+ self.usbpd = chrome_usbpd.ChromeUSBPD(self.servo)
+ elif self.faft_config.chrome_ec:
+ # If no separate USBPD console, then PD exists on EC console
+ self.usbpd = self.ec
+ # Get plankton console
+ self.plankton = host.plankton_console
self._setup_uart_capture()
self._setup_servo_log()