1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-02 03:28:25 +08:00

split the tests

This commit is contained in:
bbenshoof
2015-03-02 17:54:23 -05:00
parent ac5cfc5664
commit ed179263f4

View File

@ -66,31 +66,22 @@ test_expect_success "GET invalid path errors" '
'
test_expect_success "GET webui forwards" '
curl -I http://127.0.0.1:5001/webui | head -c 18 > actual1
curl -I http://127.0.0.1:5001/webui/ | head -c 18 > actual2
echo "HTTP/1.1 302 Found" | head -c 18 > expected
echo "HTTP/1.1 301 Moved Permanently" | head -c 18 > also_ok
cat actual1
cat actual2
cat expected
cat also_ok
(test_cmp expected actual1 || test_cmp actual1 also_ok)&&
(test_cmp expected actual2 || test_cmp actual2 also_ok)&&
test_expect_success "GET /webui returns code expected" '
echo "HTTP/1.1 302 Found" | head -c 18 > expected &&
echo "HTTP/1.1 301 Moved Permanently" | head -c 18 > also_ok &&
curl -I http://127.0.0.1:5001/webui | head -c 18 > actual1 &&
(test_cmp expected actual1 || test_cmp actual1 also_ok) &&
rm actual1
'
test_expect_success "GET /webui/ returns code expected" '
curl -I http://127.0.0.1:5001/webui/ | head -c 18 > actual2 &&
(test_cmp expected actual2 || test_cmp actual2 also_ok) &&
rm expected &&
rm also_ok &&
rm actual1 &&
rm actual2
'
#TODO make following test work
#test_expect_success "GET webui loads" '
# curl http://127.0.0.1:5001/ipfs/$webui_hash | head -n 1 > actual1
#
# rm expected &&
# rm actual1 &&
# rm actual2
#'
test_kill_ipfs_daemon