tstHostHardwareLinux.cpp revision 76be4606d542c3eed0dc8b1921f41255b4f5347c
/* $Id$ */
/** @file
*
* Test executable for quickly excercising/debugging the Linux host hardware
* bits.
*/
/*
* Copyright (C) 2008 Oracle Corporation
*
* 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.
*/
#include <HostHardwareLinux.h>
#include <iprt/initterm.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
{
int rc;
while (true)
{
break;
if (RT_FAILURE(rc))
{
RTPrintf("Failed!\n");
exit(1);
}
if (RT_SUCCESS(rc))
break;
}
return rc;
}
int main()
{
RTR3Init();
int rc = VINF_SUCCESS;
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 for five seconds...\n");
RTPrintf ("Waiting for a hotplug event, Ctrl-C to abort...\n");
RTPrintf ("Testing interrupting a hotplug event...\n");
#endif /* VBOX_USB_WITH_SYSFS */
return 0;
}