faft: Refactored PDConnect test to use pd_device objects

The existing version of this test was written prior to
developing the pd_device objects. Refactored the test to
take advantage of this encapsulation. The overall test is
now much simpler to both implement and maintain.

BRANCH=none
BUG=chrome-os-partner:53742
TEST=Manual
Tested using Samus and Plankton with workstation.

Change-Id: Id2d93fae7709d799e57b1837b5dff6a3e8148319
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/347447
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
diff --git a/server/cros/servo/chrome_ec.py b/server/cros/servo/chrome_ec.py
index 0d3e4e1..690716c 100644
--- a/server/cros/servo/chrome_ec.py
+++ b/server/cros/servo/chrome_ec.py
@@ -220,3 +220,17 @@
         # See chromium:371631 for details.
         # FIXME: Stop importing time module if this hack becomes obsolete.
         time.sleep(1)
+
+    def enable_console_channel(self, channel):
+        """Find console channel mask and enable that channel only
+
+        @param channel: console channel name
+        """
+        # The 'chan' command returns a list of console channels,
+        # their channel masks and channel numbers
+        regexp = r'(\d+)\s+([\w]+)\s+\*?\s+{0}'.format(channel)
+        l = self.send_command_get_output('chan', [regexp])
+        # Use channel mask and append the 0x for proper hex input value
+        cmd = 'chan 0x' + l[0][2]
+        # Set console to only output the desired channel
+        self.send_command(cmd)