From b847cc37bbaf0a89d04428fbee004dd5010f6fcc Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Tue, 21 May 2019 22:30:03 +0900 Subject: [PATCH] tests: Test committing archives from stdin This updates test-libarchive.sh to test committing archives from stdin and verifying their content is correct. Closes: #1862 Approved by: jlebon --- tests/test-libarchive.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test-libarchive.sh b/tests/test-libarchive.sh index 0a51d442..24de55b2 100755 --- a/tests/test-libarchive.sh +++ b/tests/test-libarchive.sh @@ -28,7 +28,7 @@ fi . $(dirname $0)/libtest.sh -echo "1..13" +echo "1..17" setup_test_repository "bare" @@ -75,6 +75,16 @@ $OSTREE commit -s "from cpio" -b test-cpio \ --skip-list=skiplist.txt \ --tree=tar=foo.cpio echo "ok cpio commit" +cat foo.tar.gz | $OSTREE commit -s "from tar" -b test-tar-stdin \ + --statoverride=statoverride.txt \ + --skip-list=skiplist.txt \ + --tree=tar=- +echo "ok tar commit from stdin" +cat foo.cpio | $OSTREE commit -s "from cpio" -b test-cpio-stdin \ + --statoverride=statoverride.txt \ + --skip-list=skiplist.txt \ + --tree=tar=- +echo "ok cpio commit from stdin" assert_valid_checkout () { ref=$1 @@ -124,6 +134,10 @@ assert_valid_checkout tar echo "ok tar contents" assert_valid_checkout cpio echo "ok cpio contents" +assert_valid_checkout tar-stdin +echo "ok tar contents from stdin" +assert_valid_checkout cpio-stdin +echo "ok cpio contents from stdin" cd ${test_tmpdir} mkdir multicommit-files