mirror of https://github.com/yandex/odyssey.git
parent
ddbbb698b7
commit
b8b0651026
|
@ -12,6 +12,8 @@ services:
|
|||
context: .
|
||||
environment:
|
||||
CMAKE_BUILD_TYPE: "${CMAKE_BUILD_TYPE:-Debug}"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
od_net:
|
||||
ipv4_address: 192.168.233.15
|
||||
|
|
|
@ -49,7 +49,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
libpq-dev \
|
||||
vim \
|
||||
postgresql-common \
|
||||
postgresql-server-dev-14
|
||||
postgresql-server-dev-14 \
|
||||
git
|
||||
|
||||
RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
|
||||
sudo sh get-docker.sh
|
||||
|
||||
COPY ./docker/pg/pg_hba-test.conf /etc/postgresql/14/main/pg_hba.conf
|
||||
|
||||
|
@ -75,6 +79,7 @@ COPY ./docker/ldap /ldap
|
|||
COPY ./docker/lagpolling /lagpolling
|
||||
COPY ./docker/shell-test /shell-test
|
||||
COPY ./docker/tsa /tsa
|
||||
COPY ./docker/xproto /xproto
|
||||
|
||||
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
|
|
|
@ -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; 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,6 +171,20 @@ 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 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"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Grant access for ldap_storage_credentials
|
||||
|
||||
psql -h localhost -p 5432 -U postgres -c "GRANT ALL ON DATABASE ldap_db1 TO ldap_readonly" -d postgres >> $SETUP_LOG 2>&1 || {
|
||||
|
|
|
@ -6,6 +6,11 @@ cd /test_dir/test && /usr/bin/odyssey_test
|
|||
|
||||
setup
|
||||
|
||||
# proto
|
||||
ody-start
|
||||
/xproto/test.sh
|
||||
ody-stop
|
||||
|
||||
# odyssey rule-address test
|
||||
/rule-address/test.sh
|
||||
if [ $? -eq 1 ]
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
FROM golang:1.21
|
||||
|
||||
WORKDIR /root
|
||||
COPY . /root
|
||||
|
||||
RUN go mod init prep_stmt_test && \
|
||||
go mod tidy
|
||||
|
||||
ENTRYPOINT go test .
|
|
@ -0,0 +1,5 @@
|
|||
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=odyssey -e POSTGRES_PORT=6432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=odyssey_od_net xproto-tests
|
Loading…
Reference in New Issue