2017-11-28 22:45:10 +00:00
|
|
|
#!/bin/bash
|
2017-05-02 23:34:06 +00:00
|
|
|
|
|
|
|
test_description="Test service startup and init functionality"
|
|
|
|
|
|
|
|
. lib/test-lib.sh
|
2017-05-04 22:33:12 +00:00
|
|
|
test_ipfs_init
|
2017-07-03 18:02:27 +00:00
|
|
|
cleanup test_clean_ipfs
|
2017-05-04 22:33:12 +00:00
|
|
|
test_cluster_init
|
2017-07-03 18:02:27 +00:00
|
|
|
cleanup test_clean_cluster
|
2017-05-02 23:34:06 +00:00
|
|
|
|
2017-05-04 22:33:12 +00:00
|
|
|
test_expect_success "prerequisites" '
|
|
|
|
test_have_prereq IPFS &&
|
2017-05-05 16:09:36 +00:00
|
|
|
test_have_prereq CLUSTER
|
2017-05-02 23:34:06 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success JQ "ipfs cluster config valid" '
|
|
|
|
test_cluster_config
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "custer-service help output looks good" '
|
|
|
|
ipfs-cluster-service --help | egrep -q -i "^(Usage|Commands|Description|Global Options)"
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "cluster-service --version succeeds and matches ctl" '
|
2017-07-03 18:02:27 +00:00
|
|
|
export SERV_VERSION=`ipfs-cluster-service --version | grep -Po "\d+\.\d+\.\d+"`
|
|
|
|
export CTL_VERSION=`ipfs-cluster-ctl --version | grep -Po "\d+\.\d+\.\d+"`
|
|
|
|
[ "$SERV_VERSION" = "$CTL_VERSION" ]
|
2017-05-02 23:34:06 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|