|
@@ -5,6 +5,11 @@ set -e
|
|
|
function run_tests() {
|
|
function run_tests() {
|
|
|
local clusterSize=3
|
|
local clusterSize=3
|
|
|
local version=$1
|
|
local version=$1
|
|
|
|
|
+ local auth=$2
|
|
|
|
|
+
|
|
|
|
|
+ if [ "$auth" = true ]; then
|
|
|
|
|
+ clusterSize=1
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
local keypath="$(pwd)/testdata/pki"
|
|
local keypath="$(pwd)/testdata/pki"
|
|
|
|
|
|
|
@@ -29,6 +34,12 @@ function run_tests() {
|
|
|
ccm create test -v binary:$version -n $clusterSize -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
|
|
ccm create test -v binary:$version -n $clusterSize -d --vnodes --jvm_arg="-Xmx256m -XX:NewSize=100m"
|
|
|
ccm updateconf "${conf[@]}"
|
|
ccm updateconf "${conf[@]}"
|
|
|
|
|
|
|
|
|
|
+ if [ "$auth" = true ]
|
|
|
|
|
+ then
|
|
|
|
|
+ ccm updateconf 'authenticator: PasswordAuthenticator' 'authorizer: CassandraAuthorizer'
|
|
|
|
|
+ rm -rf $HOME/.ccm/test/node1/data/system_auth
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
ccm start -v
|
|
ccm start -v
|
|
|
ccm status
|
|
ccm status
|
|
|
ccm node1 nodetool status
|
|
ccm node1 nodetool status
|
|
@@ -40,25 +51,33 @@ function run_tests() {
|
|
|
proto=3
|
|
proto=3
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- go test -timeout 5m -tags integration -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms -compressor=snappy ./... | tee results.txt
|
|
|
|
|
|
|
+ if [ "$auth" = true ]
|
|
|
|
|
+ then
|
|
|
|
|
+ sleep 30s
|
|
|
|
|
+ go test -v . -timeout 15s -run=TestAuthentication -tags integration -runssl -runauth -proto=$proto -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=1000ms
|
|
|
|
|
+ else
|
|
|
|
|
|
|
|
- if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
|
|
|
|
- echo "--- FAIL: ccm status follows:"
|
|
|
|
|
- ccm status
|
|
|
|
|
- ccm node1 nodetool status
|
|
|
|
|
- ccm node1 showlog > status.log
|
|
|
|
|
- cat status.log
|
|
|
|
|
- echo "--- FAIL: Received a non-zero exit code from the go test execution, please investigate this"
|
|
|
|
|
- exit 1
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ go test -timeout 5m -tags integration -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms -compressor=snappy ./... | tee results.txt
|
|
|
|
|
+
|
|
|
|
|
+ if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
|
|
|
|
+ echo "--- FAIL: ccm status follows:"
|
|
|
|
|
+ ccm status
|
|
|
|
|
+ ccm node1 nodetool status
|
|
|
|
|
+ ccm node1 showlog > status.log
|
|
|
|
|
+ cat status.log
|
|
|
|
|
+ echo "--- FAIL: Received a non-zero exit code from the go test execution, please investigate this"
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ fi
|
|
|
|
|
|
|
|
- cover=`cat results.txt | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
|
|
|
|
|
|
|
+ cover=`cat results.txt | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
|
|
|
|
|
|
|
|
- if [[ $cover -lt "55" ]]; then
|
|
|
|
|
- echo "--- FAIL: expected coverage of at least 60 %, but coverage was $cover %"
|
|
|
|
|
- exit 1
|
|
|
|
|
|
|
+ if [[ $cover -lt "55" ]]; then
|
|
|
|
|
+ echo "--- FAIL: expected coverage of at least 60 %, but coverage was $cover %"
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
|
|
+
|
|
|
ccm remove
|
|
ccm remove
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-run_tests $1
|
|
|
|
|
|
|
+run_tests $1 $2
|