Skip to content

Commit

Permalink
Merge pull request #362 from chriscool/mount_bugs
Browse files Browse the repository at this point in the history
Add sharness tests to document existing mount bugs
  • Loading branch information
jbenet committed Nov 19, 2014
2 parents b38f01e + 882aac2 commit cefb014
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
23 changes: 14 additions & 9 deletions test/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ test_wait_output_n_lines_60_sec() {
test_cmp "expected_waitn" "actual_waitn"
}

test_launch_ipfs_daemon() {

test_expect_success FUSE "'ipfs daemon' succeeds" '
ipfs daemon >actual &
'

test_expect_success FUSE "'ipfs daemon' output looks good" '
IPFS_PID=$! &&
echo "daemon listening on /ip4/127.0.0.1/tcp/5001" >expected &&
test_cmp_repeat_10_sec expected actual
'
}

test_launch_ipfs_mount() {

test_expect_success "ipfs init succeeds" '
Expand All @@ -64,15 +77,7 @@ test_launch_ipfs_mount() {
ipfs config Mounts.IPNS "$(pwd)/ipns"
'

test_expect_success FUSE "'ipfs daemon' succeeds" '
ipfs daemon >actual &
'

test_expect_success FUSE "'ipfs daemon' output looks good" '
IPFS_PID=$! &&
echo "daemon listening on /ip4/127.0.0.1/tcp/5001" >expected &&
test_cmp_repeat_10_sec expected actual
'
test_launch_ipfs_daemon

test_expect_success FUSE "'ipfs mount' succeeds" '
ipfs mount >actual
Expand Down
17 changes: 17 additions & 0 deletions test/t0030-mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,21 @@ test_launch_ipfs_mount

test_kill_ipfs_mount

test_expect_success "mount directories can be removed" '
rmdir ipfs ipns
'

test_launch_ipfs_daemon

test_expect_failure "'ipfs mount' fails when no mount dir (issue #341)" '
test_must_fail ipfs mount >actual
'

test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" '
! grep "IPFS mounted at" actual &&
! grep "IPNS mounted at" actual
'

test_kill_ipfs_mount

test_done

0 comments on commit cefb014

Please sign in to comment.