From 17c0c7055247781438028cbcd2c466daee6c2313 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Wed, 4 Apr 2007 03:12:15 +0000 Subject: [PATCH] Add test to confirm that piping a tar archive created by bsdtar through 'bsdtar -cf- @-' doesn't alter it. --- usr.bin/tar/test/test-basic.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr.bin/tar/test/test-basic.sh b/usr.bin/tar/test/test-basic.sh index a302c526432c..435edadfcb29 100755 --- a/usr.bin/tar/test/test-basic.sh +++ b/usr.bin/tar/test/test-basic.sh @@ -359,6 +359,11 @@ mkdir filter-tar-tar (cd original && ${BSDTAR} -cf - .) | ${BSDTAR} -cf - @- | (cd filter-tar-tar; ${BSDTAR} -xf -) diff -r original filter-tar-tar || echo XXX FAILED XXX +# Make sure that reading and writing a tar archive doesn't change it. +echo " bsdtar -cf- @- | cmp" +(cd original && ${BSDTAR} -cf - .) > original.tar +${BSDTAR} -cf - @- < original.tar | cmp - original.tar || echo XXX FAILED XXX + # Filtering as format conversion echo " Convert tar archive to cpio archive" mkdir filter-tar-cpio