def setUp(self):
        if 'v6' in self._testMethodName:
            self.skipTest("NVSD Plugin does not support IPV6.")

        def mocked_oneconvergence_init(self):
            def side_effect(*args, **kwargs):
                return {'id': str(uuid.uuid4())}

            self.nvsdlib = mock.Mock()
            self.nvsdlib.create_network.side_effect = side_effect

        test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
        notifier_cls = mock.patch(AGENTNOTIFIER).start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        self._attribute_map_bk_ = {}
        for item in attributes.RESOURCE_ATTRIBUTE_MAP:
            self._attribute_map_bk_[item] = (attributes.
                                             RESOURCE_ATTRIBUTE_MAP[item].
                                             copy())
        with mock.patch.object(nvsd_plugin.OneConvergencePluginV2,
                               'oneconvergence_init',
                               new=mocked_oneconvergence_init):
            super(OneConvergenceSecurityGroupsTestCase,
                  self).setUp(PLUGIN_NAME)
    def setUp(self):
        if 'v6' in self._testMethodName:
            self.skipTest("NVSD Plugin does not support IPV6.")

        def mocked_oneconvergence_init(self):
            def side_effect(*args, **kwargs):
                return {'id': str(uuid.uuid4())}

            self.nvsdlib = mock.Mock()
            self.nvsdlib.create_network.side_effect = side_effect

        test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
        notifier_cls = mock.patch(AGENTNOTIFIER).start()
        self.notifier = mock.Mock()
        notifier_cls.return_value = self.notifier
        self._attribute_map_bk_ = {}
        for item in attributes.RESOURCE_ATTRIBUTE_MAP:
            self._attribute_map_bk_[item] = (attributes.
                                             RESOURCE_ATTRIBUTE_MAP[item].
                                             copy())
        with mock.patch.object(nvsd_plugin.OneConvergencePluginV2,
                               'oneconvergence_init',
                               new=mocked_oneconvergence_init):
            super(OneConvergenceSecurityGroupsTestCase,
                  self).setUp(PLUGIN_NAME)
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     self.setup_config_files()
     self.setup_patches()
     self._attribute_map_bk_ = {}
     super(RestProxySecurityGroupsTestCase, self).setUp(self.plugin_str)
     plugin = manager.NeutronManager.get_plugin()
     self.notifier = plugin.notifier
     self.rpc = plugin.callbacks
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     self.fake_ryu = fake_ryu.patch_fake_ryu_client().start()
     self.notifier = mock.patch(NOTIFIER).start().return_value
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = (
             attributes.RESOURCE_ATTRIBUTE_MAP[item].copy())
     super(RyuSecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     self.fake_ryu = fake_ryu.patch_fake_ryu_client().start()
     self.notifier = mock.patch(NOTIFIER).start().return_value
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = (attributes.
                                          RESOURCE_ATTRIBUTE_MAP[item].
                                          copy())
     super(RyuSecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_IPTABLES_DRIVER)
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = attributes.RESOURCE_ATTRIBUTE_MAP[item].copy()
     super(LinuxBridgeSecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
     self.addCleanup(mock.patch.stopall)
示例#7
0
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     mock.patch(NOTIFIER).start()
     mock.patch(OFC_MANAGER).start()
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = attributes.RESOURCE_ATTRIBUTE_MAP[item].copy()
     super(NecSecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
     plugin = manager.NeutronManager.get_plugin()
     self.notifier = plugin.notifier
     self.rpc = plugin.callback_sg
示例#8
0
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = (
             attributes.RESOURCE_ATTRIBUTE_MAP[item].copy())
     super(Ml2SecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
示例#9
0
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     self.addCleanup(mock.patch.stopall)
     mock.patch(NOTIFIER).start()
     mock.patch(OFC_MANAGER).start()
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = (
             attributes.RESOURCE_ATTRIBUTE_MAP[item].copy())
     super(NecSecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
     self.notifier = manager.NeutronManager.get_plugin().notifier
示例#10
0
 def setUp(self, plugin=None):
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     self._attribute_map_bk_ = {}
     for item in attributes.RESOURCE_ATTRIBUTE_MAP:
         self._attribute_map_bk_[item] = (attributes.
                                          RESOURCE_ATTRIBUTE_MAP[item].
                                          copy())
     super(OpenvswitchSecurityGroupsTestCase, self).setUp(PLUGIN_NAME)
示例#11
0
 def setUp(self):
     manager.NeutronManager._instance = None
     extensions.PluginAwareExtensionManager._instance = None
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     self.dhcp_notifier_cls_p = mock.patch(
         'neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.'
         'DhcpAgentNotifyAPI')
     self.dhcp_notifier = mock.Mock(name='dhcp_notifier')
     self.dhcp_notifier_cls = self.dhcp_notifier_cls_p.start()
     self.dhcp_notifier_cls.return_value = self.dhcp_notifier
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     if self.l3_plugin:
         service_plugins = {'l3_plugin_name': self.l3_plugin}
     else:
         service_plugins = None
     super(UosTestCase, self).setUp(self.plugin_str,
                                    service_plugins=service_plugins)
     ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
     self.ext_api = test_extensions.setup_extensions_middleware(ext_mgr)
     self.adminContext = context.get_admin_context()
     self.addCleanup(mock.patch.stopall)
示例#12
0
 def setUp(self):
     manager.NeutronManager._instance = None
     extensions.PluginAwareExtensionManager._instance = None
     test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
     self.dhcp_notifier_cls_p = mock.patch(
         'neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.'
         'DhcpAgentNotifyAPI')
     self.dhcp_notifier = mock.Mock(name='dhcp_notifier')
     self.dhcp_notifier_cls = self.dhcp_notifier_cls_p.start()
     self.dhcp_notifier_cls.return_value = self.dhcp_notifier
     notifier_p = mock.patch(NOTIFIER)
     notifier_cls = notifier_p.start()
     self.notifier = mock.Mock()
     notifier_cls.return_value = self.notifier
     if self.l3_plugin:
         service_plugins = {'l3_plugin_name': self.l3_plugin}
     else:
         service_plugins = None
     super(UosTestCase, self).setUp(
         self.plugin_str, service_plugins=service_plugins)
     ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
     self.ext_api = test_extensions.setup_extensions_middleware(ext_mgr)
     self.adminContext = context.get_admin_context()
     self.addCleanup(mock.patch.stopall)
示例#13
0
 def setUp(self, firewall_driver=None):
     test_sg_rpc.set_firewall_driver(self.FIREWALL_DRIVER)
     config.cfg.CONF.set_override(
         'enable_security_group', self.ENABLE_SG,
         group='SECURITYGROUP')
     super(TestMl2PortBinding, self).setUp()
示例#14
0
 def setUp(self, firewall_driver=None):
     test_sg_rpc.set_firewall_driver(self.FIREWALL_DRIVER)
     super(TestMl2PortBinding, self).setUp()
示例#15
0
 def setUp(self):
     test_sg_rpc.set_firewall_driver(self.FIREWALL_DRIVER)
     cfg.CONF.set_override('enable_security_group',
                           self.ENABLE_SG,
                           group='SECURITYGROUP')
     super(TestNecPortBinding, self).setUp()
示例#16
0
 def setUp(self):
     test_sg_rpc.set_firewall_driver(self.FIREWALL_DRIVER)
     cfg.CONF.set_override("enable_security_group", self.ENABLE_SG, group="SECURITYGROUP")
     super(TestNecPortBinding, self).setUp()
示例#17
0
 def setUp(self):
     test_sg_rpc.set_firewall_driver(self.FIREWALL_DRIVER)
     super(TestLinuxBridgePortBinding, self).setUp()
 def setUp(self):
     test_sg_rpc.set_firewall_driver(self.FIREWALL_DRIVER)
     super(TestLinuxBridgePortBinding, self).setUp()