btrfs-progs: tests: teach extract_image about packed streams
authorDavid Sterba <dsterba@suse.com>
Wed, 9 Nov 2016 10:39:02 +0000 (11:39 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 11 Nov 2016 15:23:29 +0000 (16:23 +0100)
Packed streams for testing purposes should be packed with 'xz -9' and
use suffix .stream.xz .

Signed-off-by: David Sterba <dsterba@suse.com>
tests/common

index 264424d..420286d 100644 (file)
@@ -128,6 +128,7 @@ check_image()
 # - dtto compressed by XZ, suffix .raw.xz
 # - meta-dump images with suffix .img
 # - dtto compressed by XZ, suffix .img.xz
+# - compressed send stream, .stream.xz
 extract_image()
 {
        local image
@@ -154,6 +155,12 @@ extract_image()
                image=${image%%.xz}
                mv "$image" "$image".restored
                ;;
+       *.stream.xz)
+               xz --decompress --keep "$image" || \
+                       _fail "failed to decompress file $image" >&2
+               image=${image%%.xz}
+               mv "$image" "$image".restored
+               ;;
        esac
 
        if ! [ -f $image.restored ]; then