From ea33a2b9767ff4878d2d99d83650ed4038e4e14e Mon Sep 17 00:00:00 2001 From: reesporte Date: Tue, 12 Apr 2022 09:15:23 -0500 Subject: [PATCH] fix broken test --- ctl/import_test.go | 4 ++-- qa/scripts/utilCluster.sh | 47 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/ctl/import_test.go b/ctl/import_test.go index 28a91a683..5c4603c89 100644 --- a/ctl/import_test.go +++ b/ctl/import_test.go @@ -684,14 +684,14 @@ func TestImport_AuthOn(t *testing.T) { Field: "field1", CreateSchema: false, Token: invalidToken, - Err: fmt.Errorf("token contains an invalid number of segments"), + Err: fmt.Errorf("bearer token is empty"), }, { Index: "test", Field: "field1", CreateSchema: true, Token: invalidToken, - Err: fmt.Errorf("token contains an invalid number of segments"), + Err: fmt.Errorf("bearer token is empty"), }, } diff --git a/qa/scripts/utilCluster.sh b/qa/scripts/utilCluster.sh index 625bace9a..c0afb3a6e 100644 --- a/qa/scripts/utilCluster.sh +++ b/qa/scripts/utilCluster.sh @@ -61,7 +61,9 @@ writeFeatureBaseNodeConfigFile() { echo "Writing featurebase.conf file...index: $1, ip:$2" NODEIDX=$1 NODEIP=$2 - cat << EOT > featurebase.conf + if (( AUTH_ENABLED = 1 )); then + echo "writing auth enabled featurebase.conf" + cat << EOT > featurebase.conf name = "p${NODEIDX}" bind = "0.0.0.0:10101" bind-grpc = "0.0.0.0:20101" @@ -93,6 +95,40 @@ long-query-time = "10s" service = "prometheus" EOT + else + cat << EOT > featurebase.conf +name = "p${NODEIDX}" +bind = "0.0.0.0:10101" +bind-grpc = "0.0.0.0:20101" + +data-dir = "/data/featurebase" +log-path = "/var/log/molecula/featurebase.log" + +max-file-count=900000 +max-map-count=900000 + +long-query-time = "10s" + +[postgres] + + bind = "localhost:55432" + +[cluster] + + name = "${DEPLOYED_CLUSTER_PREFIX}" + replicas = ${DEPLOYED_CLUSTER_REPLICA_COUNT} + +[etcd] + + listen-client-address = "http://${NODEIP}:10401" + listen-peer-address = "http://${NODEIP}:10301" + initial-cluster = "${INITIAL_CLUSTER}" + +[metric] + + service = "prometheus" +EOT + fi #echo "featurebase.conf >>" #cat featurebase.conf @@ -201,15 +237,20 @@ setupIngestNodes() { } generateInitialClusterString() { + if (( AUTH_ENABLED = 1 )); then + scheme=https + else + scheme=http + fi IFS=$'\n' cnt=0 for ip in $DEPLOYED_DATA_IPS do if (($cnt + 1 != $DEPLOYED_DATA_IPS_LEN)) then - INITIAL_CLUSTER="${INITIAL_CLUSTER}p${cnt}=http://$ip:10301," + INITIAL_CLUSTER="${INITIAL_CLUSTER}p${cnt}=${scheme}://$ip:10301," else - INITIAL_CLUSTER="${INITIAL_CLUSTER}p${cnt}=http://$ip:10301" + INITIAL_CLUSTER="${INITIAL_CLUSTER}p${cnt}=${scheme}://$ip:10301" fi cnt=$((cnt+1)) done