]> wimlib.net Git - wimlib/blobdiff - tests/test-imagex-mount
imagex.c: Free additional_swms when done with it
[wimlib] / tests / test-imagex-mount
index 2317aa607b0211a5ddc8216420e7c4c980927053..21702c0797214d45c84872a74697ea813d978191 100755 (executable)
@@ -3,9 +3,8 @@
 # Test WIM mounting
 
 set -e
-srcdir=${srcdir:-.}
-srcdir=`realpath $srcdir`
 cd tests
+srcdir=..
 
 imagex() {
        echo "imagex $@"
@@ -27,12 +26,8 @@ imagex_mountrw() {
 }
 
 cleanup() {
-       if mountpoint tmp &> /dev/null; then
-               fusermount -u tmp > /dev/null;
-       fi
-       if mountpoint tmp.mnt &> /dev/null; then
-               fusermount -u tmp.mnt > /dev/null;
-       fi
+       fusermount -u tmp &> /dev/null || true
+       fusermount -u tmp.mnt &> /dev/null || true
        rm -rf dir* tmp* *.wim *.swm empty.wim tmp.orig tmp.mnt \
                        tmp.apply mount.log test.tar wimlib-staging*
 }
@@ -266,7 +261,7 @@ do_test() {
        rm -rf tmp.orig/* tmp.apply/*
 }
 
-. common_tests.sh
+. $srcdir/tests/common_tests.sh
 
 cleanup