From 83b3531ec2876fa76817501bf1a38d4438ac39e6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 12 May 2017 18:30:03 -0700 Subject: Add bzip2 support to tar. Also trivial cleanup of pipe -> xpipe. Bug: http://b/38215123 --- tests/files/tar/tar.tbz2 | Bin 0 -> 168 bytes tests/files/tar/tar.tgz | Bin 0 -> 166 bytes tests/tar.test | 14 ++++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 tests/files/tar/tar.tbz2 create mode 100644 tests/files/tar/tar.tgz (limited to 'tests') diff --git a/tests/files/tar/tar.tbz2 b/tests/files/tar/tar.tbz2 new file mode 100644 index 00000000..cb86319b Binary files /dev/null and b/tests/files/tar/tar.tbz2 differ diff --git a/tests/files/tar/tar.tgz b/tests/files/tar/tar.tgz new file mode 100644 index 00000000..f40c9c06 Binary files /dev/null and b/tests/files/tar/tar.tgz differ diff --git a/tests/tar.test b/tests/tar.test index 80ba5551..50a94e60 100755 --- a/tests/tar.test +++ b/tests/tar.test @@ -88,3 +88,17 @@ f="filename_with_50_chars_xxxxxxxxxxxxxxxxxxxxxxxxxxx" mkdir $d echo "This is testdata" > $d/$f testing "longname pathname" "tar -cf testFile.tar $d/$f && [ -e testFile.tar ] && echo 'yes'; rm -rf $d; tar -xf testFile.tar && [ -f $d/$f ] && cat $d/$f && strings testFile.tar | grep -o LongLink; rm -f testFile.tar; rm -rf $d" "yes\nThis is testdata\nLongLink\n" "" "" + +# gzip +rm -rf d +mkdir d +echo "hello world" > d/f +testing "gzip compression" "tar zcf f d && file f | grep -q gzip && echo y ; rm -rf d ; tar xf f && cat d/f" "y\nhello world\n" "" "" +testing "gzip decompression" "tar xf $FILES/tar/tar.tgz && cat dir/file" "hello world\n" "" "" + +# bzip2 +rm -rf d +mkdir d +echo "hello world" > d/f +testing "bzip2 compression" "tar jcf f d && file f | grep -q bzip2 && echo y ; rm -rf d ; tar xf f && cat d/f" "y\nhello world\n" "" "" +testing "bzip2 decompression" "tar xf $FILES/tar/tar.tbz2 && cat dir/file" "hello world\n" "" "" -- cgit v1.2.3