예제 #1
0
 def setUp(self):
     super(TestACLs, self).setUp()
     self.driver = mock.Mock()
     self.driver._nb_ovn = fakes.FakeOvsdbNbOvnIdl()
     self.plugin = fakes.FakePlugin()
     self.admin_context = mock.Mock()
     self.fake_port = fakes.FakePort.create_one_port({
         'id':
         'fake_port_id1',
         'network_id':
         'network_id1',
         'fixed_ips': [{
             'subnet_id': 'subnet_id1',
             'ip_address': '1.1.1.1'
         }],
     }).info()
     self.fake_subnet = fakes.FakeSubnet.create_one_subnet({
         'id':
         'subnet_id1',
         'ip_version':
         4,
         'cidr':
         '1.1.1.0/24',
     }).info()
     patcher = mock.patch(
         'neutron.agent.ovsdb.native.idlutils.row_by_value',
         lambda *args, **kwargs: mock.MagicMock())
     patcher.start()
예제 #2
0
 def setUp(self):
     super(TestACLs, self).setUp()
     self.driver = mock.Mock()
     self.driver._nb_ovn = fakes.FakeOvsdbNbOvnIdl()
     self.plugin = fakes.FakePlugin()
     self.admin_context = mock.Mock()
     self.fake_port = fakes.FakePort.create_one_port({
         'id':
         'fake_port_id1',
         'network_id':
         'network_id1',
         'fixed_ips': [{
             'subnet_id': 'subnet_id1',
             'ip_address': '1.1.1.1'
         }],
     }).info()
     self.fake_subnet = fakes.FakeSubnet.create_one_subnet({
         'id':
         'subnet_id1',
         'ip_version':
         4,
         'cidr':
         '1.1.1.0/24',
     }).info()
     patcher = mock.patch('ovsdbapp.backend.ovs_idl.idlutils.row_by_value',
                          lambda *args, **kwargs: mock.MagicMock())
     patcher.start()
     mock.patch(
         "networking_ovn.common.acl._acl_columns_name_severity_supported",
         return_value=True).start()