|
|
@@ -5,6 +5,11 @@ set -e
|
|
|
function run_tests() {
|
|
|
local clusterSize=3
|
|
|
local version=$1
|
|
|
+ local auth=$2
|
|
|
+
|
|
|
+ if [ "$auth" = true ]; then
|
|
|
+ clusterSize=1
|
|
|
+ fi
|
|
|
|
|
|
local keypath="$(pwd)/testdata/pki"
|
|
|
|
|
|
@@ -40,24 +45,34 @@ function run_tests() {
|
|
|
proto=3
|
|
|
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
|
|
|
+ ccm node1 cqlsh --version
|
|
|
+ sleep 30s
|
|
|
+ echo "list users;" | SSL_VALIDATE=false SSL_CERTFILE=$keypath/cassandra.crt ccm node1 cqlsh --ssl -u cassandra -p cassandra
|
|
|
+ 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
|
|
|
|
|
|
- cover=`cat results.txt | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
|
|
|
+ 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
|
|
|
|
|
|
- if [[ $cover -lt "55" ]]; then
|
|
|
- echo "--- FAIL: expected coverage of at least 60 %, but coverage was $cover %"
|
|
|
- exit 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
|
|
|
+ fi
|
|
|
fi
|
|
|
+
|
|
|
ccm remove
|
|
|
}
|
|
|
|