Skip to content

Commit

Permalink
test done
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaUnisikhin committed Nov 20, 2023
1 parent 43f6207 commit 9b4f3b4
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 361 deletions.
5 changes: 5 additions & 0 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ version: '3'

services:
odyssey:
ulimits:
core:
soft: -1
hard: -1
privileged: true
build:
dockerfile: ./docker/Dockerfile
context: .
Expand Down
13 changes: 1 addition & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@ FROM golang:latest as base
RUN mkdir -p /ody-integration-test
RUN mkdir -p /prep_stmts
RUN mkdir -p /config-validation
RUN mkdir -p /check-sigterm-cores
COPY ./docker/ody-integration-test /ody-integration-test
COPY ./docker/prep_stmts /prep_stmts
COPY ./docker/config-validation /config-validation
COPY ./docker/check-sigterm-cores /check-sigterm-cores

WORKDIR /ody-integration-test
RUN go mod download && cd pkg && CGO_ENABLED=0 go build -o ody-integration-test

WORKDIR /prep_stmts
RUN go mod download && cd pkg && go build -o pstmts-test
RUN go mod download && cd pkg && CGO_ENABLED=0 go build -o pstmts-test

WORKDIR /config-validation
RUN go mod download && cd pkg && go build -o config-validation

WORKDIR /check-sigterm-cores
RUN go mod download && cd pkg && CGO_ENABLED=0 go build -o check-sigterm-cores

FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -65,20 +60,14 @@ RUN cd /test_dir && make run_test_prep && cp /test_dir/docker/bin/* /usr/bin/

RUN mkdir /tmp/odyssey

RUN ulimit -c unlimited && \
mkdir /var/cores && \
sudo sysctl -w kernel.core_pattern=/var/cores/core.%p.%e

COPY ./docker/odyssey.conf /etc/odyssey/odyssey.conf
COPY ./docker/lagpolling/lag-conf.conf /etc/odyssey/lag-conf.conf
COPY ./docker/prep_stmts/pstmts.conf /etc/odyssey/pstmts.conf
COPY ./docker/config-validation/configs /etc/odyssey/configs
COPY ./docker/check-sigterm-cores/check-sigterm-cores.conf /etc/odyssey/check-sigterm-cores.conf

COPY --from=base /ody-integration-test/pkg/ody-integration-test /ody-integration-test
COPY --from=base /prep_stmts/pkg/pstmts-test /pstmts-test
COPY --from=base /config-validation/pkg/config-validation /config-validation
COPY --from=base /check-sigterm-cores/pkg/check-sigterm-cores /check-sigterm-cores
COPY ./docker/scram /scram
COPY ./docker/hba /hba
COPY ./docker/auth_query /auth_query
Expand Down
6 changes: 4 additions & 2 deletions docker/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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; do
for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db cores_db; do
sudo -u postgres createdb $database_name >> "$SETUP_LOG" 2>&1 || {
echo "ERROR: 'createdb $database_name' failed, examine the log"
cat "$SETUP_LOG"
Expand All @@ -60,7 +60,9 @@ for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db; do
done

# pgbench initialization
pgbench -i -h localhost -p 5432 -U postgres db1
mkdir /var/cores
sudo sysctl -w kernel.core_pattern=/var/cores/core.%p.%e
pgbench -i -h localhost -p 5432 -U postgres postgres

# Create users
psql -h localhost -p 5432 -U postgres -c "set password_encryption = 'scram-sha-256'; create user scram_user password 'scram_user_password';" -d scram_db >> $SETUP_LOG 2>&1 || {
Expand Down
26 changes: 0 additions & 26 deletions docker/check-sigterm-cores/check-sigterm-cores.conf

This file was deleted.

10 changes: 0 additions & 10 deletions docker/check-sigterm-cores/go.mod

This file was deleted.

19 changes: 0 additions & 19 deletions docker/check-sigterm-cores/go.sum

This file was deleted.

63 changes: 0 additions & 63 deletions docker/check-sigterm-cores/pkg/main.go

This file was deleted.

155 changes: 0 additions & 155 deletions docker/check-sigterm-cores/pkg/util.go

This file was deleted.

Loading

0 comments on commit 9b4f3b4

Please sign in to comment.