network_WiFi_RoamFT: set WiFi.GlobalFTEnabled property before FT tests

With the addition of the new global FT switch that is off by default,
all of the FT autotests are failing. Flip the FT switch on via dbus so
that these tests pass again.

BUG=chromium:905766
TEST=Ran autotest without the change and it failed. Ran autotest with
     the change and it passed. Ran autotest without the change again
     and it failed again.

Change-Id: I79ab3a762c6e0b2ddda931237d5238377a390b5c
Reviewed-on: https://chromium-review.googlesource.com/1338280
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Matthew Wang <matthewmwang@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
diff --git a/client/cros/networking/shill_proxy.py b/client/cros/networking/shill_proxy.py
index c551553..86b316e 100644
--- a/client/cros/networking/shill_proxy.py
+++ b/client/cros/networking/shill_proxy.py
@@ -60,10 +60,12 @@
     MANAGER_PROPERTY_ALL_SERVICES = 'ServiceCompleteList'
     MANAGER_PROPERTY_DHCPPROPERTY_HOSTNAME = 'DHCPProperty.Hostname'
     MANAGER_PROPERTY_DHCPPROPERTY_VENDORCLASS = 'DHCPProperty.VendorClass'
+    MANAGER_PROPERTY_WIFI_GLOBAL_FT_ENABLED = 'WiFi.GlobalFTEnabled'
 
     MANAGER_OPTIONAL_PROPERTY_MAP = {
         MANAGER_PROPERTY_DHCPPROPERTY_HOSTNAME: dbus.String,
-        MANAGER_PROPERTY_DHCPPROPERTY_VENDORCLASS: dbus.String
+        MANAGER_PROPERTY_DHCPPROPERTY_VENDORCLASS: dbus.String,
+        MANAGER_PROPERTY_WIFI_GLOBAL_FT_ENABLED: dbus.Boolean
     }
 
     PROFILE_PROPERTY_ENTRIES = 'Entries'
diff --git a/server/cros/network/wifi_client.py b/server/cros/network/wifi_client.py
index c595ba6..741c6c1 100644
--- a/server/cros/network/wifi_client.py
+++ b/server/cros/network/wifi_client.py
@@ -17,6 +17,7 @@
 from autotest_lib.client.common_lib.cros.network import iw_runner
 from autotest_lib.client.common_lib.cros.network import ping_runner
 from autotest_lib.client.cros import constants
+from autotest_lib.client.cros.networking import shill_proxy
 from autotest_lib.server import autotest
 from autotest_lib.server import site_linux_system
 from autotest_lib.server.cros.network import wpa_cli_proxy
@@ -923,6 +924,19 @@
                 enabled)
 
 
+    def set_global_ft_enabled(self, enabled):
+        """Sets the WiFi.GlobalFTEnabled property to the value provided.
+
+        @param enabled: bool
+        @return a context manager for the setting
+
+        """
+        return TemporaryManagerDBusProperty(
+                self._shill_proxy,
+                shill_proxy.ShillProxy.MANAGER_PROPERTY_WIFI_GLOBAL_FT_ENABLED,
+                enabled)
+
+
     def request_roam(self, bssid):
         """Request that we roam to the specified BSSID.
 
diff --git a/server/site_tests/network_WiFi_RoamFT/network_WiFi_RoamFT.py b/server/site_tests/network_WiFi_RoamFT/network_WiFi_RoamFT.py
index 653dba4..e71ee40 100644
--- a/server/site_tests/network_WiFi_RoamFT/network_WiFi_RoamFT.py
+++ b/server/site_tests/network_WiFi_RoamFT/network_WiFi_RoamFT.py
@@ -72,7 +72,7 @@
         """
         self._security_config = additional_params
 
-    def run_once(self,host):
+    def test_body(self):
         """Test body."""
 
         if self._security_config.ft_mode == \
@@ -188,6 +188,12 @@
                    roam_to_bssid, timeout_seconds=self.TIMEOUT_SECONDS):
                 raise error.TestFail('Failed to roam.')
 
+    def run_once(self,host):
+        """Set global FT switch and call test_body"""
+
+        with self.context.client.set_global_ft_enabled(True):
+            self.test_body()
+
     def cleanup(self):
         """Cleanup function."""