VirtualBox

Changeset 27514 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 19, 2010 2:21:03 AM (15 years ago)
Author:
vboxsync
Message:

tstRTProcCreateEx: Don't execute the as-user testcase by default; testcases are supposed to work by default without requiring weird users to be created.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp

    r27509 r27514  
    7575};
    7676
     77
    7778static int tstRTCreateProcEx5Child(int argc, char **argv)
    7879{
     
    139140}
    140141
    141 static void tstRTCreateProcEx5(void)
    142 {
    143     RTTestISub("Impersonation (as user \"test\")");
     142static void tstRTCreateProcEx5(const char *pszUser, const char *pszPassword)
     143{
     144    RTTestISubF("As user \"%s\" with password \"%s\"", pszUser, pszPassword);
    144145
    145146    const char * apszArgs[3] =
     
    152153    RTPROCESS hProc;
    153154    RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, 0 /*fFlags*/, NULL,
    154                                          NULL, NULL, "testcase", "test", &hProc), VINF_SUCCESS);
     155                                         NULL, NULL, pszUser, pszPassword, &hProc), VINF_SUCCESS);
    155156    RTPROCSTATUS ProcStatus = { -1, RTPROCEXITREASON_ABEND };
    156157    RTTESTI_CHECK_RC(RTProcWait(hProc, RTPROCWAIT_FLAGS_BLOCK, &ProcStatus), VINF_SUCCESS);
     
    412413    if (argc == 2 && !strcmp(argv[1], "--testcase-child-5"))
    413414        return tstRTCreateProcEx5Child(argc, argv);
     415    const char *pszAsUser   = NULL;
     416    const char *pszPassword = NULL;
    414417    if (argc != 1)
    415         return 99;
     418    {
     419        if (argc != 4 || strcmp(argv[1], "--as-user"))
     420            return 99;
     421        pszAsUser   = argv[2];
     422        pszPassword = argv[4];
     423    }
    416424
    417425    RTTEST hTest;
     
    431439    tstRTCreateProcEx3();
    432440    tstRTCreateProcEx4();
    433     /** @todo Do not run tstRTCreateProcEx5 on NT4, may not work (?) */
    434     tstRTCreateProcEx5();
     441    if (pszAsUser)
     442    {
     443        /** @todo Do not run tstRTCreateProcEx5 on NT4, may not work (?) */
     444        tstRTCreateProcEx5(pszAsUser, pszPassword);
     445    }
    435446    /** @todo Cover files, ++ */
    436447
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