shill: Special case virtual ethernet devices

This lets shill start up its autoconfiguration logic on a virtual
ethernet device.  We use this to test dhcpcd<->shill interactions.

BUG=chromium-os:32809
TEST=shill starts dhcpcd on virtual ethernet devices with special name

Change-Id: I1785a115a50a7312a4c0c3ac4195388e621c7116
Reviewed-on: https://gerrit.chromium.org/gerrit/32803
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Christopher Wiley <wiley@chromium.org>
diff --git a/device_info.cc b/device_info.cc
index 5982c5f..8fcf3e6 100644
--- a/device_info.cc
+++ b/device_info.cc
@@ -55,6 +55,7 @@
 
 // static
 const char DeviceInfo::kModemPseudoDeviceNamePrefix[] = "pseudomodem";
+const char DeviceInfo::kEthernetPseudoDeviceNamePrefix[] = "pseudoethernet";
 const char DeviceInfo::kDeviceInfoRoot[] = "/sys/class/net";
 const char DeviceInfo::kDriverCdcEther[] = "cdc_ether";
 const char DeviceInfo::kDriverGdmWiMax[] = "gdm_wimax";
@@ -216,6 +217,14 @@
     return Technology::kCellular;
   }
 
+  // Special case for pseudo ethernet devices which are used for testing.
+  if (iface_name.find(kEthernetPseudoDeviceNamePrefix) == 0) {
+    SLOG(Device, 2) << StringPrintf(
+        "%s: device %s is a virtual ethernet device for testing",
+        __func__, iface_name.c_str());
+    return Technology::kEthernet;
+  }
+
   FilePath driver_path;
   if (!GetDeviceInfoSymbolicLink(iface_name, kInterfaceDriver, &driver_path)) {
     SLOG(Device, 2) << StringPrintf("%s: device %s has no device symlink",