VirtualBox

Changeset 48011 in vbox


Ignore:
Timestamp:
Aug 23, 2013 8:10:06 AM (11 years ago)
Author:
vboxsync
Message:

Main/tstCollector: don't fail if certain functions are not implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstCollector.cpp

    r48008 r48011  
    153153    uint64_t hostRxStop, hostTxStop, speed = 125000000; /* Assume 1Gbit/s */
    154154
    155     RTPrintf("tstCollector: TESTING - Network load, sleeping for 5 sec...\n");
     155    RTPrintf("tstCollector: TESTING - Network load, sleeping for 5 s...\n");
    156156
    157157    hostRxStart = hostTxStart = 0;
     
    212212
    213213    int rc = collector->getHostFilesystemUsage(FSNAME, &total, &used, &available);
    214     if (RT_FAILURE(rc))
    215     {
    216         RTPrintf("tstCollector: getHostFilesystemUsage() -> %Rrc\n", rc);
    217         return 1;
    218     }
    219     RTPrintf("tstCollector: host root fs total     = %lu mB\n", total);
    220     RTPrintf("tstCollector: host root fs used      = %lu mB\n", used);
    221     RTPrintf("tstCollector: host root fs available = %lu mB\n\n", available);
     214    if (rc == VERR_NOT_IMPLEMENTED)
     215        RTPrintf("tstCollector: getHostFilesystemUsage() not implemented, skipping\n");
     216    else
     217    {
     218        if (RT_FAILURE(rc))
     219        {
     220            RTPrintf("tstCollector: getHostFilesystemUsage() -> %Rrc\n", rc);
     221            return 1;
     222        }
     223        RTPrintf("tstCollector: host root fs total     = %lu mB\n", total);
     224        RTPrintf("tstCollector: host root fs used      = %lu mB\n", used);
     225        RTPrintf("tstCollector: host root fs available = %lu mB\n\n", available);
     226    }
    222227    return 0;
    223228}
     
    257262            rc = collector->getHostDiskSize(it->c_str(), &diskSize);
    258263            RTPrintf("tstCollector: TESTING - Disk size (%s) = %llu\n", it->c_str(), diskSize);
    259             if (RT_FAILURE(rc))
     264            if (rc == VERR_FILE_NOT_FOUND)
     265                RTPrintf("tstCollector: getHostDiskSize(%s) returned VERR_FILE_NOT_FOUND\n", it->c_str());
     266            else if (RT_FAILURE(rc))
    260267            {
    261268                RTPrintf("tstCollector: getHostDiskSize() -> %Rrc\n", rc);
     
    266273        for (it = disksLoad.begin(); it != disksLoad.end(); ++it)
    267274        {
    268             RTPrintf("tstCollector: TESTING - Disk utilization (%s), sleeping for 5 sec...\n", it->c_str());
     275            RTPrintf("tstCollector: TESTING - Disk utilization (%s), sleeping for 5 s...\n", it->c_str());
    269276
    270277            hints.collectHostCpuLoad();
     
    405412    if (cpuTest)
    406413    {
    407         RTPrintf("tstCollector: TESTING - CPU load, sleeping for 5 sec\n");
     414        RTPrintf("tstCollector: TESTING - CPU load, sleeping for 5 s...\n");
    408415
    409416        rc = collector->getRawHostCpuLoad(&hostUserStart, &hostKernelStart, &hostIdleStart);
     
    459466                 (unsigned)((processKernelStop - processKernelStart) * 10000 / (processTotalStop - processTotalStart) % 100));
    460467
    461         RTPrintf("tstCollector: TESTING - CPU load, looping for 5 sec\n");
     468        RTPrintf("tstCollector: TESTING - CPU load, looping for 5 s...\n");
    462469        rc = collector->preCollect(hints, 0);
    463470        if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette