ipld-eth-server/vendor/github.com/ipfs/go-ipfs/test/sharness/t0151-sysdiag.sh
2019-12-02 13:24:46 -06:00

49 lines
887 B
Bash
Executable File

#!/usr/bin/env bash
#
# 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 &&
grep "online" 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