X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=tests%2Ftest-imagex-mount;h=49585e8a7ec4d999ea078e5a2451ec2ed52162f0;hb=b2309a90c9fd41a5f24c70595ed4e78e49916a0c;hp=bbe931ffb9d9e009a082f9dc2f69e4131b82ebef;hpb=466646c4f936eb3387b76dcb9a41e7b8cfb98fe2;p=wimlib diff --git a/tests/test-imagex-mount b/tests/test-imagex-mount index bbe931ff..49585e8a 100755 --- a/tests/test-imagex-mount +++ b/tests/test-imagex-mount @@ -10,11 +10,11 @@ srcdir="$(cd $srcdir; pwd)" TEST_SUBDIR=tmpdir_test-imagex-mount -if [ ! -r /dev/fuse ]; then - echo "WARNING: /dev/fuse is not readable." - echo "Skipping WIM mounting checks" - exit 0 -fi +skip_test() { + cd .. + cleanup + exit 77 +} imagex_unmount() { # Give the --lazy flag to work around a problem testing on Ubuntu and @@ -48,6 +48,12 @@ init() { imagex capture tmp.empty empty.wim --norpfix } +if [ ! -r /dev/fuse ] || [ ! -w /dev/fuse ]; then + echo "WARNING: /dev/fuse is not readable and writable." + echo "Skipping WIM mounting checks" + skip_test +fi + cleanup mkdir $TEST_SUBDIR cd $TEST_SUBDIR @@ -69,24 +75,24 @@ for flag in "--compress=none" "--compress=maximum" "--compress=fast"; do "loaded, or you aren't a member of the FUSE group?" fi echo "Testing extracting file from mounted read-only WIM" - if ! cp tmp/lz77.c lz77.c; then + if ! cp tmp/write.c write.c; then error "Failed to extract file from read-only mounted WIM" fi - if ! diff -q dir/lz77.c lz77.c; then + if ! diff -q dir/write.c write.c; then error "Extracted file does not match copy in mounted WIM" fi - if ! diff -q tmp/lz77.c dir/lz77.c; then + if ! diff -q tmp/write.c dir/write.c; then error "Extractef file does not match original" fi - rm -f lz77.c + rm -f write.c echo "Testing modifying mounted read-only WIM (should fail)" - if rm tmp/lz77.c; then + if rm tmp/write.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/lz77.c; then + if echo 3 > tmp/write.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" @@ -131,10 +137,10 @@ echo "Testing removing file from mounted WIM" if ! imagex mountrw dir.wim dir tmp; then error "Failed to re-mount test WIM read-write" fi -if ! rm tmp/lz77.c; then +if ! rm tmp/write.c; then error "Failed to remove file from read-write mounted WIM" fi -if test -f tmp/lz77.c; then +if test -f tmp/write.c; then error "Removing file from read-write mounted WIM failed" fi echo "Testing making directory in mounted WIM"