]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
Fix test_reload for lxcfs chroot
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 16 Aug 2016 16:36:01 +0000 (12:36 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 16 Aug 2016 16:36:01 +0000 (12:36 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
bindings.c
tests/test_reload.sh

index 04f0b085a880574ea833ef2958d465924eaffebd..2fb4acffcac7807b658bc9394f32d26b0dbe57a0 100644 (file)
@@ -3610,17 +3610,9 @@ out:
 #if RELOADTEST
 void iwashere(void)
 {
-       char *name, *cwd = get_current_dir_name();
-       size_t len;
        int fd;
 
-       if (!cwd)
-               exit(1);
-       len = strlen(cwd) + strlen("/iwashere") + 1;
-       name = alloca(len);
-       snprintf(name, len, "%s/iwashere", cwd);
-       free(cwd);
-       fd = creat(name, 0755);
+       fd = creat("/tmp/lxcfs-iwashere", 0644);
        if (fd >= 0)
                close(fd);
 }
index 5474cbb3fb66839cddb649937eb2cea9e56de621..5e37ace2f0b4b90561d26767db2716e8fc067e1f 100755 (executable)
@@ -26,7 +26,7 @@ cleanup() {
     umount -l ${testdir}
   fi
   rm -rf ${testdir} ${installdir}
-  rm -f iwashere
+  rm -f /tmp/lxcfs-iwashere
   rm -f ${pidfile}
   if [ ${FAILED} -eq 1 ]; then
     echo "liblxcfs.so reload test FAILED"
@@ -50,9 +50,9 @@ while [ ! -d ${testdir}/proc ]; do
   count=$((count+1))
 done
 
-rm -f iwashere
+rm -f /tmp/lxcfs-iwashere
 cat ${testdir}/proc/uptime
-[ ! -f iwashere ]
+[ ! -f /tmp/lxcfs-iwashere ]
 (
   cd ${topdir};
   make liblxcfstest.la
@@ -65,5 +65,5 @@ cp ${libdir}/liblxcfstest.so ${libdir}/liblxcfs.so
 kill -USR1 ${lxcfspid}
 
 cat ${testdir}/proc/uptime
-[ -f iwashere ]
+[ -f /tmp/lxcfs-iwashere ]
 FAILED=0