diff --git a/bindep.txt b/bindep.txt index 36b4ce35d4..d2e63ea2b3 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 c82f4716ac..dc2a130b99 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