We don’t include the postgres or Mysql drivers inside the virtual env for Keystone, so you need to explicitly install them in order to run the unit tests.
For Postgresql:
sudo yum install postgresql-devel . .venv/bin/activate pip install psycopg2
For MySQL
sudo yum install mysql-devel . .venv/bin/activate pip install MySQL-python
Now to run the unit tests, uncomment the driver line in tests/backend_sql.conf and run
./run_tests.sh -x test_sql_upgrade