VirtualBox

Changeset 83986 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Apr 27, 2020 8:13:56 AM (5 years ago)
Author:
vboxsync
Message:

Validation Kit/FsPerf: Use the temporary directory as default base directory and create a test directory beneath it, as this binary might get executed from a read-only medium such as ${CDROM}.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp

    r82968 r83986  
    63796379     * Default values.
    63806380     */
    6381     char szDefaultDir[32];
     6381    char szDefaultDir[RTPATH_MAX];
    63826382    const char *pszDir = szDefaultDir;
    6383     RTStrPrintf(szDefaultDir, sizeof(szDefaultDir), "fstestdir-%u" RTPATH_SLASH_STR, RTProcSelf());
     6383
     6384    /* As default retrieve the system's temporary directory and create a test directory beneath it,
     6385     * as this binary might get executed from a read-only medium such as ${CDROM}. */
     6386    rc = RTPathTemp(szDefaultDir, sizeof(szDefaultDir));
     6387    if (RT_SUCCESS(rc))
     6388    {
     6389        char szDirName[32];
     6390        RTStrPrintf2(szDirName, sizeof(szDirName), "fstestdir-%u" RTPATH_SLASH_STR, RTProcSelf());
     6391        rc = RTPathAppend(szDefaultDir, sizeof(szDefaultDir), szDirName);
     6392        if (RT_FAILURE(rc))
     6393        {
     6394            RTTestFailed(g_hTest, "Unable to append dir name in temp dir, rc=%Rrc\n", rc);
     6395            return RTTestSummaryAndDestroy(g_hTest);
     6396        }
     6397    }
     6398    else
     6399    {
     6400        RTTestFailed(g_hTest, "Unable to retrieve temp dir, rc=%Rrc\n", rc);
     6401        return RTTestSummaryAndDestroy(g_hTest);
     6402    }
     6403
     6404    RTTestIPrintf(RTTESTLVL_INFO, "Default directory is: %s\n", szDefaultDir);
    63846405
    63856406    bool fCommsSlave = false;
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