VirtualBox

Changeset 60170 in vbox


Ignore:
Timestamp:
Mar 23, 2016 2:30:00 PM (9 years ago)
Author:
vboxsync
Message:

tstVBoxMultipleVM.cpp: Missed a few tabs.

File:
1 edited

Legend:

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

    r60169 r60170  
    4949static volatile bool            g_RunTest = true;
    5050static RTSEMEVENT               g_PingEevent;
    51 static volatile uint64_t        g_Counter = 0;
     51static volatile uint64_t        g_Counter = 0;
    5252static RTTEST                   g_hTest;
    53 static Bstr                     tstMachineName = "tstVBoxMultipleVM test multiple VM start/stop";
    5453
    5554/* Arguments of test thread */
     
    8685
    8786
    88 static int tstStartVM(IVirtualBox* pVBox, ISession* pSession, Bstr machineID, BOOL skipUnlok)
     87static int tstStartVM(IVirtualBox *pVBox, ISession *pSession, Bstr machineID, bool fSkipUnlock)
    8988{
    9089    HRESULT rc;
     
    9897    if(SUCCEEDED(rc))
    9998        rc = machine->LaunchVMProcess(pSession, Bstr("headless").raw(),
    100             Bstr("").raw(), progress.asOutParam());
     99                                      Bstr("").raw(), progress.asOutParam());
    101100    if (SUCCEEDED(rc) && !progress.isNull())
    102101    {
     
    119118                    }
    120119                    else
    121                     {
    122120                        RTPrintf("VM '%ls' started.\n", machineName.raw());
    123                     }
    124121                }
    125122            }
    126123        }
    127         if (!skipUnlok)
    128         {
     124        if (!fSkipUnlock)
    129125            pSession->UnlockMachine();
    130         }
    131126        else
    132         {
    133127            RTPrintf("Session unlock skipped.\n");
    134         }
    135     }
    136     return rc;
    137 }
    138 
    139 
    140 static int tstStopVM(IVirtualBox* pVBox, ISession* pSession, Bstr machineID, BOOL skipUnlok)
     128    }
     129    return rc;
     130}
     131
     132
     133static int tstStopVM(IVirtualBox* pVBox, ISession* pSession, Bstr machineID, bool fSkipUnlock)
    141134{
    142135    HRESULT rc;
     
    151144        rc = TST_COM_EXPR(machine->COMGETTER(State)(&machineState));
    152145    // check that machine is in running state
    153     if (machineState == MachineState_Running
     146    if (   machineState == MachineState_Running
    154147        || machineState == MachineState_Paused)
    155148    {
     
    190183                }
    191184            }
    192             if (!skipUnlok)
    193             {
     185            if (!fSkipUnlock)
    194186                pSession->UnlockMachine();
    195             }
    196187            else
    197             {
    198188                RTPrintf("Session unlock skipped.\n");
    199             }
    200189        }
    201190    }
     
    205194
    206195/**
    207 *   Get random maxCount machines from list of existing VMs
    208 *   Note: can return less then maxCount machines
    209 */
    210 static int tstGetMachinesList(IVirtualBox *pVBox, uint32_t maxCount, TMachinesList& listToFill)
     196 * Get random @a maxCount machines from list of existing VMs.
     197 *
     198 * @note Can return less then maxCount machines.
     199 */
     200static int tstGetMachinesList(IVirtualBox *pVBox, uint32_t maxCount, TMachinesList &listToFill)
    211201{
    212202    HRESULT rc;
     
    223213        if (machines[idx])
    224214        {
    225             Bstr strId;
     215            Bstr bstrId;
    226216            Bstr machineName;
    227             CHECK_ERROR(machines[idx], COMGETTER(Id)(strId.asOutParam()));
     217            CHECK_ERROR(machines[idx], COMGETTER(Id)(bstrId.asOutParam()));
    228218            if (SUCCEEDED(rc))
    229219                CHECK_ERROR(machines[idx], COMGETTER(Name)(machineName.asOutParam()));
     
    231221            {
    232222                if (Utf8Str(machineName).startsWith("umtvm"))
    233                     listToFill.push_back(strId);
     223                    listToFill.push_back(bstrId);
    234224            }
    235225        }
     
    279269    // stop all machines in the pack
    280270    for (TMachinesList::iterator it = machinesList.begin();
    281         it != machinesList.end() && g_RunTest;
     271        it != machinesList.end() && g_RunTest;
    282272         ++it)
    283273    {
     
    304294
    305295
    306 static int tstCreateMachines(IVirtualBox* pVBox)
     296static int tstCreateMachines(IVirtualBox *pVBox)
    307297{
    308298    HRESULT rc;
     
    334324
    335325
    336 static int tstClean(IVirtualBox* pVBox, IVirtualBoxClient* pClient)
     326static int tstClean(IVirtualBox *pVBox, IVirtualBoxClient *pClient)
    337327{
    338328    HRESULT rc;
     
    494484 * Examples:
    495485 *   - tstVBoxClientWatcherLoad --packsize 500 --lock 10 --time 14400 --machines 4000
    496  *              It will create 4000 VMs with names "utmvm0"..."utmvm3999"
    497  *       It will start 500 random VMs together, stop them,
    498  *       without closing their session with probability 10%,
    499  *       will repeat this during 4 hours.
    500  *              After test it will delete all "utmvm..." machines.
     486 *     It will create 4000 VMs with names "utmvm0"..."utmvm3999".  It will start
     487 *     500 random VMs together, stop them, without closing their session with
     488 *     probability 10%, will repeat this over 4 hours.  After test it will
     489 *     delete all "utmvm..." machines.
    501490 *
    502491 *   - tstVBoxClientWatcherLoad --packsize 1 --lock 30 --time 3600 --machines 1000
    503  *              It will create 1000 VMs with names "utmvm0"..."utmvm999"
    504  *       It will start random VM - stop them,
    505  *       without closing their session with probability 30%,
    506  *       will repeat this during 30 minutes.
    507  *              After test it will delete all "utmvm..." machines.
     492 *     It will create 1000 VMs with names "utmvm0"..."utmvm999".  It will start
     493 *     random VM - stop them, without closing their session with probability
     494 *     30%, will repeat this over 30 minutes.  After test it will delete all
     495 *     "utmvm..." machines.
    508496 */
    509497int main(int argc, char **argv)
     
    530518    RTPrintf("Arguments packSize = %d, percentUnlok = %d, time = %lld.\n",
    531519             g_Args.machinesPackSize, g_Args.percentsUnlok, g_Args.cMsExecutionTime);
    532                
     520
    533521    RTTHREAD hThread;
    534522    rc = RTThreadCreate(&hThread, tstThreadRun, (void *)&g_Args,
     
    565553    }
    566554    RTSemEventDestroy(g_PingEevent);
    567                
     555
    568556    com::Shutdown();
    569557    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