zun/tools/test-setup.sh
Feng Shengqin 7b21325352 Add DB migration tests
Change-Id: I0f718cfe37bf42da6b8bbf2e6dd1cbfd28e0f4dc
Closes-Bug: #1670195
2017-03-09 08:36:21 +08:00

14 lines
455 B
Bash
Executable File

#!/usr/bin/env bash
# Borrowed from mysql-prep in openstack-infra/project-config/macros.yaml
DB_ROOT_PW=insecure_slave
DB_USER=openstack_citest
DB_PW=openstack_citest
sudo -H mysqladmin -u root password $DB_ROOT_PW
# note; we remove anonymous users first
sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.*
TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;"