summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-11-23 18:46:43 +0000
committerGerrit Code Review <review@openstack.org>2020-11-23 18:46:43 +0000
commitf16eac7c2f00fdd8298347563f5d7dec4d1631ac (patch)
tree55395d8b4759f1b44efd28d065f29b06288cfcce
parent8c5dfc15198dba8e918f1e452c66d9c43f29d047 (diff)
parent5c8256d2942dc26dd08af1393c159d2f6fc2eacf (diff)
downloadironic-f16eac7c2f00fdd8298347563f5d7dec4d1631ac.tar.gz
Merge "CI: update bindep for centos-8 py36 job changes" into stable/victoria
-rw-r--r--bindep.txt2
-rwxr-xr-xtools/test-setup.sh23
2 files changed, 24 insertions, 1 deletions
diff --git a/bindep.txt b/bindep.txt
index 36b4ce35d..d2e63ea2b 100644
--- a/bindep.txt
+++ b/bindep.txt
@@ -47,12 +47,12 @@ net-tools [platform:rpm devstack]
# these are needed to compile Python dependencies from sources
python-dev [platform:dpkg test]
python3-all-dev [platform:dpkg !platform:ubuntu-precise test]
-python-devel [platform:rpm test]
python3-devel [platform:rpm test]
build-essential [platform:dpkg test]
libssl-dev [platform:dpkg test]
# these are needed by infra for python-* jobs
libpq-dev [platform:dpkg test]
+libpq-devel [platform:rpm test]
postgresql
postgresql-client [platform:dpkg]
# postgresql-devel [platform:rpm]
diff --git a/tools/test-setup.sh b/tools/test-setup.sh
index c82f4716a..dc2a130b9 100755
--- a/tools/test-setup.sh
+++ b/tools/test-setup.sh
@@ -4,6 +4,12 @@
# it sets up the test system as needed.
# Developers should setup their test systems in a similar way.
+# Try starting mariadb
+sudo systemctl start mariadb || true
+# Try starting postgresql
+sudo postgresql-setup --initdb || true
+sudo systemctl start postgresql || true
+
# This setup needs to be run as a user that can run sudo.
# The root password for the MySQL database; pass it in via
@@ -37,6 +43,14 @@ mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e "
# POSTGRES_ROOT_PW.
DB_ROOT_PW=${POSTGRES_ROOT_PW:-insecure_slave}
+# Change working directory to a folder all users can access
+# as psql on centos8 needs to be able to open the working directory
+# which it can't when executed as the postgres user, which is required
+# as same user as process for initial administrative authentication to
+# the postgres database
+
+cd /tmp
+
# Setup user
root_roles=$(sudo -H -u postgres psql -t -c "
SELECT 'HERE' from pg_roles where rolname='$DB_USER'")
@@ -46,6 +60,15 @@ else
sudo -H -u postgres psql -c "CREATE ROLE $DB_USER WITH SUPERUSER LOGIN PASSWORD '$DB_PW'"
fi
+# Identify and update the postgres hba file which can be in
+# a version specific path.
+PG_HBA=$(sudo -H -u postgres psql -t -c "show hba_file")
+sudo sed -i 's/ident/trust/g' $PG_HBA
+sudo cat $PG_HBA
+# restart postgres fo new HBA file is loaded and our user trusted.
+sudo systemctl stop postgresql || true
+sudo systemctl start postgresql || true
+
# Store password for tests
cat << EOF > $HOME/.pgpass
*:*:*:$DB_USER:$DB_PW