Changeset 36958 in vbox for trunk/src/VBox/Main/testcase
- Timestamp:
- May 4, 2011 2:50:32 PM (14 years ago)
- Location:
- trunk/src/VBox/Main/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstHostHardwareLinux.cpp
r36348 r36958 128 128 RTPrintf ("\n"); 129 129 } 130 PCUSBDEVTREELOCATION pcLocation = USBProxyLinuxGetDeviceRoot(false);131 if ( pcLocation && !pcLocation->fUseSysfs)130 RTPrintf("NOTE: checking for usbfs at /dev/bus/usb, not /proc/bus/usb!!!\n"); 131 if (USBProxyLinuxCheckDeviceRoot("/dev/bus/usb", false)) 132 132 { 133 PUSBDEVICE pDevice = USBProxyLinuxGetDevices( pcLocation->szDevicesRoot,133 PUSBDEVICE pDevice = USBProxyLinuxGetDevices("/dev/bus/usb", 134 134 false); 135 printDevices(pDevice, pcLocation->szDevicesRoot, "usbfs");135 printDevices(pDevice, "/dev/bus/usb", "usbfs"); 136 136 freeDevices(pDevice); 137 137 } 138 else 139 RTPrintf("-> not found\n"); 138 140 #ifdef VBOX_USB_WITH_SYSFS 139 pcLocation = USBProxyLinuxGetDeviceRoot(true);140 if ( pcLocation && pcLocation->fUseSysfs)141 RTPrintf("Testing for USB devices at /dev/vboxusb\n"); 142 if (USBProxyLinuxCheckDeviceRoot("/dev/vboxusb", true)) 141 143 { 142 PUSBDEVICE pDevice = USBProxyLinuxGetDevices( pcLocation->szDevicesRoot,144 PUSBDEVICE pDevice = USBProxyLinuxGetDevices("/dev/vboxusb", 143 145 true); 144 printDevices(pDevice, pcLocation->szDevicesRoot, "sysfs");146 printDevices(pDevice, "/dev/vboxusb", "sysfs"); 145 147 freeDevices(pDevice); 146 148 } 147 VBoxMainHotplugWaiter waiter(pcLocation->szDevicesRoot); 149 else 150 RTPrintf("-> not found\n"); 151 VBoxMainHotplugWaiter waiter("/dev/vboxusb"); 148 152 RTPrintf ("Waiting for a hotplug event for five seconds...\n"); 149 153 doHotplugEvent(&waiter, 5000); -
trunk/src/VBox/Main/testcase/tstUSBProxyLinux.cpp
r36419 r36958 62 62 } 63 63 64 static USBDEVTREELOCATION s_deviceRoot = { "", false };65 static bool s_f GetDeviceRootPreferSysfs = false;64 static const char *s_pcszDeviceRoot = ""; 65 static bool s_fIsDeviceNodes = false; 66 66 67 PCUSBDEVTREELOCATION USBProxyLinuxGetDeviceRoot(bool fPreferSysfs) 67 bool USBProxyLinuxCheckDeviceRoot(const char *pcszRoot, 68 bool fIsDeviceNodes) 68 69 { 69 s_fGetDeviceRootPreferSysfs = fPreferSysfs;70 return &s_deviceRoot;70 return ( (!strcmp(s_pcszDeviceRoot, pcszRoot)) 71 && (s_fIsDeviceNodes == fIsDeviceNodes)); 71 72 } 72 73 … … 153 154 else 154 155 RTEnvUnset("VBOX_USB_ROOT"); 155 strcpy(s_deviceRoot.szDevicesRoot, 156 s_testEnvironment[i].pcszReturnedRoot); 157 s_deviceRoot.fUseSysfs = s_testEnvironment[i].fReturnedUseSysfs; 156 s_pcszDeviceRoot = s_testEnvironment[i].pcszReturnedRoot; 157 s_fIsDeviceNodes = s_testEnvironment[i].fReturnedUseSysfs; 158 158 RTTESTI_CHECK(test.init() == S_OK); 159 159 test.getDevices();
Note:
See TracChangeset
for help on using the changeset viewer.