def tearDown(self):
     core.ModelBase.metadata.drop_all(core.get_engine())
     test_utils.get_resource_store().clean()
     cfg.CONF.unregister_opts(q_config.core_opts)
     xmanager.IN_TEST = False
from oslo_utils import uuidutils

from tricircle.common import client
from tricircle.common import constants
from tricircle.common import context
import tricircle.db.api as db_api
from tricircle.db import core
from tricircle.db import models
from tricircle.network import central_plugin
import tricircle.network.central_trunk_plugin as trunk_plugin
from tricircle.network import helper
import tricircle.tests.unit.utils as test_utils
from tricircle.xjob import xmanager


_resource_store = test_utils.get_resource_store()
TOP_TRUNKS = _resource_store.TOP_TRUNKS
TOP_SUBPORTS = _resource_store.TOP_SUBPORTS
TOP_PORTS = _resource_store.TOP_PORTS
BOTTOM1_TRUNKS = _resource_store.BOTTOM1_TRUNKS
BOTTOM2_TRUNKS = _resource_store.BOTTOM2_TRUNKS
BOTTOM1_SUBPORTS = _resource_store.BOTTOM1_SUBPORTS
BOTTOM2_SUBPORTS = _resource_store.BOTTOM2_SUBPORTS
BOTTOM1_PORTS = _resource_store.BOTTOM1_PORTS
BOTTOM2_PORTS = _resource_store.BOTTOM2_PORTS
TEST_TENANT_ID = test_utils.TEST_TENANT_ID


class FakeBaseXManager(xmanager.XManager):
    def __init__(self):
        self.clients = {constants.TOP: client.Client()}
Пример #3
0
 def tearDown(self):
     cfg.CONF.unregister_opts(q_config.core_opts)
     test_utils.get_resource_store().clean()
Пример #4
0
 def tearDown(self):
     core.ModelBase.metadata.drop_all(core.get_engine())
     test_utils.get_resource_store().clean()
     cfg.CONF.unregister_opts(q_config.core_opts)
Пример #5
0
from oslo_utils import uuidutils

import neutron.conf.common as q_config
from neutron_lib.api.definitions import portbindings
import neutron_lib.constants as q_constants
import neutron_lib.exceptions as q_exceptions
import neutronclient.common.exceptions as q_cli_exceptions

from tricircle.common import context
from tricircle.common import exceptions as t_exceptions
import tricircle.db.api as db_api
from tricircle.db import core
from tricircle.network import helper
import tricircle.tests.unit.utils as test_utils

_resource_store = test_utils.get_resource_store()
TOP_NETS = _resource_store.TOP_NETWORKS
TOP_SUBNETS = _resource_store.TOP_SUBNETS
BOTTOM1_NETS = _resource_store.BOTTOM1_NETWORKS
BOTTOM1_PORTS = _resource_store.BOTTOM1_PORTS
BOTTOM1_ROUTERS = _resource_store.BOTTOM1_ROUTERS


def get_resource_list(_type, is_top):
    pod = 'top' if is_top else 'pod_1'
    return _resource_store.pod_store_map[pod][_type]


def get_resource(_type, is_top, resource_id):
    for resource in get_resource_list(_type, is_top):
        if resource['id'] == resource_id:
Пример #6
0
 def tearDown(self):
     test_utils.get_resource_store().clean()