Ejemplo n.º 1
0
    def delete_ofc_packet_filter(self, tenant_id, network_id, filter_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)
        ofc_net_id = self._get_ofc_id("ofc_network", network_id)
        ofc_pf_id = self._get_ofc_id("ofc_packet_filter", filter_id)

        res = self.driver.delete_filter(ofc_tenant_id, ofc_net_id, ofc_pf_id)
        ndb.del_ofc_item(nmodels.OFCFilter, ofc_pf_id)
Ejemplo n.º 2
0
    def delete_ofc_packet_filter(self, tenant_id, network_id, filter_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)
        ofc_net_id = self._get_ofc_id("ofc_network", network_id)
        ofc_pf_id = self._get_ofc_id("ofc_packet_filter", filter_id)

        res = self.driver.delete_filter(ofc_tenant_id, ofc_net_id, ofc_pf_id)
        ndb.del_ofc_item(nmodels.OFCFilter, ofc_pf_id)
Ejemplo n.º 3
0
    def delete_ofc_port(self, tenant_id, network_id, port_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)
        ofc_net_id = self._get_ofc_id("ofc_network", network_id)
        ofc_port_id = self._get_ofc_id("ofc_port", port_id)

        self.driver.delete_port(ofc_tenant_id, ofc_net_id, ofc_port_id)
        ndb.del_ofc_item(nmodels.OFCPort, ofc_port_id)
Ejemplo n.º 4
0
    def delete_ofc_port(self, tenant_id, network_id, port_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)
        ofc_net_id = self._get_ofc_id("ofc_network", network_id)
        ofc_port_id = self._get_ofc_id("ofc_port", port_id)

        self.driver.delete_port(ofc_tenant_id, ofc_net_id, ofc_port_id)
        ndb.del_ofc_item(nmodels.OFCPort, ofc_port_id)
Ejemplo n.º 5
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)
Ejemplo n.º 6
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)
Ejemplo n.º 7
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)
Ejemplo n.º 8
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)
Ejemplo n.º 9
0
    def _check_exists_ofc_item(self, mode, exp_new, exp_old):
        o, q, n = self.get_ofc_item_random_params()
        self._check_new_old_item(ndb.exists_ofc_item, q, False, False)
        self.assertFalse(ndb.exists_ofc_item_lookup_both(self.session, "ofc_tenant", q))

        ndb.add_ofc_item(self.session, "ofc_tenant", q, o, mode)
        self._check_new_old_item(ndb.exists_ofc_item, q, exp_new, exp_old)
        self.assertTrue(ndb.exists_ofc_item_lookup_both(self.session, "ofc_tenant", q))

        ndb.del_ofc_item(self.session, "ofc_tenant", q, mode)
        self._check_new_old_item(ndb.exists_ofc_item, q, False, False)
        self.assertFalse(ndb.exists_ofc_item_lookup_both(self.session, "ofc_tenant", q))
Ejemplo n.º 10
0
    def _check_exists_ofc_item(self, mode, exp_new, exp_old):
        o, q, n = self.get_ofc_item_random_params()
        self._check_new_old_item(ndb.exists_ofc_item, q, False, False)
        self.assertFalse(ndb.exists_ofc_item_lookup_both(
            self.session, 'ofc_tenant', q))

        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o, mode)
        self._check_new_old_item(ndb.exists_ofc_item, q, exp_new, exp_old)
        self.assertTrue(ndb.exists_ofc_item_lookup_both(
            self.session, 'ofc_tenant', q))

        ndb.del_ofc_item(self.session, 'ofc_tenant', q, mode)
        self._check_new_old_item(ndb.exists_ofc_item, q, False, False)
        self.assertFalse(ndb.exists_ofc_item_lookup_both(
            self.session, 'ofc_tenant', q))
Ejemplo n.º 11
0
    def _check_delete_ofc_item(self, mode, detect_mode=False):
        o, q, n = self.get_ofc_item_random_params()
        ret = ndb.add_ofc_item(self.session, 'ofc_tenant', q, o, mode)
        ofc_id = ret.ofc_id if mode == self.NEW else ret.id
        self.assertEqual(ofc_id, o)
        self.assertEqual(ret.quantum_id, q)
        ret = ndb.get_ofc_item(self.session, 'ofc_tenant', q, mode)
        ofc_id = ret.ofc_id if mode == self.NEW else ret.id
        self.assertEqual(ofc_id, o)
        self.assertEqual(ret.quantum_id, q)

        if detect_mode:
            ndb.del_ofc_item_lookup_both(self.session, 'ofc_tenant', q)
        else:
            ndb.del_ofc_item(self.session, 'ofc_tenant', q, mode)

        ret = ndb.get_ofc_item(self.session, 'ofc_tenant', q, self.NEW)
        self.assertEqual(ret, None)
        ret = ndb.get_ofc_item(self.session, 'ofc_tenant', q, self.OLD)
        self.assertEqual(ret, None)
Ejemplo n.º 12
0
    def _check_delete_ofc_item(self, mode, detect_mode=False):
        o, q, n = self.get_ofc_item_random_params()
        ret = ndb.add_ofc_item(self.session, 'ofc_tenant', q, o, mode)
        ofc_id = ret.ofc_id if mode == self.NEW else ret.id
        self.assertEqual(ofc_id, o)
        self.assertEqual(ret.quantum_id, q)
        ret = ndb.get_ofc_item(self.session, 'ofc_tenant', q, mode)
        ofc_id = ret.ofc_id if mode == self.NEW else ret.id
        self.assertEqual(ofc_id, o)
        self.assertEqual(ret.quantum_id, q)

        if detect_mode:
            ndb.del_ofc_item_lookup_both(self.session, 'ofc_tenant', q)
        else:
            ndb.del_ofc_item(self.session, 'ofc_tenant', q, mode)

        ret = ndb.get_ofc_item(self.session, 'ofc_tenant', q, self.NEW)
        self.assertEqual(ret, None)
        ret = ndb.get_ofc_item(self.session, 'ofc_tenant', q, self.OLD)
        self.assertEqual(ret, None)
Ejemplo n.º 13
0
    def delete_ofc_network(self, tenant_id, network_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)
        ofc_net_id = self._get_ofc_id("ofc_network", network_id)

        self.driver.delete_network(ofc_tenant_id, ofc_net_id)
        ndb.del_ofc_item(nmodels.OFCNetwork, ofc_net_id)
Ejemplo n.º 14
0
    def delete_ofc_tenant(self, tenant_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)

        self.driver.delete_tenant(ofc_tenant_id)
        ndb.del_ofc_item(nmodels.OFCTenant, ofc_tenant_id)
Ejemplo n.º 15
0
    def delete_ofc_network(self, tenant_id, network_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)
        ofc_net_id = self._get_ofc_id("ofc_network", network_id)

        self.driver.delete_network(ofc_tenant_id, ofc_net_id)
        ndb.del_ofc_item(nmodels.OFCNetwork, ofc_net_id)
Ejemplo n.º 16
0
    def delete_ofc_tenant(self, tenant_id):
        ofc_tenant_id = self._get_ofc_id("ofc_tenant", tenant_id)

        self.driver.delete_tenant(ofc_tenant_id)
        ndb.del_ofc_item(nmodels.OFCTenant, ofc_tenant_id)