Пример #1
0
 def testc_delete_ofc_tenant(self):
     """test delete ofc_tenant"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCTenant, t))
     self.ofc.delete_ofc_tenant(t)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCTenant, t))
Пример #2
0
 def testc_delete_ofc_tenant(self):
     """test delete ofc_tenant"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCTenant, t))
     self.ofc.delete_ofc_tenant(t)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCTenant, t))
Пример #3
0
 def testf_delete_ofc_network(self):
     """test delete ofc_network"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCNetwork, n))
     self.ofc.delete_ofc_network(t, n)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCNetwork, n))
Пример #4
0
 def testf_delete_ofc_network(self):
     """test delete ofc_network"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCNetwork, n))
     self.ofc.delete_ofc_network(t, n)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCNetwork, n))
Пример #5
0
 def testa_create_ofc_tenant(self):
     """test create ofc_tenant"""
     t, n, p, f, none = self.get_random_params()
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCTenant, t))
     self.ofc.create_ofc_tenant(t)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCTenant, t))
     tenant = ndb.find_ofc_item(nmodels.OFCTenant, t)
     self.assertEqual(tenant.id, "ofc-" + t[:-4])
Пример #6
0
 def testa_create_ofc_tenant(self):
     """test create ofc_tenant"""
     t, n, p, f, none = self.get_random_params()
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCTenant, t))
     self.ofc.create_ofc_tenant(t)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCTenant, t))
     tenant = ndb.find_ofc_item(nmodels.OFCTenant, t)
     self.assertEqual(tenant.id, "ofc-" + t[:-4])
Пример #7
0
 def testd_create_ofc_network(self):
     """test create ofc_network"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCNetwork, n))
     self.ofc.create_ofc_network(t, n)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCNetwork, n))
     network = ndb.find_ofc_item(nmodels.OFCNetwork, n)
     self.assertEqual(network.id, "ofc-" + n[:-4])
Пример #8
0
 def testl_delete_ofc_packet_filter(self):
     """test delete ofc_filter"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     self.ofc.create_ofc_packet_filter(t, n, f, {})
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCFilter, f))
     self.ofc.delete_ofc_packet_filter(t, n, f)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCFilter, f))
Пример #9
0
 def testd_create_ofc_network(self):
     """test create ofc_network"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCNetwork, n))
     self.ofc.create_ofc_network(t, n)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCNetwork, n))
     network = ndb.find_ofc_item(nmodels.OFCNetwork, n)
     self.assertEqual(network.id, "ofc-" + n[:-4])
Пример #10
0
 def testl_delete_ofc_packet_filter(self):
     """test delete ofc_filter"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     self.ofc.create_ofc_packet_filter(t, n, f, {})
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCFilter, f))
     self.ofc.delete_ofc_packet_filter(t, n, f)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCFilter, f))
Пример #11
0
 def testj_create_ofc_packet_filter(self):
     """test create ofc_filter"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCFilter, f))
     self.ofc.create_ofc_packet_filter(t, n, f, {})
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCFilter, f))
     _filter = ndb.find_ofc_item(nmodels.OFCFilter, f)
     self.assertEqual(_filter.id, "ofc-" + f[:-4])
Пример #12
0
 def testi_delete_ofc_port(self):
     """test delete ofc_port"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     ndb.add_portinfo(p, "0xabc", 3, 65535, "00:13:22:33:44:55")
     self.ofc.create_ofc_port(t, n, p)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCPort, p))
     self.ofc.delete_ofc_port(t, n, p)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCPort, p))
Пример #13
0
    def testc_find_ofc_item(self):
        """test find OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(nmodels.OFCTenant, o, q)
        tenant = ndb.find_ofc_item(nmodels.OFCTenant, q)
        self.assertEqual(tenant.id, o)
        self.assertEqual(tenant.quantum_id, q)

        tenant_none = ndb.find_ofc_item(nmodels.OFCTenant, n)
        self.assertEqual(None, tenant_none)
Пример #14
0
    def testc_find_ofc_item(self):
        """test find OFC item."""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        tenant = ndb.find_ofc_item(self.session, 'ofc_tenant', o)
        self.assertEqual(tenant.ofc_id, o)
        self.assertEqual(tenant.quantum_id, q)

        tenant_none = ndb.find_ofc_item(self.session, 'ofc_tenant', n)
        self.assertEqual(None, tenant_none)
Пример #15
0
 def testj_create_ofc_packet_filter(self):
     """test create ofc_filter"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCFilter, f))
     self.ofc.create_ofc_packet_filter(t, n, f, {})
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCFilter, f))
     _filter = ndb.find_ofc_item(nmodels.OFCFilter, f)
     self.assertEqual(_filter.id, "ofc-" + f[:-4])
Пример #16
0
    def testc_find_ofc_item(self):
        """test find OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(nmodels.OFCTenant, o, q)
        tenant = ndb.find_ofc_item(nmodels.OFCTenant, q)
        self.assertEqual(tenant.id, o)
        self.assertEqual(tenant.quantum_id, q)

        tenant_none = ndb.find_ofc_item(nmodels.OFCTenant, n)
        self.assertEqual(None, tenant_none)
Пример #17
0
    def testc_find_ofc_item(self):
        """test find OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        tenant = ndb.find_ofc_item(self.session, 'ofc_tenant', o)
        self.assertEqual(tenant.ofc_id, o)
        self.assertEqual(tenant.quantum_id, q)

        tenant_none = ndb.find_ofc_item(self.session, 'ofc_tenant', n)
        self.assertEqual(None, tenant_none)
