Skip to content

Commit

Permalink
implemented integration tests for ssl feature
Browse files Browse the repository at this point in the history
  • Loading branch information
xoraes committed Sep 20, 2014
1 parent 28ad04a commit 3eee185
Show file tree
Hide file tree
Showing 12 changed files with 996 additions and 13 deletions.
19 changes: 10 additions & 9 deletions cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ import (
)

var (
flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port tuples")
flagProto = flag.Int("proto", 2, "protcol version")
flagCQL = flag.String("cql", "3.0.0", "CQL version")
flagRF = flag.Int("rf", 1, "replication factor for test keyspace")
clusterSize = flag.Int("clusterSize", 1, "the expected size of the cluster")
flagRetry = flag.Int("retries", 5, "number of times to retry queries")
flagAutoWait = flag.Duration("autowait", 1000*time.Millisecond, "time to wait for autodiscovery to fill the hosts poll")
clusterHosts []string
flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port tuples")
flagProto = flag.Int("proto", 2, "protcol version")
flagCQL = flag.String("cql", "3.0.0", "CQL version")
flagRF = flag.Int("rf", 1, "replication factor for test keyspace")
clusterSize = flag.Int("clusterSize", 1, "the expected size of the cluster")
flagRetry = flag.Int("retries", 5, "number of times to retry queries")
flagAutoWait = flag.Duration("autowait", 1000*time.Millisecond, "time to wait for autodiscovery to fill the hosts poll")
flagRunSslTest = flag.Bool("runssl", false, "Set to true to run ssl test")
clusterHosts []string
)

func init() {
Expand All @@ -52,7 +53,7 @@ func createTable(s *Session, table string) error {
return err
}

func createCluster() *ClusterConfig {
var createCluster = func() *ClusterConfig {
cluster := NewCluster(clusterHosts...)
cluster.ProtoVersion = *flagProto
cluster.CQLVersion = *flagCQL
Expand Down
14 changes: 10 additions & 4 deletions integration.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x

set -e

Expand All @@ -8,8 +8,8 @@ function run_tests() {

ccm create test -v binary:$version -n $clusterSize -d --vnodes

sed -i '/#MAX_HEAP_SIZE/c\MAX_HEAP_SIZE="256M"' ~/.ccm/repository/$version/conf/cassandra-env.sh
sed -i '/#HEAP_NEWSIZE/c\HEAP_NEWSIZE="100M"' ~/.ccm/repository/$version/conf/cassandra-env.sh
#sed -i '/#MAX_HEAP_SIZE/c\MAX_HEAP_SIZE="256M"' ~/.ccm/repository/$version/conf/cassandra-env.sh
#sed -i '/#HEAP_NEWSIZE/c\HEAP_NEWSIZE="100M"' ~/.ccm/repository/$version/conf/cassandra-env.sh

ccm updateconf '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'
ccm start
Expand All @@ -21,7 +21,13 @@ function run_tests() {
fi

go test -v -proto=$proto -rf=3 -cluster=$(ccm liveset) -clusterSize=$clusterSize -autowait=2000ms ./...
cp -f resources/conf/cassandra.yaml ~/.ccm/repository/$version/conf/
ccm clear
#updateconf is necessary here so the yaml file gets loaded
ccm updateconf
ccm start
ccm status
go test -v -run Wiki -runssl

ccm clear
}
run_tests $1
Loading

0 comments on commit 3eee185

Please sign in to comment.