@@ -74,8 +74,8 @@ if [[ "${EXISTS}" -eq 0 ]]; then
7474 --name ${CONTAINER_NAME} \
7575 -v ${PWD} /scripts/ssl:/test-ssl \
7676 -v ${PWD} /scripts/jwt:/test-jwt \
77- -e SINGLESTORE_LICENSE=${SINGLESTORE_LICENSE } \
78- -e ROOT_PASSWORD=${ROOT_PASSWORD } \
77+ -e SINGLESTORE_LICENSE=${LICENSE_KEY } \
78+ -e ROOT_PASSWORD=${SINGLESTORE_PASSWORD } \
7979 -e SINGLESTORE_VERSION=${VERSION} \
8080 -p 5506:3306 -p 5507:3307 -p 5508:3308 \
8181 ${IMAGE_NAME}
8484singlestore-wait-start () {
8585 echo -n " Waiting for SingleStore to start..."
8686 while true ; do
87- if mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " -e " select 1" > /dev/null 2> /dev/null; then
87+ if mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " -e " select 1" > /dev/null 2> /dev/null; then
8888 break
8989 fi
9090 echo -n " ."
@@ -98,62 +98,62 @@ singlestore-wait-start
9898if [[ " ${EXISTS} " -eq 0 ]]; then
9999 echo
100100 echo " Creating aggregator node"
101- docker exec ${CONTAINER_NAME} memsqlctl create-node --yes --password ${ROOT_PASSWORD } --port 3308
102- docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_core_count --value 0
103- docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_memory_mb --value 0
104- docker exec ${CONTAINER_NAME} memsqlctl start-node --yes --all
105- docker exec ${CONTAINER_NAME} memsqlctl add-aggregator --yes --host 127.0.0.1 --password ${ROOT_PASSWORD } --port 3308
101+ docker exec -it ${CONTAINER_NAME} memsqlctl create-node --yes --password ${SINGLESTORE_PASSWORD } --port 3308
102+ docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_core_count --value 0
103+ docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key minimum_memory_mb --value 0
104+ docker exec -it ${CONTAINER_NAME} memsqlctl start-node --yes --all
105+ docker exec -it ${CONTAINER_NAME} memsqlctl add-aggregator --yes --host 127.0.0.1 --password ${SINGLESTORE_PASSWORD } --port 3308
106106fi
107107
108108echo
109109echo " Setting up SSL"
110- docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_ca --value /test-ssl/ca-cert.pem
111- docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_cert --value /test-ssl/server-cert.pem
112- docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_key --value /test-ssl/server-key.pem
110+ docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_ca --value /test-ssl/ca-cert.pem
111+ docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_cert --value /test-ssl/server-cert.pem
112+ docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key ssl_key --value /test-ssl/server-key.pem
113113echo " Setting up JWT"
114- docker exec ${CONTAINER_NAME} memsqlctl update-config --yes --all --key jwt_auth_config_file --value /test-jwt/jwt_auth_config.json
114+ docker exec -it ${CONTAINER_NAME} memsqlctl update-config --yes --all --key jwt_auth_config_file --value /test-jwt/jwt_auth_config.json
115115echo " Restarting cluster"
116116docker restart ${CONTAINER_NAME}
117117singlestore-wait-start
118118echo " Setting up root-ssl user"
119- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " -e ' create user "root-ssl"@"%" require ssl'
120- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " -e ' grant all privileges on *.* to "root-ssl"@"%" require ssl with grant option'
121- mysql -u root -h 127.0.0.1 -P 5507 -p" ${ROOT_PASSWORD } " -e ' create user "root-ssl"@"%" require ssl'
122- mysql -u root -h 127.0.0.1 -P 5507 -p" ${ROOT_PASSWORD } " -e ' grant all privileges on *.* to "root-ssl"@"%" require ssl with grant option'
123- mysql -u root -h 127.0.0.1 -P 5508 -p" ${ROOT_PASSWORD } " -e ' grant all privileges on *.* to "root-ssl"@"%" require ssl with grant option'
119+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " -e ' create user "root-ssl"@"%" require ssl'
120+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " -e ' grant all privileges on *.* to "root-ssl"@"%" require ssl with grant option'
121+ mysql -u root -h 127.0.0.1 -P 5507 -p" ${SINGLESTORE_PASSWORD } " -e ' create user "root-ssl"@"%" require ssl'
122+ mysql -u root -h 127.0.0.1 -P 5507 -p" ${SINGLESTORE_PASSWORD } " -e ' grant all privileges on *.* to "root-ssl"@"%" require ssl with grant option'
123+ mysql -u root -h 127.0.0.1 -P 5508 -p" ${SINGLESTORE_PASSWORD } " -e ' grant all privileges on *.* to "root-ssl"@"%" require ssl with grant option'
124124echo " Done!"
125125
126126sleep 0.5
127127echo
128128echo " Ensuring child nodes are connected using container IP"
129129CONTAINER_IP=$( docker inspect -f ' {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${CONTAINER_NAME} )
130- CURRENT_LEAF_IP=$( mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " --batch -N -e ' select host from information_schema.leaves' )
130+ CURRENT_LEAF_IP=$( mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " --batch -N -e ' select host from information_schema.leaves' )
131131if [[ ${CONTAINER_IP} != " ${CURRENT_LEAF_IP} " ]]; then
132132 # remove leaf with current ip
133- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " --batch -N -e " remove leaf '${CURRENT_LEAF_IP} ':3307"
133+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " --batch -N -e " remove leaf '${CURRENT_LEAF_IP} ':3307"
134134 # add leaf with correct ip
135- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " --batch -N -e " add leaf root:'${ROOT_PASSWORD } '@'${CONTAINER_IP} ':3307"
135+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " --batch -N -e " add leaf root:'${SINGLESTORE_PASSWORD } '@'${CONTAINER_IP} ':3307"
136136fi
137- CURRENT_AGG_IP=$( mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " --batch -N -e ' select host from information_schema.aggregators where master_aggregator=0' )
137+ CURRENT_AGG_IP=$( mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " --batch -N -e ' select host from information_schema.aggregators where master_aggregator=0' )
138138if [[ ${CONTAINER_IP} != " ${CURRENT_AGG_IP} " ]]; then
139139 # remove aggregator with current ip
140- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " --batch -N -e " remove aggregator '${CURRENT_AGG_IP} ':3308"
140+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " --batch -N -e " remove aggregator '${CURRENT_AGG_IP} ':3308"
141141 # add aggregator with correct ip
142- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " --batch -N -e " add aggregator root:'${ROOT_PASSWORD } '@'${CONTAINER_IP} ':3308"
142+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " --batch -N -e " add aggregator root:'${SINGLESTORE_PASSWORD } '@'${CONTAINER_IP} ':3308"
143143fi
144144
145145# create the database used in tests
146- mysql -u root -h 127.0.0.1 -P 5506 -p" ${ROOT_PASSWORD } " -e ' create database if not exists test'
146+ mysql -u root -h 127.0.0.1 -P 5506 -p" ${SINGLESTORE_PASSWORD } " -e ' create database if not exists test'
147147
148148# setup PAM for tests
149- docker exec ${CONTAINER_NAME} bash -c ' printf "read password
149+ docker exec -it ${CONTAINER_NAME} bash -c ' printf "read password
150150[ \"\$PAM_USER\" == \"%s\" ] || exit 1
151151[ \"\$password\" == \"%s\" ] || exit 1
152152" "test_pam" \
153153 "test_pass" \
154154 > /tmp/s2_pamauth'
155155
156- docker exec -iu 0 ${CONTAINER_NAME} bash -c ' printf "auth required pam_exec.so expose_authtok /bin/bash %s
156+ docker exec -itu 0 ${CONTAINER_NAME} bash -c ' printf "auth required pam_exec.so expose_authtok /bin/bash %s
157157account required pam_permit.so
158158session required pam_permit.so
159159password required pam_permit.so
0 commit comments