2017-04-18 22:22:05 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# MIT Licensed
|
|
|
|
#
|
|
|
|
|
2017-04-19 00:10:45 +00:00
|
|
|
test_description="Test service installation and some basic commands"
|
2017-04-18 22:22:05 +00:00
|
|
|
|
|
|
|
. lib/test-lib.sh
|
|
|
|
|
|
|
|
|
|
|
|
test_expect_success "cluster-service --version succeeds" '
|
|
|
|
ipfs-cluster-service --version >version.txt
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "cluster-service --version output looks good" '
|
2017-04-19 00:10:45 +00:00
|
|
|
egrep "^ipfs-cluster-service version [0-9]+\.[0-9]+\.[0-9]" version.txt >/dev/null &&
|
|
|
|
rm version.txt
|
2017-04-18 22:22:05 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "cluster-service --help and -h succeed" '
|
2017-04-19 00:10:45 +00:00
|
|
|
ipfs-cluster-service --help &&
|
|
|
|
ipfs-cluster-service -h
|
2017-04-18 22:22:05 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "cluster-service help and h succeed" '
|
2017-04-19 00:10:45 +00:00
|
|
|
ipfs-cluster-service help &&
|
|
|
|
ipfs-cluster-service h
|
2017-04-18 22:22:05 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "cluster-service help options match" '
|
2017-04-19 00:10:45 +00:00
|
|
|
ipfs-cluster-service help >help.txt &&
|
|
|
|
ipfs-cluster-service h >help1.txt &&
|
|
|
|
ipfs-cluster-service --help >help2.txt &&
|
|
|
|
ipfs-cluster-service --h >help3.txt &&
|
|
|
|
diff help.txt help1.txt &&
|
|
|
|
diff help.txt help2.txt &&
|
|
|
|
diff help.txt help3.txt &&
|
|
|
|
rm help1.txt help2.txt help3.txt
|
2017-04-18 22:22:05 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success "custer-service help output looks good" '
|
2017-04-19 00:10:45 +00:00
|
|
|
egrep -i "^Usage" help.txt >/dev/null &&
|
|
|
|
egrep -i "^Commands" help.txt >/dev/null &&
|
|
|
|
egrep -i "^Description" help.txt >/dev/null &&
|
|
|
|
egrep -i "^Global Options" help.txt >/dev/null &&
|
|
|
|
rm help.txt
|
2017-04-18 22:22:05 +00:00
|
|
|
'
|
2017-04-19 00:10:45 +00:00
|
|
|
|
2017-04-18 22:22:05 +00:00
|
|
|
test_done
|