From ccce4c7b27df563313a2a74172a7b5f099ba6409 Mon Sep 17 00:00:00 2001 From: DarrylWong Date: Wed, 24 Jan 2024 10:13:29 -0500 Subject: [PATCH] Make CockroachDB test be able to run on secure clusters. The setup script for cockroachdb tests previously passed an --insecure flag. This change replaces that with a more generic ARGS flag that gives more flexibility. The test can still run on insecure clusters if --insecure is passed or on secure clusters if certs-dir is passed. --- src/test/resources/docker/docker-compose.yml | 8 ++++---- src/test/resources/docker/setup_db.sh | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/resources/docker/docker-compose.yml b/src/test/resources/docker/docker-compose.yml index c3a77c14c..bb3636afa 100644 --- a/src/test/resources/docker/docker-compose.yml +++ b/src/test/resources/docker/docker-compose.yml @@ -322,7 +322,7 @@ services: networks: - roachnet volumes: - - ./setup_db.sh:/setup_db.sh + - ./setup_db.sh:/setup_db.sh --insecure entrypoint: "/bin/bash" command: /setup_db.sh crdb-20.2 depends_on: @@ -344,7 +344,7 @@ services: networks: - roachnet volumes: - - ./setup_db.sh:/setup_db.sh + - ./setup_db.sh:/setup_db.sh --insecure entrypoint: "/bin/bash" command: /setup_db.sh crdb-21.1 depends_on: @@ -367,7 +367,7 @@ services: networks: - roachnet volumes: - - ./setup_db.sh:/setup_db.sh + - ./setup_db.sh:/setup_db.sh --insecure entrypoint: "/bin/bash" command: /setup_db.sh crdb-21.2 depends_on: @@ -390,7 +390,7 @@ services: networks: - roachnet volumes: - - ./setup_db.sh:/setup_db.sh + - ./setup_db.sh:/setup_db.sh --insecure entrypoint: "/bin/bash" command: /setup_db.sh crdb-22.1 depends_on: diff --git a/src/test/resources/docker/setup_db.sh b/src/test/resources/docker/setup_db.sh index 3de1d2e02..ab2c2fc15 100755 --- a/src/test/resources/docker/setup_db.sh +++ b/src/test/resources/docker/setup_db.sh @@ -3,8 +3,9 @@ #sleep 10 HOST=$1 -HOSTPARAMS="--host $HOST --insecure" -SQL="/cockroach/cockroach.sh sql $HOSTPARAMS" +ARGS=$2 +HOSTPARAMS="--host $HOST" +SQL="/cockroach/cockroach.sh sql $HOSTPARAMS $ARGS" $SQL -e "CREATE DATABASE lbcat;" $SQL -e "CREATE USER lbuser;"