vmware-nsx/quantum/tests/unit/linuxbridge/test_linuxbridge_plugin.py
Gary Kotton 77f2f276d3 LinuxBridge: set port status as 'DOWN' on creation
When a port is created the initial status will be 'DOWN'. The agent
in turn will update the plugin of the actual port status.

Change-Id: I66b51501304f7cb3f0157a4adaec4b82c62b30a3
2013-01-23 16:39:13 +00:00

58 lines
1.9 KiB
Python

# Copyright (c) 2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from quantum.extensions import portbindings
from quantum.tests.unit import _test_extension_portbindings as test_bindings
from quantum.tests.unit import test_db_plugin as test_plugin
PLUGIN_NAME = ('quantum.plugins.linuxbridge.'
'lb_quantum_plugin.LinuxBridgePluginV2')
class LinuxBridgePluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase):
_plugin_name = PLUGIN_NAME
def setUp(self):
super(LinuxBridgePluginV2TestCase, self).setUp(PLUGIN_NAME)
self.port_create_status = 'DOWN'
class TestLinuxBridgeBasicGet(test_plugin.TestBasicGet,
LinuxBridgePluginV2TestCase):
pass
class TestLinuxBridgeV2HTTPResponse(test_plugin.TestV2HTTPResponse,
LinuxBridgePluginV2TestCase):
pass
class TestLinuxBridgePortsV2(test_plugin.TestPortsV2,
LinuxBridgePluginV2TestCase,
test_bindings.PortBindingsTestCase):
VIF_TYPE = portbindings.VIF_TYPE_BRIDGE
HAS_PORT_FILTER = True
def test_update_port_status_build(self):
with self.port() as port:
self.assertEqual(port['port']['status'], 'DOWN')
self.assertEqual(self.port_create_status, 'DOWN')
class TestLinuxBridgeNetworksV2(test_plugin.TestNetworksV2,
LinuxBridgePluginV2TestCase):
pass