diff --git a/sharness/t0010-local-node.sh b/sharness/t0010-local-node.sh index 9276b57..a8b31d1 100755 --- a/sharness/t0010-local-node.sh +++ b/sharness/t0010-local-node.sh @@ -15,12 +15,12 @@ test_expect_success "create a test file" ' cat hash ' test_expect_success "retrieve a single file" ' - ipget --node=local "$( test_file && + ipfs add -q --mode=0664 --mtime=660000000 test_file > hash + cat hash +' +test_expect_success "retrieve file with mode and mtime" ' + ipget -o data.txt --node=local "/ipfs/$( out && + echo "660000000 100664" > expect && + test_cmp expect out +' + +test_expect_success "create a test directory" ' + mkdir test_dir2 && + cp test_file test_dir2/data.txt && + ipfs add --mode=0775 --mtime=660000000 -rQ test_dir2 > dir_hash +' + +test_expect_success "retrieve a directory" ' + ipget --node=local -o got_dir "/ipfs/$( out2 && + echo "660000000 40775" > expect2 && + test_cmp expect2 out2 +' + +# kill the local ipfs node +test_kill_ipfs_daemon + +test_done