set -e
cd tests
-. tests-common.sh
+srcdir="${srcdir:-.}/.."
+srcdir="$(cd $srcdir; pwd)"
+. "$srcdir/tests/tests-common.sh"
if [ ! -r /dev/fuse ]; then
echo "WARNING: /dev/fuse is not readable."
"loaded, or you aren't a member of the FUSE group?"
fi
echo "Testing extracting file from mounted read-only WIM"
- if ! cp tmp/lz.c lz.c; then
+ if ! cp tmp/lz77.c lz77.c; then
error "Failed to extract file from read-only mounted WIM"
fi
- if ! diff -q dir/lz.c lz.c; then
+ if ! diff -q dir/lz77.c lz77.c; then
error "Extracted file does not match copy in mounted WIM"
fi
- if ! diff -q tmp/lz.c dir/lz.c; then
+ if ! diff -q tmp/lz77.c dir/lz77.c; then
error "Extractef file does not match original"
fi
- rm -f lz.c
+ rm -f lz77.c
echo "Testing modifying mounted read-only WIM (should fail)"
- if rm tmp/lz.c; then
+ if rm tmp/lz77.c; then
error "Removing file from read-only mounted WIM didn't fail"
fi
if touch tmp/newfile; then
error "Creating file on read-only mounted WIM didn't fail"
fi
- if echo 3 > tmp/lz.c; then
+ if echo 3 > tmp/lz77.c; then
error "Writing to file on read-only mounted WIM didn't fail"
fi
echo "Testing diff of mounted read-only WIM with original directory"
if ! imagex mountrw dir.wim dir tmp; then
error "Failed to re-mount test WIM read-write"
fi
-if ! rm tmp/lz.c; then
+if ! rm tmp/lz77.c; then
error "Failed to remove file from read-write mounted WIM"
fi
-if test -f tmp/lz.c; then
+if test -f tmp/lz77.c; then
error "Removing file from read-write mounted WIM failed"
fi
echo "Testing making directory in mounted WIM"