提交 1cef1702 作者: Jeromy

add small sharness test to make sure output happens

License: MIT
Signed-off-by: 's avatarJeromy <jeromyj@gmail.com>
上级 11104d40
......@@ -6,6 +6,7 @@ import (
"runtime"
cmds "github.com/ipfs/go-ipfs/commands"
config "github.com/ipfs/go-ipfs/repo/config"
manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
psud "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/shirou/gopsutil/disk"
......@@ -51,6 +52,8 @@ Prints out information about your computer to aid in easier debugging.
return
}
info["ipfs_version"] = config.CurrentVersionNumber
info["ipfs_git_sha"] = config.CurrentCommit
res.SetOutput(info)
},
}
......
#!/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
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论