summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-09 11:39:02 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-11 16:23:29 +0100
commit45827710e2b9ce7351b2959efcced922752d2e3c (patch)
treeacf4cfc86c28e331c71a2e900319cccc07d617b7 /tests/common
parentc29fea434440d3fe9f21ccf320ff375c65f6d8a0 (diff)
btrfs-progs: tests: teach extract_image about packed streams
Packed streams for testing purposes should be packed with 'xz -9' and use suffix .stream.xz . Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/common b/tests/common
index 264424d3..420286d6 100644
--- a/tests/common
+++ b/tests/common
@@ -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