提交 17ca4f64 作者: Christian Couder

t0111: use expr again to check location

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 f82526a5
...@@ -23,13 +23,16 @@ test_expect_success "HTTP gateway gives access to sample file" ' ...@@ -23,13 +23,16 @@ test_expect_success "HTTP gateway gives access to sample file" '
test_expect_success "HTTP POST file gives Hash" ' test_expect_success "HTTP POST file gives Hash" '
echo "$RANDOM" >infile && echo "$RANDOM" >infile &&
curl -svX POST --data-binary @infile http://localhost:5002/ipfs/ 2>curl.out && URL="http://localhost:5002/ipfs/" &&
grep "HTTP/1.1 201 Created" curl.out curl -svX POST --data-binary @infile "$URL" 2>curl.out &&
grep "HTTP/1.1 201 Created" curl.out &&
LOCATION=$(grep Location curl.out) &&
HASH=$(expr "$LOCATION" : "< Location: /ipfs/\(.*\)\s")
' '
test_expect_success "We can HTTP GET file just created" ' test_expect_success "We can HTTP GET file just created" '
FILEPATH=$(grep Location curl.out | cut -d" " -f3- | tr -d "\r") URL="http://localhost:5002/ipfs/$HASH" &&
curl -so outfile http://localhost:5002$FILEPATH && curl -so outfile "$URL" &&
test_cmp infile outfile test_cmp infile outfile
' '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论