integration.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. function run_tests() {
  4. local clusterSize=3
  5. local version=$1
  6. ccm create test -v binary:$version -n $clusterSize -d --vnodes
  7. sed -i '/#MAX_HEAP_SIZE/c\MAX_HEAP_SIZE="256M"' ~/.ccm/repository/$version/conf/cassandra-env.sh
  8. sed -i '/#HEAP_NEWSIZE/c\HEAP_NEWSIZE="100M"' ~/.ccm/repository/$version/conf/cassandra-env.sh
  9. ccm updateconf 'client_encryption_options.enabled: true' 'client_encryption_options.keystore: testdata/pki/.keystore' 'client_encryption_options.keystore_password: cassandra' 'client_encryption_options.require_client_auth: true' 'client_encryption_options.truststore: testdata/pki/.truststore' 'client_encryption_options.truststore_password: cassandra' 'concurrent_reads: 2' 'concurrent_writes: 2' 'rpc_server_type: sync' 'rpc_min_threads: 2' 'rpc_max_threads: 2' 'write_request_timeout_in_ms: 5000' 'read_request_timeout_in_ms: 5000'
  10. ccm start -v
  11. ccm status
  12. local proto=2
  13. if [[ $version == 1.2.* ]]; then
  14. proto=1
  15. fi
  16. go test -cover -v -runssl -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms ./... > results
  17. cat results
  18. cover=`cat results | grep coverage: | grep -o "[0-9]\{1,3\}" | head -n 1`
  19. if [[ $cover -lt "64" ]]; then
  20. echo "--- FAIL: expected coverage of at least 64 %, but coverage was $cover %"
  21. exit 1
  22. fi
  23. ccm clear
  24. }
  25. run_tests $1