-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·32 lines (24 loc) · 794 Bytes
/
test.sh
File metadata and controls
executable file
·32 lines (24 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
versions=${1:-14 13 12 11 10}
for version in $versions
do
for config in '' '-c shared_preload_libraries=pgsodium' '-c shared_preload_libraries=pgsodium -c pgsodium.getkey_script=/getkey'
do
DB_HOST="pgsodium-test-db-$version"
DB_NAME="postgres"
SU="postgres"
EXEC="docker exec -i $DB_HOST"
TAG="pgsodium/test-$version"
echo building test image $DB_HOST
docker build . -t $TAG --build-arg "version=$version"
echo running test container
docker run --rm -e POSTGRES_HOST_AUTH_METHOD=trust -d --name "$DB_HOST" $TAG $config
echo waiting for database to accept connections
sleep 3;
echo running tests
$EXEC psql -q -U "$SU" -f /pgsodium/test/test.sql
echo destroying test container and image
docker rm --force "$DB_HOST"
done
done