Skip to content

Commit

Permalink
t0041: Test named-pipe errors
Browse files Browse the repository at this point in the history
Make sure we neither hang nor silently tread named pipes as regular
files.

License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Jun 24, 2015
1 parent 49c8aab commit dd9bad0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/sharness/t0041-add-cat-offline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,19 @@ test_expect_success "output looks good" '
test_cmp afile out_2
'

test_expect_success "useful error message when adding a named pipe" '
mkfifo named-pipe
test_expect_code 1 ipfs add named-pipe 2>named-pipe-error
echo "Error: \`named-pipe\` is an unknown type" >named-pipe-error-expected
test_cmp named-pipe-error-expected named-pipe-error
'

test_expect_success "useful error message when recursively adding a named pipe" '
mkdir named-pipe-dir
mkfifo named-pipe-dir/named-pipe
test_expect_code 1 ipfs add -r named-pipe-dir 2>named-pipe-dir-error
echo "Error: \`named-pipe-dir/named-pipe\` is an unknown type" >named-pipe-dir-error-expected
test_cmp named-pipe-dir-error-expected named-pipe-dir-error
'

test_done

0 comments on commit dd9bad0

Please sign in to comment.