~corey.bryant/charms/trusty/neutron-api/stuff

« back to all changes in this revision

Viewing changes to unit_tests/test_neutron_api_context.py

  • Committer: James Page
  • Date: 2015-11-04 18:02:37 UTC
  • mfrom: (39.9.67 neutron-api)
  • Revision ID: james.page@ubuntu.com-20151104180237-d858qfwj7oo0tzth
Add support for Nuage VSP SDN

This takes two forms

1) relation to the nuage-vsp charm

2) configuration options for an existing Nuage VSP installation

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
        self.test_config.set('nsx-tz-uuid', 'tzuuid')
273
273
        self.test_config.set('nsx-l3-uuid', 'l3uuid')
274
274
        self.test_config.set('nsx-controllers', 'ctrl1 ctrl2')
 
275
        self.test_config.set('vsd-server', '192.168.2.202')
 
276
        self.test_config.set('vsd-auth', 'fooadmin:password')
 
277
        self.test_config.set('vsd-organization', 'foo')
 
278
        self.test_config.set('vsd-base-uri', '/nuage/api/v1_0')
 
279
        self.test_config.set('vsd-netpart-name', 'foo-enterprise')
275
280
        self.test_config.set('plumgrid-username', 'plumgrid')
276
281
        self.test_config.set('plumgrid-password', 'plumgrid')
277
282
        self.test_config.set('plumgrid-virtual-ip', '192.168.100.250')
437
442
        for key in expect.iterkeys():
438
443
            self.assertEquals(napi_ctxt[key], expect[key])
439
444
 
 
445
    @patch.object(context.NeutronCCContext, 'network_manager')
 
446
    @patch.object(context.NeutronCCContext, 'plugin')
 
447
    @patch('__builtin__.__import__')
 
448
    def test_neutroncc_context_nuage(self, _import, plugin, nm):
 
449
        plugin.return_value = 'vsp'
 
450
        self.related_units.return_value = ['vsdunit1']
 
451
        self.relation_ids.return_value = ['vsdrid2']
 
452
        self.test_config.set('neutron-plugin', 'vsp')
 
453
        napi_ctxt = context.NeutronCCContext()()
 
454
        expect = {
 
455
            'vsd_server': '192.168.2.202',
 
456
            'vsd_auth': 'fooadmin:password',
 
457
            'vsd_organization': 'foo',
 
458
            'vsd_base_uri': '/nuage/api/v1_0',
 
459
            'vsd_netpart_name': 'foo-enterprise',
 
460
        }
 
461
        for key in expect.iterkeys():
 
462
            self.assertEquals(napi_ctxt[key], expect[key])
 
463
 
440
464
 
441
465
class EtcdContextTest(CharmTestCase):
442
466