Commit fa13afa5 authored by Christian Couder's avatar Christian Couder

Replace fsh with test_fsh in sharness tests

License: MIT
Signed-off-by: default avatarChristian Couder <chriscool@tuxfamily.org>
parent 65cbbdff
...@@ -52,12 +52,12 @@ test_expect_success ".go-ipfs/ has been created" ' ...@@ -52,12 +52,12 @@ test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" && test -d ".go-ipfs" &&
test -f ".go-ipfs/config" && test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore" || test -d ".go-ipfs/datastore" ||
fsh ls -al .go-ipfs test_fsh ls -al .go-ipfs
' '
``` ```
The `|| ...` is a diagnostic run when the preceding command fails. The `|| ...` is a diagnostic run when the preceding command fails.
`bin/fsh` is a trivial script that echoes the args, runs the cmd, test_fsh is a shell function that echoes the args, runs the cmd,
and then also fails, making sure the test case fails. (wouldnt want and then also fails, making sure the test case fails. (wouldnt want
the diagnostic accidentally returning true and making it _seem_ like the diagnostic accidentally returning true and making it _seem_ like
the test case succeeded!). the test case succeeded!).
......
...@@ -18,7 +18,7 @@ test_expect_success "ipfs version succeeds" ' ...@@ -18,7 +18,7 @@ test_expect_success "ipfs version succeeds" '
test_expect_success "ipfs version output looks good" ' test_expect_success "ipfs version output looks good" '
cat version.txt | egrep "^ipfs version [0-9]+\.[0-9]+\.[0-9]" >/dev/null || cat version.txt | egrep "^ipfs version [0-9]+\.[0-9]+\.[0-9]" >/dev/null ||
fsh cat version.txt test_fsh cat version.txt
' '
test_expect_success "ipfs help succeeds" ' test_expect_success "ipfs help succeeds" '
...@@ -28,7 +28,7 @@ test_expect_success "ipfs help succeeds" ' ...@@ -28,7 +28,7 @@ test_expect_success "ipfs help succeeds" '
test_expect_success "ipfs help output looks good" ' test_expect_success "ipfs help output looks good" '
cat help.txt | egrep -i "^Usage:" >/dev/null && cat help.txt | egrep -i "^Usage:" >/dev/null &&
cat help.txt | egrep "ipfs .* <command>" >/dev/null || cat help.txt | egrep "ipfs .* <command>" >/dev/null ||
fsh cat help.txt test_fsh cat help.txt
' '
test_done test_done
...@@ -18,7 +18,7 @@ test_expect_success ".go-ipfs/ has been created" ' ...@@ -18,7 +18,7 @@ test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" && test -d ".go-ipfs" &&
test -f ".go-ipfs/config" && test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore" || test -d ".go-ipfs/datastore" ||
fsh ls -al .go-ipfs test_fsh ls -al .go-ipfs
' '
test_expect_success "ipfs config succeeds" ' test_expect_success "ipfs config succeeds" '
......
...@@ -27,7 +27,7 @@ test_expect_failure "'ipfs mount' fails when no mount dir (issue #341)" ' ...@@ -27,7 +27,7 @@ test_expect_failure "'ipfs mount' fails when no mount dir (issue #341)" '
test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" ' test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" '
! grep "IPFS mounted at: $(pwd)/ipfs" actual >/dev/null && ! grep "IPFS mounted at: $(pwd)/ipfs" actual >/dev/null &&
! grep "IPNS mounted at: $(pwd)/ipns" actual >/dev/null || ! grep "IPNS mounted at: $(pwd)/ipns" actual >/dev/null ||
fsh cat actual test_fsh cat actual
' '
# now mount properly, and keep going # now mount properly, and keep going
......
...@@ -16,7 +16,7 @@ test_expect_success "'ipfs add --help' succeeds" ' ...@@ -16,7 +16,7 @@ test_expect_success "'ipfs add --help' succeeds" '
test_expect_success "'ipfs add --help' output looks good" ' test_expect_success "'ipfs add --help' output looks good" '
egrep "ipfs add.*<path>" actual >/dev/null || egrep "ipfs add.*<path>" actual >/dev/null ||
fsh cat actual test_fsh cat actual
' '
test_expect_success "'ipfs cat --help' succeeds" ' test_expect_success "'ipfs cat --help' succeeds" '
...@@ -25,7 +25,7 @@ test_expect_success "'ipfs cat --help' succeeds" ' ...@@ -25,7 +25,7 @@ test_expect_success "'ipfs cat --help' succeeds" '
test_expect_success "'ipfs cat --help' output looks good" ' test_expect_success "'ipfs cat --help' output looks good" '
egrep "ipfs cat.*<ipfs-path>" actual >/dev/null || egrep "ipfs cat.*<ipfs-path>" actual >/dev/null ||
fsh cat actual test_fsh cat actual
' '
test_expect_success "ipfs add succeeds" ' test_expect_success "ipfs add succeeds" '
......
...@@ -48,7 +48,7 @@ test_expect_success ".go-ipfs/ has been created" ' ...@@ -48,7 +48,7 @@ test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" && test -d ".go-ipfs" &&
test -f ".go-ipfs/config" && test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore" || test -d ".go-ipfs/datastore" ||
fsh ls .go-ipfs test_fsh ls .go-ipfs
' '
test_expect_success "daemon is still running" ' test_expect_success "daemon is still running" '
......
...@@ -17,7 +17,7 @@ test_expect_success "'ipfs get --help' succeeds" ' ...@@ -17,7 +17,7 @@ test_expect_success "'ipfs get --help' succeeds" '
test_expect_success "'ipfs get --help' output looks good" ' test_expect_success "'ipfs get --help' output looks good" '
egrep "ipfs get.*<ipfs-path>" actual >/dev/null || egrep "ipfs get.*<ipfs-path>" actual >/dev/null ||
fsh cat actual test_fsh cat actual
' '
test_expect_success "ipfs get succeeds" ' test_expect_success "ipfs get succeeds" '
......
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