From aaf30ba20a1e789d252eba74fa0839877d0e337c Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 20 Apr 2021 15:24:48 +0200 Subject: [PATCH] car: Add sharness test for adding car file --- sharness/t0031-ctl-add.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sharness/t0031-ctl-add.sh b/sharness/t0031-ctl-add.sh index 2f81a52d..d4580e89 100755 --- a/sharness/t0031-ctl-add.sh +++ b/sharness/t0031-ctl-add.sh @@ -58,6 +58,18 @@ test_expect_success IPFS,CLUSTER "add files locally and compare with ipfs" ' test_cmp cidscluster.txt cidsipfs.txt ' +test_expect_success IPFS,CLUSTER "add CAR file" ' + mkdir testFolderCar + echo "abc" > testFolderCar/abc.txt + docker cp testFolderCar ipfs:/tmp/testFolderCar + + ipfsCmd add -Q -w -r /tmp/testFolderCar >> caripfs.txt + ipfsCmd dag export `cat caripfs.txt` > test.car + docker cp ipfs:/tmp/test.car test.car + ipfs-cluster-ctl add --format car -Q test.car >> carcluster.txt + test_cmp carcluster.txt caripfs.txt +' + # Adding a folder with a single file is the same as adding the file # and wrapping it. test_expect_success IPFS,CLUSTER "check add folders" '