From ebca39d92220cb3a8cf2b1545306c0c2b7ca7dd2 Mon Sep 17 00:00:00 2001 From: NikitaUnisikhin Date: Mon, 18 Mar 2024 07:27:02 +0000 Subject: [PATCH] fix --- docker/bin/setup | 11 +++++++++-- docker/xproto/test.sh | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/bin/setup b/docker/bin/setup index ceb3b1ff5..ca9bfeee1 100755 --- a/docker/bin/setup +++ b/docker/bin/setup @@ -49,7 +49,7 @@ sudo -u postgres /usr/bin/pg_basebackup -D /var/lib/postgresql/14/repl -R -h loc sudo -u postgres /usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/14/repl/ -o '-p 5433' start # Create databases -for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db addr_db xproto_db; do +for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db addr_db xproto_db "spqr-console"; do sudo -u postgres createdb $database_name >> "$SETUP_LOG" 2>&1 || { echo "ERROR: 'createdb $database_name' failed, examine the log" cat "$SETUP_LOG" @@ -171,7 +171,14 @@ psql -h localhost -p 5432 -U postgres -c "set password_encryption TO 'md5'; crea exit 1 } -psql -h localhost -p 5432 -U postgres -c "create user xproto" -d xproto_db >> $SETUP_LOG 2>&1 || { +psql -h localhost -p 5432 -U postgres -c "create role xproto SUPERUSER LOGIN" -d xproto_db >> $SETUP_LOG 2>&1 || { + echo "ERROR: users creation failed, examine the log" + cat "$SETUP_LOG" + cat "$PG_LOG" + exit 1 +} + +psql -h localhost -p 5432 -U postgres -c "create user \"spqr-console\"" -d "spqr-console" >> $SETUP_LOG 2>&1 || { echo "ERROR: users creation failed, examine the log" cat "$SETUP_LOG" cat "$PG_LOG" diff --git a/docker/xproto/test.sh b/docker/xproto/test.sh index 32962f314..9de9c67aa 100755 --- a/docker/xproto/test.sh +++ b/docker/xproto/test.sh @@ -2,4 +2,4 @@ git clone https://github.com/pg-sharding/spqr.git /xproto/spqr cp /xproto/spqr/test/xproto/proto_test.go /xproto/proto_test.go rm -rf /xproto/spqr docker build -t xproto-tests /xproto -docker run -e POSTGRES_HOST=localhost -e POSTGRES_PORT=5432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=host xproto-tests \ No newline at end of file +docker run -e POSTGRES_HOST=odyssey -e POSTGRES_PORT=6432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=odyssey_od_net xproto-tests \ No newline at end of file