提交 f49ec1f7 作者: Steven Allen

sharness: make put sharness test easier to follow

Address https://github.com/ipfs/go-ipfs/pull/3931#pullrequestreview-46345532

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 79fec51b
......@@ -108,11 +108,11 @@ test_expect_success "Replacing a file with PUT gives us the hash of the new tree
echo "PUT $URL" &&
curl -svX PUT --data-binary @infile3 "$URL" 2>curl_putExisting.out &&
grep "HTTP/1.1 201 Created" curl_putExisting.out &&
LOCATION=$(grep Location curl_putExisting.out) &&
IPFS_HASH=$(grep Ipfs-Hash curl_putExisting.out) &&
HASH=$(expr "$LOCATION" : "< Location: /ipfs/\(.*\)/test/test.txt") &&
IPFS_HASH=$(expr "$IPFS_HASH" : "< Ipfs-Hash: \(\w*\)") &&
[ "$HASH" = "$IPFS_HASH" ]
LOCATION_HEADER=$(grep Location curl_putExisting.out) &&
IPFS_HASH_HEADER=$(grep Ipfs-Hash curl_putExisting.out) &&
HASH1=$(expr "$LOCATION_HEADER" : "< Location: /ipfs/\(.*\)/test/test.txt") &&
HASH2=$(expr "$IPFS_HASH_HEADER" : "< Ipfs-Hash: \(\w*\)") &&
[ "$HASH2" = "$HASH1" ]
'
test_expect_success "We can HTTP GET file just replaced" '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论