~niedbalski/ubuntu/vivid/neutron/fixes-1447803

« back to all changes in this revision

Viewing changes to neutron/tests/unit/bigswitch/test_restproxy_plugin.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-10-03 18:45:23 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20141003184523-4mt6dy1q3j8n30c9
Tags: 1:2014.2~rc1-0ubuntu1
* New upstream release candidate:
  - d/p/*: Refreshed.
  - d/control: Add python-requests-mock to BD's.
  - d/control: Align versioned requirements with upstream.
* Transition linuxbridge and openvswitch plugin users to modular
  layer 2 plugin (LP: #1323729):
  - d/control: Mark removed plugin packages as transitional, depend
    on neutron-plugin-ml2, mark oldlibs/extra.
  - d/neutron-plugin-{linuxbridge,openvswitch}.install: Drop.
  - d/control: Depend on neutron-plugin-ml2 for linuxbridge
    agent package.
  - d/neutron-plugin-linuxbridge-agent.upstart: Use ml2 plugin
    configuration files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        super(TestBigSwitchProxyPortsV2,
83
83
              self).setUp(self._plugin_name)
84
84
 
 
85
    def test_get_ports_no_id(self):
 
86
        with self.port(name='test'):
 
87
            ports = manager.NeutronManager.get_plugin().get_ports(
 
88
                context.get_admin_context(), fields=['name'])
 
89
            self.assertEqual(['name'], ports[0].keys())
 
90
 
85
91
    def test_router_port_status_active(self):
86
92
        # router ports screw up port auto-deletion so it has to be
87
93
        # disabled for this test
88
 
        with self.network(do_delete=False) as net:
89
 
            with self.subnet(network=net, do_delete=False) as sub:
 
94
        with self.network() as net:
 
95
            with self.subnet(network=net) as sub:
90
96
                with self.port(
91
97
                    subnet=sub,
92
98
                    do_delete=False,
210
216
    def test_port_vif_details_override(self):
211
217
        # ivshost is in the test config to override to IVS
212
218
        kwargs = {'name': 'name', 'binding:host_id': 'ivshost',
213
 
                  'device_id': 'override_dev'}
 
219
                  'device_id': 'override_dev',
 
220
                  'arg_list': ('binding:host_id',)}
214
221
        with self.port(**kwargs) as port:
215
222
            self.assertEqual(port['port']['binding:vif_type'],
216
223
                             portbindings.VIF_TYPE_IVS)
 
224
        self._delete('ports', port['port']['id'])
 
225
        self._delete('networks', port['port']['network_id'])
217
226
        kwargs = {'name': 'name2', 'binding:host_id': 'someotherhost',
218
227
                  'device_id': 'other_dev'}
219
228
        with self.port(**kwargs) as port:
230
239
            res = self.deserialize(self.fmt, req.get_response(self.api))
231
240
            self.assertEqual(res['port']['binding:vif_type'], self.VIF_TYPE)
232
241
 
233
 
    def _make_port(self, fmt, net_id, expected_res_status=None, arg_list=None,
234
 
                   **kwargs):
235
 
        arg_list = arg_list or ()
236
 
        arg_list += ('binding:host_id', )
237
 
        res = self._create_port(fmt, net_id, expected_res_status,
238
 
                                arg_list, **kwargs)
239
 
        # Things can go wrong - raise HTTP exc with res code only
240
 
        # so it can be caught by unit tests
241
 
        if res.status_int >= 400:
242
 
            raise webob.exc.HTTPClientError(code=res.status_int)
243
 
        return self.deserialize(fmt, res)
244
 
 
245
242
 
246
243
class TestVifDifferentDefault(BigSwitchProxyPluginV2TestCase):
247
244