tstHostHardwareLinux.cpp revision ebb998c68d059fb28283dd5631df33cbca044519
/* $Id$ */
/** @file
*
* Test executable for quickly excercising/debugging the Linux host hardware
* bits.
*/
/*
* Copyright (C) 2008 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include <HostHardwareLinux.h>
#include <iprt/initterm.h>
#include <errno.h>
#include <string.h>
int main()
{
RTR3Init();
g_testHostHardwareLinux = true;
int rc = VINF_SUCCESS;
g_testHostHardwareLinux = true;
if (RT_SUCCESS (rc))
if (RT_FAILURE (rc))
{
RTPrintf("Failed to update the host drive information, error %Rrc\n",
rc);
return 1;
}
RTPrintf ("Listing floppy drives detected:\n");
{
RTPrintf ("\n");
}
RTPrintf ("Listing DVD drives detected:\n");
{
RTPrintf ("\n");
}
#ifdef VBOX_USB_WITH_SYSFS
if (RT_FAILURE (rc))
{
RTPrintf ("Failed to update the host USB device information, error %Rrc\n",
rc);
return 1;
}
RTPrintf ("Listing USB devices detected:\n");
{
char szProduct[1024];
{
{
RTPrintf ("Failed to get the product name for device %s: error %s\n",
return 1;
}
else
szProduct[0] = '\0';
}
RTPrintf (" interfaces:\n");
{
char szDriver[RTPATH_MAX];
{
RTPrintf ("Failed to get the driver for interface %s of device %s: error %s\n",
return 1;
}
{
RTPrintf ("RTLinuxSysFsExists did not return the expected value for the driver link of interface %s of device %s.\n",
return 1;
}
RTPrintf (" sysfs path: %s, driver: %s, interface class: 0x%x\n",
}
}
RTPrintf ("Waiting for a hotplug event, Ctrl-C to abort...\n");
#endif /* VBOX_USB_WITH_SYSFS */
return 0;
}