Пример #18
0
 def testi_delete_ofc_port(self):
     """test delete ofc_port"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     ndb.add_portinfo(p, "0xabc", 3, 65535, "00:13:22:33:44:55")
     self.ofc.create_ofc_port(t, n, p)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCPort, p))
     self.ofc.delete_ofc_port(t, n, p)
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCPort, p))
Пример #19
0
 def testg_create_ofc_port(self):
     """test create ofc_port"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     ndb.add_portinfo(p, "0xabc", 1, 65535, "00:11:22:33:44:55")
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCPort, p))
     self.ofc.create_ofc_port(t, n, p)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCPort, p))
     port = ndb.find_ofc_item(nmodels.OFCPort, p)
     self.assertEqual(port.id, "ofc-" + p[:-4])
Пример #20
0
 def testg_create_ofc_port(self):
     """test create ofc_port"""
     t, n, p, f, none = self.get_random_params()
     self.ofc.create_ofc_tenant(t)
     self.ofc.create_ofc_network(t, n)
     ndb.add_portinfo(p, "0xabc", 1, 65535, "00:11:22:33:44:55")
     self.assertFalse(ndb.find_ofc_item(nmodels.OFCPort, p))
     self.ofc.create_ofc_port(t, n, p)
     self.assertTrue(ndb.find_ofc_item(nmodels.OFCPort, p))
     port = ndb.find_ofc_item(nmodels.OFCPort, p)
     self.assertEqual(port.id, "ofc-" + p[:-4])
Пример #21
0
 def _get_ofc_id(self, resource, quantum_id):
     model = self.resource_map[resource]
     ofc_item = ndb.find_ofc_item(model, quantum_id)
     if not ofc_item:
         reason = "NotFound %s for quantum_id=%s." % (resource, quantum_id)
         raise nexc.OFCConsistencyBroken(reason=reason)
     return ofc_item.id
Пример #22
0
 def _get_ofc_id(self, resource, quantum_id):
     model = self.resource_map[resource]
     ofc_item = ndb.find_ofc_item(model, quantum_id)
     if not ofc_item:
         reason = "NotFound %s for quantum_id=%s." % (resource, quantum_id)
         raise nexc.OFCConsistencyBroken(reason=reason)
     return ofc_item.id
Пример #23
0
 def _get_ofc_id(self, resource, quantum_id):
     model = self.resource_map[resource]
     ofc_item = ndb.find_ofc_item(model, quantum_id)
     if not ofc_item:
         reason = _("NotFound %(resource)s for "
                    "quantum_id=%(quantum_id)s.") % locals()
         raise nexc.OFCConsistencyBroken(reason=reason)
     return ofc_item.id
Пример #24
0
 def _get_ofc_id(self, resource, quantum_id):
     model = self.resource_map[resource]
     ofc_item = ndb.find_ofc_item(model, quantum_id)
     if not ofc_item:
         reason = _("NotFound %(resource)s for "
                    "quantum_id=%(quantum_id)s.") % locals()
         raise nexc.OFCConsistencyBroken(reason=reason)
     return ofc_item.id
Пример #25
0
    def testc_del_ofc_item(self):
        """test delete OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(self.session, "ofc_tenant", q, o)
        ndb.del_ofc_item(self.session, "ofc_tenant", q)

        tenant_none = ndb.get_ofc_item(self.session, "ofc_tenant", q)
        self.assertEqual(None, tenant_none)
        tenant_none = ndb.find_ofc_item(self.session, "ofc_tenant", o)
        self.assertEqual(None, tenant_none)
Пример #26
0
    def testc_del_ofc_item(self):
        """test delete OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(nmodels.OFCTenant, o, q)
        ndb.del_ofc_item(nmodels.OFCTenant, o)

        tenant_none = ndb.get_ofc_item(nmodels.OFCTenant, q)
        self.assertEqual(None, tenant_none)
        tenant_none = ndb.find_ofc_item(nmodels.OFCTenant, q)
        self.assertEqual(None, tenant_none)
Пример #27
0
    def testc_del_ofc_item(self):
        """test delete OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(nmodels.OFCTenant, o, q)
        ndb.del_ofc_item(nmodels.OFCTenant, o)

        tenant_none = ndb.get_ofc_item(nmodels.OFCTenant, q)
        self.assertEqual(None, tenant_none)
        tenant_none = ndb.find_ofc_item(nmodels.OFCTenant, q)
        self.assertEqual(None, tenant_none)
Пример #28
0
    def testc_del_ofc_item(self):
        """test delete OFC item"""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        ndb.del_ofc_item(self.session, 'ofc_tenant', q)

        tenant_none = ndb.get_ofc_item(self.session, 'ofc_tenant', q)
        self.assertEqual(None, tenant_none)
        tenant_none = ndb.find_ofc_item(self.session, 'ofc_tenant', o)
        self.assertEqual(None, tenant_none)
Пример #29
0
 def _exists_ofc_item(self, resource, quantum_id):
     model = self.resource_map[resource]
     if ndb.find_ofc_item(model, quantum_id):
         return True
     else:
         return False
Пример #30
0
 def _exists_ofc_item(self, resource, quantum_id):
     model = self.resource_map[resource]
     if ndb.find_ofc_item(model, quantum_id):
         return True
     else:
         return False