-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
- Loading branch information
1 parent
366d7db
commit c7c1e72
Showing
3 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2016 Jeromy Johnson | ||
# MIT Licensed; see the LICENSE file in this repository. | ||
# | ||
|
||
test_description="Test active request commands" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
test_launch_ipfs_daemon | ||
|
||
test_expect_success "command works" ' | ||
ipfs diag cmds > cmd_out | ||
' | ||
|
||
test_expect_success "invoc shows up in output" ' | ||
grep "diag/cmds" cmd_out > /dev/null | ||
' | ||
|
||
test_expect_success "start longer running command" ' | ||
ipfs log tail & | ||
LOGPID=$! | ||
' | ||
|
||
test_expect_success "long running command shows up" ' | ||
ipfs diag cmds > cmd_out2 | ||
' | ||
|
||
test_expect_success "output looks good" ' | ||
grep "log/tail" cmd_out2 | grep "true" > /dev/null | ||
' | ||
|
||
test_expect_success "kill log cmd" ' | ||
kill $LOGPID | ||
go-sleep 0.5s | ||
kill $LOGPID | ||
wait $LOGPID || true | ||
' | ||
|
||
test_expect_success "long running command inactive" ' | ||
ipfs diag cmds > cmd_out3 | ||
' | ||
|
||
test_expect_success "command shows up as inactive" ' | ||
grep "log/tail" cmd_out3 | grep "false" | ||
' | ||
|
||
test_kill_ipfs_daemon | ||
test_done |
c7c1e72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sharness tests LGTM!