e7b731e0e4
* Init should take a list of peers This commit adds `--peers` option to `ipfs-cluster-service init` `ipfs-cluster-service init --peers <multiaddress,multiaddress>` - Adds and writes the given peers to the peerstore file - For raft config section, adds the peer IDs to the `init_peerset` - For crdt config section, add the peer IDs to the `trusted_peers`
25 lines
816 B
Bash
Executable File
25 lines
816 B
Bash
Executable File
#!/bin/bash
|
|
|
|
test_description="Test init functionality"
|
|
|
|
. lib/test-lib.sh
|
|
|
|
test_expect_success "cluster-service init with --peers succeeds and fills peerstore" '
|
|
PEER1=/ip4/192.168.0.129/tcp/9196/ipfs/12D3KooWRN8KRjpyg9rsW2w7StbBRGper65psTZm68cjud9KAkaW
|
|
PEER2=/ip4/192.168.0.129/tcp/9196/ipfs/12D3KooWPwrYNj7VficHw5qYidepMGA85756kYgMdNmRM9A1ZHjN
|
|
echo $PEER1 >> testPeerstore
|
|
echo $PEER2 >> testPeerstore
|
|
ipfs-cluster-service --config "test-config" init --peers $PEER1,$PEER2 &&
|
|
test_cmp testPeerstore test-config/peerstore
|
|
'
|
|
|
|
test_expect_success "cluster-service init without --peers succeeds and creates empty peerstore" '
|
|
ipfs-cluster-service -f --config "test-config" init &&
|
|
[ -f "test-config/peerstore" ] &&
|
|
[ ! -s "test-config/peerstore" ]
|
|
'
|
|
|
|
test_clean_cluster
|
|
|
|
test_done
|