]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common header file change not applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Wed, 10 Apr 2019 21:14:53 +0000 (14:14 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 10 Apr 2019 21:14:53 +0000 (14:14 -0700)
open-vm-tools/libDeployPkg/linuxDeployment.c

index 1b7bc916ab3a4daddd5e29e7524236df75d2a140..f9791968b74030b25fa5e13e54d7c68f6949a512 100644 (file)
@@ -102,8 +102,10 @@ static const char  BACKSLASH       = '\\';
 static const char* INPROGRESS      = "INPROGRESS";
 static const char* DONE            = "Done";
 static const char* ERRORED         = "ERRORED";
+#ifndef IMGCUST_UNITTEST
 static const char* RUNDIR          = "/run";
 static const char* VARRUNDIR       = "/var/run";
+#endif
 static const char* TMPDIR          = "/tmp";
 
 // Possible return codes from perl script
@@ -1222,6 +1224,11 @@ Deploy(const char* packageName)
                                TOOLSDEPLOYPKG_ERROR_SUCCESS,
                                NULL);
 
+   // Add this macro definition to enable using '/tmp' instead of '/var/run' as
+   // the cab file deployment directory in unit test.
+#ifdef IMGCUST_UNITTEST
+   baseDirPath = TMPDIR;
+#else
    // PR 2127543, Use /var/run or /run but /tmp firstly
    if (File_IsDirectory(VARRUNDIR)) {
       baseDirPath = VARRUNDIR;
@@ -1230,6 +1237,7 @@ Deploy(const char* packageName)
    } else {
       baseDirPath = TMPDIR;
    }
+#endif
 
    // Create a random name dir under base dir path
    imcDirPathSize = strlen(baseDirPath) + strlen(IMC_DIR_PATH_PATTERN) + 1;