-
-
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.
add small sharness test to make sure output happens
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
- Loading branch information
1 parent
11104d4
commit 1cef170
Showing
2 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2015 Jeromy Johnson | ||
# MIT Licensed; see the LICENSE file in this repository. | ||
# | ||
|
||
test_description="test output of sysdiag command" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
|
||
test_expect_success "ipfs diag sys succeeds" ' | ||
ipfs diag sys > output | ||
' | ||
|
||
test_expect_success "output contains some expected keys" ' | ||
grep "virt" output && | ||
grep "interface_addresses" output && | ||
grep "arch" output | ||
' | ||
|
||
test_expect_success "uname succeeds" ' | ||
UOUT=$(uname) | ||
' | ||
|
||
test_expect_success "output is similar to uname" ' | ||
case $UOUT in | ||
Linux) | ||
grep linux output > /dev/null | ||
;; | ||
Darwin) | ||
grep darwin output > /dev/null | ||
;; | ||
FreeBSD) | ||
grep freebsd output > /dev/null | ||
;; | ||
CYGWIN*) | ||
grep windows output > /dev/null | ||
;; | ||
*) | ||
test_fsh echo system check for $UOUT failed, unsupported system? | ||
;; | ||
esac | ||
' | ||
|
||
test_done |