network_WiFi_BSSTMReq: differentiate between lack of support and failure

Currently, send_bss_tm_req in site_linux_router only checks for an 'OK'
in the reply. Everything else is considered lack of support for the
feature. However, lack of support is indicated by an 'Unknown command'
reply specifically, and everything else should be considered a failure.

Make that distinction in this change.

BUG=chromium:948954
TEST=triggered all scenarios of the test

Change-Id: Ia2b575773f739708879338d55489a1a371025314
Reviewed-on: https://chromium-review.googlesource.com/1551965
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/server/site_linux_router.py b/server/site_linux_router.py
index 8fc708a..50db0a2 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -973,7 +973,7 @@
         @param client_mac string containing the mac address of the client.
         @param neighbor_list list of strings containing mac addresses of
                candidate APs.
-        @return bool True if BSS_TM_REQ is sent successfully.
+        @return string reply received from command
 
         """
         control_if = self.hostapd_instances[0].config_dict['ctrl_interface']
@@ -981,9 +981,7 @@
                    (self.cmd_hostapd_cli, control_if, client_mac,
                     ',0,0,0,0 neighbor='.join(neighbor_list)))
         ret = self.router.run(command).stdout
-        if ret.splitlines()[-1] != 'OK':
-            return False
-        return True
+        return ret.splitlines()[-1]
 
     def _prep_probe_response_footer(self, footer):
         """Write probe response footer temporarily to a local file and copy
diff --git a/server/site_tests/network_WiFi_BSSTMReq/network_WiFi_BSSTMReq.py b/server/site_tests/network_WiFi_BSSTMReq/network_WiFi_BSSTMReq.py
index 7455502..03740ec 100644
--- a/server/site_tests/network_WiFi_BSSTMReq/network_WiFi_BSSTMReq.py
+++ b/server/site_tests/network_WiFi_BSSTMReq/network_WiFi_BSSTMReq.py
@@ -78,10 +78,16 @@
             roam_to_bssid = bssid0
 
         # Send BSS Transition Management Request to client
-        if not self.context.router.send_bss_tm_req(self.context.client.wifi_mac,
-                                                   [roam_to_bssid]):
+        reply = self.context.router.send_bss_tm_req(
+            self.context.client.wifi_mac,
+            [roam_to_bssid])
+        if reply == 'OK':
+            pass
+        elif reply.startswith('Unknown command'):
             raise error.TestNAError('AP does not support BSS Transition '
                                     'Management')
+        else:
+            raise error.TestFail('Failed to send BSS TM Request: %s', reply)
 
         # Expect that the DUT will re-connect to the new AP
         if not self.context.client.wait_for_roam(