Commit 0ba4a6ff authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #998 from ipfs/kkoroviev-t0030-mount

t0030-mount.sh: 2 known breakages vanished (2)
parents 178a64d6 490c8859
......@@ -276,3 +276,22 @@ test_curl_resp_http_code() {
cat curl_output
return 1
}
test_must_be_empty() {
if test -s "$1"
then
echo "'$1' is not empty, it contains:"
cat "$1"
return 1
fi
}
test_should_contain() {
test "$#" = 2 || error "bug in the test script: not 2 parameters to test_should_contain"
if ! grep -q "$1" "$2"
then
echo "'$2' does not contain '$1', it contains:"
cat "$2"
return 1
fi
}
......@@ -20,14 +20,13 @@ test_launch_ipfs_daemon
# test mount failure before mounting properly.
test_expect_success "'ipfs mount' fails when no mount dir" '
test_must_fail ipfs mount -f=not_ipfs -n=not_ipns >actual
test_expect_success "'ipfs mount' fails when there is no mount dir" '
test_must_fail ipfs mount -f=not_ipfs -n=not_ipns >output 2>output.err
'
test_expect_success "'ipfs mount' output looks good when it fails" '
! grep "IPFS mounted at: $(pwd)/ipfs" actual >/dev/null &&
! grep "IPNS mounted at: $(pwd)/ipns" actual >/dev/null ||
test_fsh cat actual
test_expect_success "'ipfs mount' output looks good" '
test_must_be_empty output &&
test_should_contain "not_ipns\|not_ipfs" output.err
'
# now mount properly, and keep going
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment