Skip to content

Commit

Permalink
Make CockroachDB test be able to run on secure clusters.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DarrylWong committed Feb 7, 2024
1 parent fd53089 commit ccce4c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/test/resources/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions src/test/resources/docker/setup_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down

0 comments on commit ccce4c7

Please sign in to comment.