Purge any existing keystone DB before test runs

Previously, we attempted to do this via mysql, which doesn't make sense
and would lead to errors like:

    ERROR 1045 (28000): Access denied for user 'root'@'localhost'
    (using password: YES)

Now, we just delete the sqlite database if it exists. Keystone will
automatically initialize a new one on startup.

Change-Id: Id812d04f31e2917e341f7487d1f61a1c51bd60e9
This commit is contained in:
Tim Burke 2016-01-04 10:26:14 -08:00
parent 0ae706875b
commit 6fd8c2fad2
1 changed files with 2 additions and 3 deletions

View File

@ -73,12 +73,11 @@ _create_swift_accounts()
_setup_keystone()
{
rm -f ${TEST_DIR}/keystone.db 2>&1
keystone-all --config-file conf/keystone.conf --debug > ${TEST_DIR}/log/keystone.log 2>&1 &
export keystone_pid=$!
mysql -uroot -ppassword -e "DROP DATABASE IF EXISTS keystone;"
mysql -uroot -ppassword -e "CREATE DATABASE keystone CHARACTER SET utf8;"
keystone-manage --config-file conf/keystone.conf --debug db_sync
keystone-manage --config-file conf/keystone.conf --debug pki_setup