t0110: replace wget with curl
This removes the dependency on wget, and, while at it, cleanups a bit. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Mar 8, 2015 at 08:16 UTC
60081ebc3b622b5ca2ba4f8816e4cf77ab0efc38
1 file changed
+12
-11
test/sharness/t0110-gateway.sh
+12
-11
@@ -23,9 +23,9 @@ apiport=$PORT_API
23
# for now we check 5001 here as 5002 will be checked in gateway-writable.
24
25
test_expect_success "GET IPFS path succeeds" '
26
- echo "Hello Worlds!" > expected &&
27
- HASH=`ipfs add -q expected` &&
28
- wget "http://127.0.0.1:$port/ipfs/$HASH" -O actual
26
+ echo "Hello Worlds!" >expected &&
27
+ HASH=$(ipfs add -q expected) &&
28
+ curl -sfo actual "http://127.0.0.1:$port/ipfs/$HASH"
29
'
30
31
test_expect_success "GET IPFS path output looks good" '
@@ -35,13 +35,14 @@ test_expect_success "GET IPFS path output looks good" '
35
36
test_expect_success "GET IPFS directory path succeeds" '
37
mkdir dir &&
38
- echo "12345" > dir/test &&
39
- HASH2=`ipfs add -r -q dir | tail -n 1` &&
40
- wget "http://127.0.0.1:$port/ipfs/$HASH2"
38
+ echo "12345" >dir/test &&
39
+ ipfs add -r -q dir >actual &&
40
+ HASH2=$(tail -n 1 actual) &&
41
+ curl -sf "http://127.0.0.1:$port/ipfs/$HASH2"
42
'
43
44
test_expect_success "GET IPFS directory file succeeds" '
44
- wget "http://127.0.0.1:$port/ipfs/$HASH2/test" -O actual
45
+ curl -sfo actual "http://127.0.0.1:$port/ipfs/$HASH2/test"
46
'
47
48
test_expect_success "GET IPFS directory file output looks good" '
@@ -50,8 +51,8 @@ test_expect_success "GET IPFS directory file output looks good" '
51
52
test_expect_failure "GET IPNS path succeeds" '
53
ipfs name publish "$HASH" &&
53
- NAME=`ipfs config Identity.PeerID` &&
54
- wget "http://127.0.0.1:$port/ipns/$NAME" -O actual
54
+ NAME=$(ipfs config Identity.PeerID) &&
55
+ curl -sfo actual "http://127.0.0.1:$port/ipns/$NAME"
56
'
57
58
test_expect_failure "GET IPNS path output looks good" '
@@ -59,11 +60,11 @@ test_expect_failure "GET IPNS path output looks good" '
60
'
61
62
test_expect_success "GET invalid IPFS path errors" '
62
- test_must_fail wget http://127.0.0.1:$port/ipfs/12345
63
+ test_must_fail curl -sf "http://127.0.0.1:$port/ipfs/12345"
64
'
65
66
test_expect_success "GET invalid path errors" '
66
- test_must_fail wget http://127.0.0.1:$port/12345
67
+ test_must_fail curl -sf "http://127.0.0.1:$port/12345"
68
'
69
70
test_expect_success "GET /webui returns code expected" '