summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/db/sqlalchemy
diff options
context:
space:
mode:
authorJim Rollenhagen <jim@jimrollenhagen.com>2017-01-17 15:55:28 +0000
committerJim Rollenhagen <jim@jimrollenhagen.com>2017-01-17 17:37:06 +0000
commitac90e7372c6348dda2a04e8789caa625db331c5e (patch)
tree203767c2977860a3fb884a42eb99b7e3a2bbbea2 /ironic/tests/unit/db/sqlalchemy
parent713a440884aebde213d279574c5ef166a999b720 (diff)
downloadironic-ac90e7372c6348dda2a04e8789caa625db331c5e.tar.gz
Add default column to ConductorHardwareInterfaces
This will mark the default interface for each hardware type in use. This is the only piece of information about hardware interfaces that is not in the database, and so this will allow the API to fetch this information without an RPC call. Change-Id: I5b05853a64ebb2744f9dc87855fb31fbe5cefce6 Partial-Bug: #1524745
Diffstat (limited to 'ironic/tests/unit/db/sqlalchemy')
-rw-r--r--ironic/tests/unit/db/sqlalchemy/test_migrations.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ironic/tests/unit/db/sqlalchemy/test_migrations.py b/ironic/tests/unit/db/sqlalchemy/test_migrations.py
index 6d6ff8ccd..8d5a82790 100644
--- a/ironic/tests/unit/db/sqlalchemy/test_migrations.py
+++ b/ironic/tests/unit/db/sqlalchemy/test_migrations.py
@@ -652,6 +652,14 @@ class MigrationCheckersMixin(object):
self.assertIsInstance(ifaces.c.interface_name.type,
sqlalchemy.types.String)
+ def _check_dbefd6bdaa2c(self, engine, data):
+ ifaces = db_utils.get_table(engine, 'conductor_hardware_interfaces')
+ col_names = [column.name for column in ifaces.c]
+ self.assertIn('default', col_names)
+ self.assertIsInstance(ifaces.c.default.type,
+ (sqlalchemy.types.Boolean,
+ sqlalchemy.types.Integer))
+
def test_upgrade_and_version(self):
with patch_with_engine(self.engine):
self.migration_api.upgrade('head')