t0111: fix broken test due to bad double quoting
There was basically: curl ... "$URL 2>curl.out" instead of: curl ... "$URL" 2>curl.out So "curl.out" was not properly overwritten by the curl command. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Feb 27, 2015 at 22:09 UTC
c844fffef2b74138abf286e3c75e8b902b1e4c93
1 file changed
+6
-8
test/sharness/t0111-gateway-writable.sh
+6
-8
@@ -49,7 +49,7 @@ test_expect_success "HTTP GET empty directory" '
49
'
50
51
test_expect_success "HTTP PUT file to construct a hierarchy" '
52
- echo "$RANDOM" >infile
52
+ echo "$RANDOM" >infile &&
53
echo "PUT http://localhost:5002/ipfs/$HASH_EMPTY_DIR/test.txt" &&
54
curl -svX PUT --data-binary @infile "http://localhost:5002/ipfs/$HASH_EMPTY_DIR/test.txt" 2>curl.out &&
55
grep "HTTP/1.1 201 Created" curl.out &&
@@ -67,17 +67,15 @@ test_expect_success "We can HTTP GET file just created" '
67
68
test_expect_success "HTTP PUT file to append to existing hierarchy" '
69
echo "$RANDOM" >infile2 &&
70
- echo "PUT http://localhost:5002${FILEPATH%/test.txt}/test/test.txt" &&
71
- curl -svX PUT --data-binary @infile2 "http://localhost:5002${FILEPATH%/test.txt}/test/test.txt 2>curl.out" &&
70
+ URL="http://localhost:5002${FILEPATH%/test.txt}/test/test.txt" &&
71
+ echo "PUT $URL" &&
72
+ curl -svX PUT --data-binary @infile2 "$URL" 2>curl.out &&
73
grep "HTTP/1.1 201 Created" curl.out &&
74
grep Location curl.out
75
'
76
76
-# TODO: this seems not to be working.
77
-# $FILEPATH is set to: /ipfs/QmcpPkdv1K5Rk1bT9Y4rx4FamT7ujry2C61HMzZEAuAnms/test.txt
78
-# $FILEPATH should be set to /ipfs/<some hash>/test/test.txt
79
-test_expect_failure "We can HTTP GET file just created" '
80
- FILEPATH=$(grep Location curl.out | cut -d" " -f3- | tr -d "\r");
77
+test_expect_success "We can HTTP GET file just created" '
78
+ FILEPATH=$(grep Location curl.out | cut -d" " -f3- | tr -d "\r") &&
79
[ "$FILEPATH" = "${FILEPATH%/test/test.txt}/test/test.txt" ] &&
80
echo "GET http://localhost:5002$FILEPATH" &&
81
curl -so outfile2 "http://localhost:5002$FILEPATH" &&