X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=tests%2Ftest-imagex-capture_and_apply;h=672c8ae37d37943216e687fb0568724b6b158922;hb=a5f0f107247cc6400c0bd25f41e49d658fd2b7d7;hp=5de3b0e20de5e35555977a83cb72ad5e1c07fefb;hpb=594502d26951aa89e374599de862486c1e7a6878;p=wimlib diff --git a/tests/test-imagex-capture_and_apply b/tests/test-imagex-capture_and_apply index 5de3b0e2..672c8ae3 100755 --- a/tests/test-imagex-capture_and_apply +++ b/tests/test-imagex-capture_and_apply @@ -53,7 +53,10 @@ do_test() { # Can we split the WIM, apply the split WIM, join the split WIM, # and apply the joined WIM, and get the same results every time? - if ! imagex split test.wim test.swm 0.01; then + # + # LC_ALL=C avoids locale-dependent floating point number + # parsing. + if ! LC_ALL=C imagex split test.wim test.swm 0.01; then error "Failed to split WIM" fi if ! imagex apply test.swm 1 out.dir --ref "test*.swm" ; then @@ -81,6 +84,41 @@ do_test() { error "Failed to apply exported WIM image" fi do_tree_cmp + rm -rf out.dir/* + + # Try pipable WIM (don't bother testing all compression types + # though, it shouldn't make a difference). + if [ "$ctype" = "None" ]; then + # Capture pipable WIM (not writing to pipe) + if ! imagex capture in.dir test.wim \ + --compress=$ctype --norpfix --pipable; then + error "Failed to capture directory tree into a pipable WIM" + fi + + # Apply pipable WIM (reading from pipe) + if ! cat test.wim | imagex apply - 1 out.dir; then + error "Failed to apply pipable WIM to directory (from pipe)" + fi + do_tree_cmp + rm -rf out.dir/* + + # Apply pipable WIM (not reading from pipe) + if ! imagex apply test.wim 1 out.dir; then + error "Failed to apply pipable WIM to directory (not from pipe)" + fi + do_tree_cmp + rm -rf out.dir/* + + # Capture pipable WIM (writing to pipe) and read pipable + # WIM (reading from pipe) + if ! imagex_raw capture --pipable --compress=$ctype \ + --norpfix --pipable \ + in.dir - | imagex apply - 1 out.dir; then + error "Failed to capture directory tree into a pipable WIM" + fi + do_tree_cmp + rm -rf out.dir/* + fi rm -rf out.dir/* in.dir/* test.wim test*.swm @@ -132,9 +170,9 @@ if [[ `readlink out.dir/absrootlink` != "/" ]] || error "imagex capture --rpfix failed to fix absolute link to capture root" fi -if [[ -e out.dir/absnonexistent ]] || - [[ -e out.dir/absoutoftree ]]; then - error "imagex capture --rpfix failed to exclude out of tree absolute links" +if [[ ! -L out.dir/absnonexistent ]] || + [[ ! -L out.dir/absoutoftree ]]; then + error "imagex capture --rpfix failed to also capture out of tree absolute links" fi if [[ `readlink out.dir/relalink` != "file" ]]; then error "imagex capture --rpfix failed to capture relative symlink"