t0020-init.sh 550 Bytes
Newer Older
1 2 3 4 5 6 7 8
#!/bin/sh
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#

test_description="Test init command"

9
. lib/test-lib.sh
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

test_expect_success "ipfs init succeeds" '
	export IPFS_DIR="$(pwd)/.go-ipfs" &&
	ipfs init
'

test_expect_success ".go-ipfs/ has been created" '
	test -d ".go-ipfs" &&
	test -f ".go-ipfs/config" &&
	test -d ".go-ipfs/datastore"
'

test_expect_success "ipfs config succeeds" '
	echo leveldb >expected &&
	ipfs config Datastore.Type >actual &&
	test_cmp expected actual
'

test_done