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

41 lines
702 B
Bash
Executable File

#!/usr/bin/env bash
#
# Copyright (c) 2017 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="Test shutdown command"
. lib/test-lib.sh
test_init_ipfs
test_launch_ipfs_daemon
test_expect_success "shutdown succeeds" '
ipfs shutdown
'
test_expect_success "daemon no longer running" '
for i in $(test_seq 1 100)
do
go-sleep 100ms
! kill -0 $IPFS_PID 2>/dev/null && return
done
'
test_launch_ipfs_daemon --offline
test_expect_success "shutdown succeeds" '
ipfs shutdown
'
test_expect_success "daemon no longer running" '
for i in $(test_seq 1 100)
do
go-sleep 100ms
! kill -0 $IPFS_PID 2>/dev/null && return
done
'
test_done