use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class VirtualNetworkTopologyProviderTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
coreService = new VirtualNetworkTopologyProviderTest.TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
manager = new VirtualNetworkManager();
TestUtils.setField(manager, "coreService", coreService);
TestUtils.setField(manager, "store", virtualNetworkManagerStore);
TestUtils.setField(manager, "intentService", intentService);
NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
testDirectory = new TestServiceDirectory();
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
topologyService = manager.get(virtualNetwork.id(), TopologyService.class);
topologyProvider = new DefaultVirtualNetworkProvider();
topologyProvider.topologyService = topologyService;
topologyProvider.providerRegistry = virtualNetworkRegistry;
topologyProvider.activate();
setupVirtualNetworkTopology();
changed = new Semaphore(0, true);
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class VplsStoreTest method setup.
@Before
public void setup() {
vplsStore = new DistributedVplsStore();
vplsStore.coreService = new TestCoreService();
vplsStore.storageService = new TestStorageService();
vplsStore.networkConfigService = new TestConfigService();
vplsStore.active();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class NetworkConfigManagerTest method setUp.
@Before
public void setUp() throws Exception {
configStore = new DistributedNetworkConfigStore();
TestUtils.setField(configStore, "storageService", new TestStorageService());
configStore.activate();
manager = new NetworkConfigManager();
manager.store = configStore;
NetTestTools.injectEventDispatcher(manager, new EventDeliveryServiceAdapter());
manager.clusterService = clusterService;
manager.activate();
registry = manager;
configService = manager;
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class KubevirtNodeManagerTest method setUp.
@Before
public void setUp() {
nodeStore = new DistributedKubevirtNodeStore();
TestUtils.setField(nodeStore, "coreService", new TestCoreService());
TestUtils.setField(nodeStore, "storageService", new TestStorageService());
TestUtils.setField(nodeStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
nodeStore.activate();
nodeStore.createNode(WORKER_2);
nodeStore.createNode(WORKER_3);
target = new KubevirtNodeManager();
target.storageService = new TestStorageService();
target.coreService = new TestCoreService();
target.clusterService = new TestClusterService();
target.leadershipService = new TestLeadershipService();
target.nodeStore = nodeStore;
target.addListener(testListener);
target.activate();
testListener.events.clear();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class OpenstackSecurityGroupManagerTest method setUp.
/**
* Initial setup for this unit test.
*/
@Before
public void setUp() throws Exception {
store = new DistributedSecurityGroupStore();
TestUtils.setField(store, "coreService", new TestCoreService());
TestUtils.setField(store, "storageService", new TestStorageService());
TestUtils.setField(store, "eventExecutor", MoreExecutors.newDirectExecutorService());
store.activate();
target = new OpenstackSecurityGroupManager();
TestUtils.setField(target, "coreService", new TestCoreService());
target.osSecurityGroupStore = store;
target.addListener(testOpenstackSecurityGroupListener);
target.activate();
securityGroupRule11 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_1_1).securityGroupId(SECURITY_GROUP_ID_1).tenantId(SECURITY_GROUP_TENANT_ID_1).remoteGroupId(SECURITY_GROUP_ID_1).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_1).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_1).protocol(SECURITY_GROUP_PROTOCOL_1).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_1).build();
securityGroupRule12 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_1_2).securityGroupId(SECURITY_GROUP_ID_1).tenantId(SECURITY_GROUP_TENANT_ID_1).remoteGroupId(SECURITY_GROUP_ID_1).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_1).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_1).protocol(SECURITY_GROUP_PROTOCOL_1).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_1).build();
securityGroupRule21 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_2_1).securityGroupId(SECURITY_GROUP_ID_2).tenantId(SECURITY_GROUP_TENANT_ID_2).remoteGroupId(SECURITY_GROUP_ID_2).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_2).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_2).protocol(SECURITY_GROUP_PROTOCOL_2).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_2).build();
securityGroupRule22 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_2_2).securityGroupId(SECURITY_GROUP_ID_2).tenantId(SECURITY_GROUP_TENANT_ID_2).remoteGroupId(SECURITY_GROUP_ID_2).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_2).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_2).protocol(SECURITY_GROUP_PROTOCOL_2).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_2).build();
securityGroupRules1 = ImmutableList.of(securityGroupRule11, securityGroupRule12);
securityGroupRules2 = ImmutableList.of(securityGroupRule21, securityGroupRule22);
securityGroup1 = NeutronSecurityGroup.builder().id(SECURITY_GROUP_ID_1).name(SECURITY_GROUP_NAME_1).tenantId(SECURITY_GROUP_TENANT_ID_1).description(SECURITY_GROUP_DESCRIPTION_1).build();
securityGroup2 = NeutronSecurityGroup.builder().id(SECURITY_GROUP_ID_2).name(SECURITY_GROUP_NAME_2).tenantId(SECURITY_GROUP_TENANT_ID_2).description(SECURITY_GROUP_DESCRIPTION_2).build();
}
Aggregations