]> wimlib.net Git - wimlib/blobdiff - tests/test-imagex
README.WINDOWS: fix category of p7zip
[wimlib] / tests / test-imagex
index fe931321a760476b63d0d89c3b5793c46f089a02..9c92715b1fca95a100939f7066088a632e535bf4 100755 (executable)
@@ -7,7 +7,7 @@ set -e
 cd tests
 srcdir="${srcdir:-.}/.."
 srcdir="$(cd $srcdir; pwd)"
-. "$srcdir/tests/tests-common.sh"
+. "$srcdir/tests/test_utils.sh"
 
 TEST_SUBDIR=tmpdir_test-imagex
 
@@ -65,6 +65,21 @@ for comp_type in None LZX XPRESS; do
        rm -rf dir.wim tmp
 done
 
+# Test wimappend --create
+rm -f dir.wim
+if wimappend dir dir.wim; then
+       error "wimappend to nonexisting file unexpectedly succeeded"
+fi
+if ! wimappend dir dir.wim --create; then
+       error "wimappend --create to nonexisting file failed"
+fi
+if ! wimappend dir dir.wim --create; then
+       error "wimappend --create to existing file failed"
+fi
+if ! test "`wiminfo dir.wim | grep 'Image Count' | awk '{print $3}'`" = 2; then
+       error "Incorrect WIM image count after wimappend --create"
+fi
+
 # Capturing and modifying name, description, and bootable flag
 
 echo "Testing capture of WIM with default name and description"