[PATCH] tests: Fix commandtest in VPATH build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tests/commandtest.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index ace2f33..31adeea 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -509,9 +509,12 @@ cleanup:
  * Only stdin/out/err open
  */
 static int test15(const void *unused ATTRIBUTE_UNUSED) {
+    char *cwd = NULL;
     virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");
 
-    virCommandSetWorkingDirectory(cmd, abs_builddir "/commanddata");
+    if (virAsprintf(&cwd, "%s/commanddata", abs_srcdir) < 0)
+        return -1;
+    virCommandSetWorkingDirectory(cmd, cwd);
 
     if (virCommandRun(cmd, NULL) < 0) {
         virErrorPtr err = virGetLastError();
@@ -519,6 +522,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED) {
         return -1;
     }
 
+    VIR_FREE(cwd);
     virCommandFree(cmd);
 
     return checkoutput("test15");
-- 
1.7.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]