autotest: start servod with dual_v4 option for some designated faft pools

BUG=chromium:1028832
TEST=local test

Change-Id: I75c3d89bc8605c53c5bb3dcc46d3098be7032e67
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2079300
Reviewed-by: Dana Goyette <dgoyette@chromium.org>
Commit-Queue: Garry Wang <xianuowang@chromium.org>
Tested-by: Garry Wang <xianuowang@chromium.org>
diff --git a/server/hosts/servo_host.py b/server/hosts/servo_host.py
index 68e1047..40468d7 100644
--- a/server/hosts/servo_host.py
+++ b/server/hosts/servo_host.py
@@ -48,6 +48,15 @@
 SERVOD_QUICK_STARTUP_TIMEOUT = 20
 SERVOD_STARTUP_TIMEOUT = 60
 
+# pools that support dual v4. (go/cros-fw-lab-strategy)
+POOLS_SUPPORT_DUAL_V4 = {'faft-cr50',
+                         'faft-cr50-experimental',
+                         'faft-cr50-tot',
+                         'faft-cr50-debug',
+                         'faft_cr50_debug'
+                         'faft-pd-debug',
+                         'faft_pd_debug'}
+
 _CONFIG = global_config.global_config
 ENABLE_SSH_TUNNEL_FOR_SERVO = _CONFIG.get_config_value(
         'CROS', 'enable_ssh_tunnel_for_servo', type=bool, default=False)
@@ -353,6 +362,16 @@
         cmd += ' PORT=%d' % self.servo_port
         if self.servo_serial:
             cmd += ' SERIAL=%s' % self.servo_serial
+
+        # Start servod with dual_v4 if the DUT/servo from designated pools.
+        dut_host_info = self.get_dut_host_info()
+        if dut_host_info:
+            if bool(dut_host_info.pools & POOLS_SUPPORT_DUAL_V4):
+                logging.debug('The DUT is detected in following designated'
+                              ' pools %s,starting servod with DUAL_V4 option.',
+                              POOLS_SUPPORT_DUAL_V4)
+                cmd += ' DUAL_V4=1'
+
         # Remove the symbolic links from the logs. This helps ensure that
         # a failed servod instantiation does not cause us to grab old logs
         # by mistake.