Browse Source

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
changes/05/755905/17
Julia Kreger 3 weeks ago
parent
commit
eac7226ce2
2 changed files with 24 additions and 1 deletions
  1. +1
    -1
      bindep.txt
  2. +23
    -0
      tools/test-setup.sh

+ 1
- 1
bindep.txt View File

@@ -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]


+ 23
- 0
tools/test-setup.sh View File

@@ -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


Loading…
Cancel
Save