site_linux_router: delete ifb{0,1} on AP

The ifb module may create these virtual interfaces, and shill thinks it
needs to manage them. To avoid possible side effects and to reduce log
noise, have our tests delete them on startup, similar to what we do for
hostapbrX cleanup.

BUG=chromium:960551
TEST=network_WiFi_* with Gale; see ifb0/ifb1 deleted

Change-Id: I33779c745b832fb68ec010626963ad0468f3be6a
Reviewed-on: https://chromium-review.googlesource.com/1601369
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
diff --git a/server/site_linux_router.py b/server/site_linux_router.py
index 50db0a2..e8b492a 100644
--- a/server/site_linux_router.py
+++ b/server/site_linux_router.py
@@ -222,13 +222,15 @@
         self.dhcp_low = 1
         self.dhcp_high = 128
 
-        # Tear down hostapbr bridge interfaces
-        result = self.host.run('ls -d /sys/class/net/%s*' %
-                               self.HOSTAP_BRIDGE_INTERFACE_PREFIX,
+        # Tear down hostapbr bridge and intermediate functional block
+        # interfaces.
+        result = self.host.run('ls -d /sys/class/net/%s* /sys/class/net/%s*'
+                               ' 2>/dev/null' %
+                               (self.HOSTAP_BRIDGE_INTERFACE_PREFIX,
+                                self.IFB_INTERFACE_PREFIX),
                                ignore_status=True)
-        if result.exit_status == 0:
-            for path in result.stdout.splitlines():
-                self.delete_link(path.split('/')[-1])
+        for path in result.stdout.splitlines():
+            self.delete_link(path.split('/')[-1])
 
         # Kill hostapd and dhcp server if already running.
         self._kill_process_instance('hostapd', timeout_seconds=30)
diff --git a/server/site_linux_system.py b/server/site_linux_system.py
index e7bd9a0..07720b1 100644
--- a/server/site_linux_system.py
+++ b/server/site_linux_system.py
@@ -42,6 +42,7 @@
     CAPABILITY_SUPPLICANT_ROAMING = "supplicant_roaming"
     BRIDGE_INTERFACE_NAME = 'br0'
     HOSTAP_BRIDGE_INTERFACE_PREFIX = 'hostapbr'
+    IFB_INTERFACE_PREFIX = 'ifb'
     MIN_SPATIAL_STREAMS = 2
     MAC_BIT_LOCAL = 0x2  # Locally administered.
     MAC_BIT_MULTICAST = 0x1