提交 60081ebc 作者: Christian Couder

t0110: replace wget with curl

This removes the dependency on wget, and, while at it, cleanups a bit.

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 19245863
...@@ -23,9 +23,9 @@ apiport=$PORT_API ...@@ -23,9 +23,9 @@ apiport=$PORT_API
# for now we check 5001 here as 5002 will be checked in gateway-writable. # for now we check 5001 here as 5002 will be checked in gateway-writable.
test_expect_success "GET IPFS path succeeds" ' test_expect_success "GET IPFS path succeeds" '
echo "Hello Worlds!" > expected && echo "Hello Worlds!" >expected &&
HASH=`ipfs add -q expected` && HASH=$(ipfs add -q expected) &&
wget "http://127.0.0.1:$port/ipfs/$HASH" -O actual curl -sfo actual "http://127.0.0.1:$port/ipfs/$HASH"
' '
test_expect_success "GET IPFS path output looks good" ' test_expect_success "GET IPFS path output looks good" '
...@@ -35,13 +35,14 @@ test_expect_success "GET IPFS path output looks good" ' ...@@ -35,13 +35,14 @@ test_expect_success "GET IPFS path output looks good" '
test_expect_success "GET IPFS directory path succeeds" ' test_expect_success "GET IPFS directory path succeeds" '
mkdir dir && mkdir dir &&
echo "12345" > dir/test && echo "12345" >dir/test &&
HASH2=`ipfs add -r -q dir | tail -n 1` && ipfs add -r -q dir >actual &&
wget "http://127.0.0.1:$port/ipfs/$HASH2" HASH2=$(tail -n 1 actual) &&
curl -sf "http://127.0.0.1:$port/ipfs/$HASH2"
' '
test_expect_success "GET IPFS directory file succeeds" ' test_expect_success "GET IPFS directory file succeeds" '
wget "http://127.0.0.1:$port/ipfs/$HASH2/test" -O actual curl -sfo actual "http://127.0.0.1:$port/ipfs/$HASH2/test"
' '
test_expect_success "GET IPFS directory file output looks good" ' test_expect_success "GET IPFS directory file output looks good" '
...@@ -50,8 +51,8 @@ test_expect_success "GET IPFS directory file output looks good" ' ...@@ -50,8 +51,8 @@ test_expect_success "GET IPFS directory file output looks good" '
test_expect_failure "GET IPNS path succeeds" ' test_expect_failure "GET IPNS path succeeds" '
ipfs name publish "$HASH" && ipfs name publish "$HASH" &&
NAME=`ipfs config Identity.PeerID` && NAME=$(ipfs config Identity.PeerID) &&
wget "http://127.0.0.1:$port/ipns/$NAME" -O actual curl -sfo actual "http://127.0.0.1:$port/ipns/$NAME"
' '
test_expect_failure "GET IPNS path output looks good" ' test_expect_failure "GET IPNS path output looks good" '
...@@ -59,11 +60,11 @@ test_expect_failure "GET IPNS path output looks good" ' ...@@ -59,11 +60,11 @@ test_expect_failure "GET IPNS path output looks good" '
' '
test_expect_success "GET invalid IPFS path errors" ' test_expect_success "GET invalid IPFS path errors" '
test_must_fail wget http://127.0.0.1:$port/ipfs/12345 test_must_fail curl -sf "http://127.0.0.1:$port/ipfs/12345"
' '
test_expect_success "GET invalid path errors" ' test_expect_success "GET invalid path errors" '
test_must_fail wget http://127.0.0.1:$port/12345 test_must_fail curl -sf "http://127.0.0.1:$port/12345"
' '
test_expect_success "GET /webui returns code expected" ' test_expect_success "GET /webui returns code expected" '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论