Functional db migration tests broken and not running in gate
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
networking-ovn |
Fix Released
|
High
|
Lucas Alvares Gomes |
Bug Description
The functional db migration tests such as "TestModelsMigr
2018-04-24 13:14:40.029396 | primary | 2018-04-24 13:14:40.028 | {4} networking_
This is because we don't properly configure the databases for the functional tests in the networking-ovn gate. We need something similar to this script for Neutron [0].
Now, it's possible to configure things manually to verify the tests, to do this follow the steps below:
1. Stack DevStack as per our documentation
2. Configure Mysql:
$ cat << EOF > /tmp/mysql.sql
CREATE DATABASE openstack_citest;
CREATE USER 'openstack_
'openstack_
CREATE USER 'openstack_citest' IDENTIFIED BY 'openstack_citest';
GRANT ALL PRIVILEGES ON *.* TO 'openstack_
GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest';
FLUSH PRIVILEGES;
EOF
$ /usr/bin/mysql -u root < /tmp/mysql.sql
3. Change to the networking-ovn directory
$ cd ~/networking-ovn
4. Run the test_models_sync() functional test:
$ tox -edsvm-functional TestModelsMigra
And finally, the tests are broken:
networking_
-------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/opt/stack/
return f(self, *args, **kwargs)
File "/opt/stack/
"Models and migration scripts aren't in sync:\n%s" % msg)
File "/opt/stack/
raise self.failureExc
AssertionError: Models and migration scripts aren't in sync:
[ [ ( 'modify_nullable',
None,
{ 'existing_
False,
True)],
[ ( 'modify_default',
None,
{ 'existing_
None,
[ ( 'modify_default',
None,
{ 'existing_
Changed in networking-ovn: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Lucas Alvares Gomes (lucasagomes) |
Changed in networking-ovn: | |
status: | Confirmed → In Progress |
tags: | added: networking-ovn-proactive-backport-potential |
tags: | added: networking-ovn-easy-proactive-backport-potential |
Reviewed: https:/ /review. openstack. org/563994 /git.openstack. org/cgit/ openstack/ networking- ovn/commit/ ?id=b892650a6e6 2ac71679409cac7 67b58d867021bf
Committed: https:/
Submitter: Zuul
Branch: master
commit b892650a6e62ac7 1679409cac767b5 8d867021bf
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Apr 24 15:31:09 2018 +0100
Fix test_models_sync() functional test
This patch is fixing the test_models_sync() test from oslo.db by removing numbers table.
the inconsistencies from the models.py module and the migration script
for the ovn_revision_
Note that this test doesn't current run in our gate, it gets skipped
because the databases are not properly configured when setting up the
functional tests. For now, it's possible to configure mysql by hand to
test this patch by doing the following:
1. Stack DevStack as per our documentation
2. Configure Mysql:
$ cat << EOF > /tmp/mysql.sql citest' @'localhost' IDENTIFIED BY openstack_ citest' ; citest' @'localhost' ;
CREATE DATABASE openstack_citest;
CREATE USER 'openstack_
'
CREATE USER 'openstack_citest' IDENTIFIED BY 'openstack_citest';
GRANT ALL PRIVILEGES ON *.* TO 'openstack_
GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest';
FLUSH PRIVILEGES;
EOF
$ /usr/bin/mysql -u root < /tmp/mysql.sql
3. Change to the networking-ovn directory
$ cd ~/networking-ovn
4. Run the test_models_sync() functional test:
$ tox -edsvm-functional TestModelsMigra tionsMysql. test_models_ sync
Partial-Bug: #1766639 d594685848f3586 8c438f20976
Change-Id: Ie3b600d4f3d7a3