Skip to content

Commit

Permalink
t0040: 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 2412cca commit 49c8aab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/sharness/t0040-add-and-cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ test_expect_success "ipfs add -w output looks good" '
test_cmp expected actual
'

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_kill_ipfs_daemon

test_done

0 comments on commit 49c8aab

Please sign in to comment.