VirtualBox

Changeset 90899 in vbox


Ignore:
Timestamp:
Aug 26, 2021 7:58:35 AM (3 years ago)
Author:
vboxsync
Message:

Audio/VKAT: Simplified self-test. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCmdSelfTest.cpp

    r90895 r90899  
    88 *
    99 * This self-test does the following:
    10  * - 1. a) Creates an ATS instance to emulate the guest mode ("--mode guest")
    11  *         at port 6042 (ATS_TCP_DEF_BIND_PORT_GUEST).
    12  *      or
    13  *      b) Connect to an already existing guest ATS instance if "--guest-ats-address" is specified.
    14  *      This makes it more flexible in terms of testing / debugging.
     10 * - 1. Creates a separate thread for the guest side VKAT and connects to the ATS instance on
     11 *      the host side at port 6052 (ATS_TCP_DEF_BIND_PORT_HOST).
    1512 * - 2. Uses the Validation Kit audio backend, which in turn creates an ATS instance
    1613 *      listening at port 6062 (ATS_TCP_DEF_BIND_PORT_VALKIT).
     
    220217            rc = RTThreadUserWait(hThreadGstAts, RT_MS_30SEC);
    221218    }
    222     /* else Step 1a later. */
    223219
    224220    RTThreadSleep(2000); /* Fudge: Wait until guest ATS is up. 2 seconds should be enough (tm). */
     
    277273
    278274/**
    279  * Long option values for the 'selftest' command.
    280  */
    281 enum
    282 {
    283     VKAT_SELFTEST_OPT_GUEST_ATS_ADDR = 900,
    284     VKAT_SELFTEST_OPT_GUEST_ATS_PORT,
    285     VKAT_SELFTEST_OPT_HOST_ATS_ADDR,
    286     VKAT_SELFTEST_OPT_HOST_ATS_PORT
    287 };
    288 
    289 /**
    290275 * Command line parameters for self-test mode.
    291276 */
    292277static const RTGETOPTDEF s_aCmdSelftestOptions[] =
    293278{
    294     { "--guest-ats-addr",   VKAT_SELFTEST_OPT_GUEST_ATS_ADDR,   RTGETOPT_REQ_STRING  },
    295     { "--guest-ats-port",   VKAT_SELFTEST_OPT_GUEST_ATS_PORT,   RTGETOPT_REQ_UINT32  },
    296     { "--host-ats-addr",    VKAT_SELFTEST_OPT_HOST_ATS_ADDR,    RTGETOPT_REQ_STRING  },
    297     { "--host-ats-port",    VKAT_SELFTEST_OPT_HOST_ATS_PORT,    RTGETOPT_REQ_UINT32  },
    298279    { "--exclude-all",      'a',                                RTGETOPT_REQ_NOTHING },
    299280    { "--backend",          'b',                                RTGETOPT_REQ_STRING  },
     
    308289    switch (pOpt->iShort)
    309290    {
    310         case 'a':                              return "Exclude all tests from the list (useful to enable single tests later with --include)";
    311         case 'b':                              return "The audio backend to use";
    312         case 'd':                              return "Go via DrvAudio instead of directly interfacing with the backend";
    313         case 'e':                              return "Exclude the given test id from the list";
    314         case 'i':                              return "Include the given test id in the list";
    315         case VKAT_SELFTEST_OPT_GUEST_ATS_ADDR: return "Address of guest ATS to connect to\n"
    316                                                       "    Default: 127.0.0.1; will start own guest ATS";
    317         case VKAT_SELFTEST_OPT_GUEST_ATS_PORT: return "Port of guest ATS to connect to\n"
    318                                                       "    Default: 6042"; /* ATS_TCP_DEF_CONNECT_PORT_GUEST */
    319         case VKAT_SELFTEST_OPT_HOST_ATS_ADDR:  return "Address of host ATS to connect to\n"
    320                                                       "    Default: " ATS_TCP_DEF_CONNECT_HOST_ADDR_STR;
    321         case VKAT_SELFTEST_OPT_HOST_ATS_PORT:  return "Port of host ATS to connect to\n"
    322                                                       "    Default: 6052"; /* ATS_TCP_DEF_BIND_PORT_VALKIT */
     291        case 'a': return "Exclude all tests from the list (useful to enable single tests later with --include)";
     292        case 'b': return "The audio backend to use";
     293        case 'd': return "Go via DrvAudio instead of directly interfacing with the backend";
     294        case 'e': return "Exclude the given test id from the list";
     295        case 'i': return "Include the given test id in the list";
    323296        default:  return NULL;
    324297    }
     
    342315        switch (rc)
    343316        {
    344             case VKAT_SELFTEST_OPT_GUEST_ATS_ADDR:
    345                 rc = RTStrCopy(g_Ctx.Host.szGuestAtsAddr, sizeof(g_Ctx.Host.szGuestAtsAddr), ValueUnion.psz);
    346                 break;
    347 
    348             case VKAT_SELFTEST_OPT_GUEST_ATS_PORT:
    349                 g_Ctx.Host.uGuestAtsPort = ValueUnion.u32;
    350                 break;
    351 
    352             case VKAT_SELFTEST_OPT_HOST_ATS_ADDR:
    353                 rc = RTStrCopy(g_Ctx.Host.szValKitAtsAddr, sizeof(g_Ctx.Host.szValKitAtsAddr), ValueUnion.psz);
    354                 break;
    355 
    356             case VKAT_SELFTEST_OPT_HOST_ATS_PORT:
    357                 g_Ctx.Host.uValKitAtsPort = ValueUnion.u32;
    358                 break;
    359 
    360317            case 'a':
    361318                for (unsigned i = 0; i < g_cTests; i++)
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