split the tests
bbenshoof committed
Mar 2, 2015 at 17:54 UTC
ed179263f4987ae21cc8c0fde2cde0c22db9369c
1 file changed
+11
-20
test/sharness/t0110-gateway.sh
+11
-20
@@ -66,31 +66,22 @@ test_expect_success "GET invalid path errors" '
66
'
67
68
69
-test_expect_success "GET webui forwards" '
70
- curl -I http://127.0.0.1:5001/webui | head -c 18 > actual1
71
- curl -I http://127.0.0.1:5001/webui/ | head -c 18 > actual2
72
- echo "HTTP/1.1 302 Found" | head -c 18 > expected
73
- echo "HTTP/1.1 301 Moved Permanently" | head -c 18 > also_ok
74
- cat actual1
75
- cat actual2
76
- cat expected
77
- cat also_ok
78
- (test_cmp expected actual1 || test_cmp actual1 also_ok)&&
79
- (test_cmp expected actual2 || test_cmp actual2 also_ok)&&
69
+test_expect_success "GET /webui returns code expected" '
70
+ echo "HTTP/1.1 302 Found" | head -c 18 > expected &&
71
+ echo "HTTP/1.1 301 Moved Permanently" | head -c 18 > also_ok &&
72
+ curl -I http://127.0.0.1:5001/webui | head -c 18 > actual1 &&
73
+ (test_cmp expected actual1 || test_cmp actual1 also_ok) &&
74
+ rm actual1
75
+'
76
+
77
+test_expect_success "GET /webui/ returns code expected" '
78
+ curl -I http://127.0.0.1:5001/webui/ | head -c 18 > actual2 &&
79
+ (test_cmp expected actual2 || test_cmp actual2 also_ok) &&
80
rm expected &&
81
rm also_ok &&
82
- rm actual1 &&
82
rm actual2
83
'
84
86
-#TODO make following test work
87
-#test_expect_success "GET webui loads" '
88
-# curl http://127.0.0.1:5001/ipfs/$webui_hash | head -n 1 > actual1
89
-#
90
-# rm expected &&
91
-# rm actual1 &&
92
-# rm actual2
93
-#'
85
86
test_kill_ipfs_daemon
87