diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/utils.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/utils.py index 82c9ff52e0..4d067e9593 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/utils.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/utils.py @@ -16,6 +16,7 @@ from oslo_config import cfg from neutron.db import db_base_plugin_v2 +from neutron.db import l3_dvr_db # noqa from neutron import manager from neutron_lib import context from neutron_lib.plugins import constants as const diff --git a/vmware_nsx/tests/unit/shell/test_admin_utils.py b/vmware_nsx/tests/unit/shell/test_admin_utils.py index f0e9ed7f79..6d410e30b3 100644 --- a/vmware_nsx/tests/unit/shell/test_admin_utils.py +++ b/vmware_nsx/tests/unit/shell/test_admin_utils.py @@ -278,8 +278,12 @@ class TestNsxv3AdminUtils(AbstractTestAdminUtils, """ args = ["dhcp_profile_uuid=e5b9b249-0034-4729-8ab6-fe4dacaa3a12", "metadata_proxy_uuid=e5b9b249-0034-4729-8ab6-fe4dacaa3a12", + "nsx-id=e5b9b249-0034-4729-8ab6-fe4dacaa3a12", + "availability-zone=default", + "server-ip=1.1.1.1" ] # Create some neutron objects for the utilities to run on + self._create_router() with self._create_l3_ext_network() as network: with self.subnet(network=network) as subnet: with self.port(subnet=subnet): @@ -287,6 +291,15 @@ class TestNsxv3AdminUtils(AbstractTestAdminUtils, self._test_resources_with_args( resources.nsxv3_resources, args) + def _create_router(self): + tenant_id = uuidutils.generate_uuid() + data = {'router': {'tenant_id': tenant_id}} + data['router']['name'] = 'dummy' + data['router']['admin_state_up'] = True + + edgeapi = nsxv_utils.NeutronDbClient() + return self._plugin.create_router(edgeapi.context, data) + class TestNsxtvdAdminUtils(AbstractTestAdminUtils):