This is an automated email from the ASF dual-hosted git repository.
rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 0d93fac upgrade todb test to go 1.11; protect against no .dump files
provided (#3645)
0d93fac is described below
commit 0d93facb7883cb6d9fff307723e4d520cd4a25ce
Author: Dan Kirkwood <[email protected]>
AuthorDate: Thu May 30 16:04:16 2019 -0600
upgrade todb test to go 1.11; protect against no .dump files provided
(#3645)
---
traffic_ops_db/test/docker/Dockerfile-db-admin | 5 ++---
traffic_ops_db/test/docker/run-db-test.sh | 8 ++++++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/traffic_ops_db/test/docker/Dockerfile-db-admin
b/traffic_ops_db/test/docker/Dockerfile-db-admin
index 883fe6d..1ee1d15 100644
--- a/traffic_ops_db/test/docker/Dockerfile-db-admin
+++ b/traffic_ops_db/test/docker/Dockerfile-db-admin
@@ -27,8 +27,7 @@ RUN yum install -y \
epel-release \
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
\
git && \
- yum-config-manager --add-repo
'https://vault.centos.org/7.5.1804/os/x86_64/' && \
- yum -y install --enablerepo=vault* golang-1.9.4
+ yum -y install golang
# Override TRAFFIC_OPS_RPM arg to use a different one using --build-arg
TRAFFIC_OPS_RPM=... Can be local file or http://...
ARG TRAFFIC_OPS_RPM=traffic_ops.rpm
@@ -46,6 +45,6 @@ ADD run-db-test.sh \
goose-config.sh \
/
-COPY initdb.d/*dump /db_dumps/
+COPY initdb.d/ /db_dumps/
CMD /run-db-test.sh
diff --git a/traffic_ops_db/test/docker/run-db-test.sh
b/traffic_ops_db/test/docker/run-db-test.sh
index 8a9ed06..97b7c42 100755
--- a/traffic_ops_db/test/docker/run-db-test.sh
+++ b/traffic_ops_db/test/docker/run-db-test.sh
@@ -63,7 +63,11 @@ get_current_db_version() {
echo "$version"
}
-for d in /db_dumps/*; do
+get_db_dumps() {
+ ls /db_dumps | grep '\.dump'
+}
+
+for d in $(get_db_dumps); do
echo "checking integrity of DB dump: $d"
pg_restore -l "$d" > /dev/null || { echo "invalid DB dump: $d. Unable to
list contents"; exit 1; }
done
@@ -106,7 +110,7 @@ if [[ "$run_db_downgrades" = true ]]; then
fi
# test full restoration of the initial DB dump
-for d in /db_dumps/*; do
+for d in $(get_db_dumps); do
echo "testing restoration of DB dump: $d"
pg_restore --verbose --clean --if-exists --create -h $DB_SERVER -p
$DB_PORT -U postgres < "$d" > /dev/null || { echo "DB restoration failed: $d";
exit 1; }
done