summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2020-10-02 19:17:57 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2020-10-03 18:22:36 -0700
commiteac7226ce29bc291b4b9bdc34775b22b147f9f72 (patch)
treebe4ca568e07e51c3ee36bdfcce0d0f11f9e4c381
parent8604f84fd7bda4e30d3f07005c4901f3662303a7 (diff)
downloadironic-eac7226ce29bc291b4b9bdc34775b22b147f9f72.tar.gz
CI: update bindep for centos-8 py36 job changes
Opendev infra changed py36 defaults to run on centos8 and of course, there is no python-devel mapping on centos. Removed the entry and adjusted the test-setup.sh script so the databases are started locally as they are not auto started upon installation. Change-Id: I826757ad73b0b14f119f9205475379b85f111383
-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