VirtualBox

Ignore:
Timestamp:
Jan 8, 2018 8:40:45 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120102
Message:

ValidationKit/TestExecService: Added verbose output option. Made the txsDoUnpackFile command available on windows too.

Location:
trunk/src/VBox/ValidationKit/utils/TestExecServ
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp

    r69111 r70488  
    5858#include <iprt/time.h>
    5959#include <iprt/uuid.h>
    60 
    61 #ifndef RT_OS_WINDOWS
    62 # include <iprt/zip.h>
    63 #endif
     60#include <iprt/zip.h>
    6461
    6562#include "TestExecServiceInternal.h"
     
    198195 * @todo implement signals and stuff.  */
    199196static bool volatile        g_fTerminate = false;
     197/** Verbosity level. */
     198uint32_t                    g_cVerbose = 1;
     199
    200200
    201201/**
     
    742742}
    743743
    744 #ifndef RT_OS_WINDOWS
    745744/**
    746745 * Unpacks a tar file.
     
    797796    return rc;
    798797}
    799 #endif
    800798
    801799/**
     
    27632761static RTEXITCODE txsMainLoop(void)
    27642762{
     2763    if (g_cVerbose > 0)
     2764        RTMsgInfo("txsMainLoop: start...\n");
    27652765    RTEXITCODE enmExitCode = RTEXITCODE_SUCCESS;
    27662766    while (!g_fTerminate)
     
    27732773        if (RT_FAILURE(rc))
    27742774            continue;
     2775        if (g_cVerbose > 0)
     2776            RTMsgInfo("txsMainLoop: CMD: %.8s...", pPktHdr->achOpcode);
    27752777
    27762778        /*
     
    28342836        else if (txsIsSameOpcode(pPktHdr, "GET FILE"))
    28352837            rc = txsDoGetFile(pPktHdr);
    2836 #ifndef RT_OS_WINDOWS
    28372838        else if (txsIsSameOpcode(pPktHdr, "UNPKFILE"))
    28382839            rc = txsDoUnpackFile(pPktHdr);
    2839 #endif
    28402840        /* Misc: */
    28412841        else
    28422842            rc = txsReplyUnknown(pPktHdr);
    28432843
     2844        if (g_cVerbose > 0)
     2845            RTMsgInfo("txsMainLoop: CMD: %.8s -> %Rrc", pPktHdr->achOpcode, rc);
    28442846        RTMemFree(pPktHdr);
    28452847    }
    28462848
     2849    if (g_cVerbose > 0)
     2850        RTMsgInfo("txsMainLoop: end\n");
    28472851    return enmExitCode;
    28482852}
     
    28962900static RTEXITCODE txsAutoUpdateStage2(int argc, char **argv, bool *pfExit, const char *pszUpgrading)
    28972901{
     2902    if (g_cVerbose > 0)
     2903        RTMsgInfo("Auto update stage 2...");
     2904
    28982905    /*
    28992906     * Copy the current executable onto the original.
     
    29802987static RTEXITCODE txsAutoUpdateStage1(int argc, char **argv, uint32_t cSecsCdWait, bool *pfExit)
    29812988{
     2989    if (g_cVerbose > 1)
     2990        RTMsgInfo("Auto update stage 1...");
     2991
    29822992    /*
    29832993     * Figure names of the current service image and the potential upgrade.
     
    30223032        uint64_t cNsElapsed = RTTimeNanoTS() - nsStart;
    30233033        if (cNsElapsed >= cSecsCdWait * RT_NS_1SEC_64)
     3034        {
     3035            if (g_cVerbose > 0)
     3036                RTMsgInfo("Auto update: Giving up waiting for media.");
    30243037            return RTEXITCODE_SUCCESS;
     3038        }
    30253039        RTThreadSleep(500);
    30263040    }
     
    30633077        {
    30643078            RTFileReadAllFree(pvUpgrade, cbUpgrade);
     3079            if (g_cVerbose > 0)
     3080                RTMsgInfo("Auto update: Not necessary.");
    30653081            return RTEXITCODE_SUCCESS;
    30663082        }
     
    33023318        { "--foreground",       'f', RTGETOPT_REQ_NOTHING },
    33033319        { "--daemonized",       'Z', RTGETOPT_REQ_NOTHING },
     3320        { "--quiet",            'q', RTGETOPT_REQ_NOTHING },
     3321        { "--verbose",          'v', RTGETOPT_REQ_NOTHING },
    33043322    };
    33053323
     
    33913409            case 'w':
    33923410                cSecsCdWait = Val.u32;
     3411                break;
     3412
     3413            case 'q':
     3414                g_cVerbose = 0;
     3415                break;
     3416
     3417            case 'v':
     3418                g_cVerbose++;
    33933419                break;
    33943420
     
    34483474    if (fDaemonize && !*pfExit)
    34493475    {
     3476        if (g_cVerbose > 0)
     3477            RTMsgInfo("Daemonizing...");
    34503478        rc = RTProcDaemonize(argv, "--daemonized");
    34513479        if (RT_FAILURE(rc))
     
    34823510    if (RT_FAILURE(rc))
    34833511        return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTUuidCreate failed: %Rrc", rc);
     3512    if (g_cVerbose > 0)
     3513        RTMsgInfo("Instance UUID: %RTuuid", &g_InstanceUuid);
    34843514
    34853515    /*
  • trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecServiceInternal.h

    r69111 r70488  
    212212extern TXSTRANSPORT const g_TestDevTransport;
    213213
     214extern uint32_t           g_cVerbose;
     215
    214216RT_C_DECLS_END
    215217
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