use of org.onosproject.net.config.ConfigApplyDelegate in project onos by opennetworkinglab.
the class PiPipeconfManagerTest method setUp.
@Before
public void setUp() throws IOException {
mgr = new PiPipeconfManager();
pipeconf = BASIC_PIPECONF;
mgr.cfgService = cfgService;
mgr.driverAdminService = driverAdminService;
injectEventDispatcher(mgr, new TestEventDispatcher());
ObjectMapper mapper = new ObjectMapper();
ConfigApplyDelegate delegate = new MockDelegate();
String keyBasic = "basic";
JsonNode jsonNodeBasic = mapper.readTree(jsonStreamBasic);
basicDeviceConfig.init(DEVICE_ID, keyBasic, jsonNodeBasic, mapper, delegate);
mgr.activate();
}
use of org.onosproject.net.config.ConfigApplyDelegate in project onos by opennetworkinglab.
the class NetconfDeviceProviderTest method setUp.
@Before
public void setUp() throws IOException {
coreService = createMock(CoreService.class);
expect(coreService.registerApplication(APP_NAME)).andReturn(appId).anyTimes();
replay(coreService);
provider.coreService = coreService;
provider.providerRegistry = deviceRegistry;
provider.mastershipService = mastershipService;
provider.deviceService = deviceService;
provider.providerService = providerService;
provider.cfgService = cfgService;
provider.controller = controller;
provider.deviceKeyAdminService = deviceKeyAdminService;
provider.componentConfigService = new ComponentConfigAdapter();
AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
provider.activate(null);
devices.clear();
available = false;
firstRequest = true;
DeviceId subject = DeviceId.deviceId(NETCONF_DEVICE_ID_STRING);
DeviceId subjectIpv6 = DeviceId.deviceId(NETCONF_DEVICE_ID_STRING_IPV6);
String key = "netconf";
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readTree(jsonStream);
ConfigApplyDelegate delegate = new MockDelegate();
netconfDeviceConfig.init(subject, key, jsonNode, mapper, delegate);
JsonNode jsonNodesshKey = mapper.readTree(jsonStreamSshKey);
netconfDeviceConfigSshKey.init(subject, key, jsonNodesshKey, mapper, delegate);
JsonNode jsonNodeEmpty = mapper.createObjectNode();
netconfDeviceConfigEmptyIpv4.init(subject, key, jsonNodeEmpty, mapper, delegate);
netconfDeviceConfigEmptyIpv6.init(subjectIpv6, key, jsonNodeEmpty, mapper, delegate);
deviceAdded = new CountDownLatch(0);
}
use of org.onosproject.net.config.ConfigApplyDelegate in project onos by opennetworkinglab.
the class DefaultSnmpv3DeviceTest method setUp.
@Before
public void setUp() throws Exception {
JsonNode jsonNode = mapper.readTree(jsonStream);
ConfigApplyDelegate delegate = new DefaultSnmpv3DeviceTest.MockDelegate();
config.init(deviceId, KEY, jsonNode, mapper, delegate);
defaultSnmpv3Device = new DefaultSnmpv3Device(config);
}
use of org.onosproject.net.config.ConfigApplyDelegate in project onos by opennetworkinglab.
the class V3SnmpConfigurationTest method setUp.
@Before
public void setUp() throws Exception {
JsonNode jsonNode = mapper.readTree(jsonStream);
ConfigApplyDelegate delegate = new MockDelegate();
config.init(deviceId, KEY, jsonNode, mapper, delegate);
defaultSnmpv3Device = new DefaultSnmpv3Device(config);
v3SnmpConfiguration = V3SnmpConfiguration.builder().setAddress(defaultSnmpv3Device.getSnmpHost()).setSecurityName(defaultSnmpv3Device.getSecurityName()).setSecurityLevel(defaultSnmpv3Device.getSecurityLevel()).setAuthenticationProtocol(defaultSnmpv3Device.getAuthProtocol()).setAuthenticationPassword(defaultSnmpv3Device.getAuthPassword()).setPrivacyProtocol(defaultSnmpv3Device.getPrivProtocol()).setPrivacyPassword(defaultSnmpv3Device.getPrivPassword()).setContextName(defaultSnmpv3Device.getContextName()).build();
v3SnmpConfiguration.setPort(defaultSnmpv3Device.getSnmpPort());
}
use of org.onosproject.net.config.ConfigApplyDelegate in project trellis-control by opennetworkinglab.
the class RouteHandlerTest method setUp.
@Before
public void setUp() {
ObjectMapper mapper = new ObjectMapper();
ConfigApplyDelegate delegate = config -> {
};
SegmentRoutingDeviceConfig dev1Config = new SegmentRoutingDeviceConfig();
JsonNode dev1Tree = mapper.createObjectNode();
dev1Config.init(CP1.deviceId(), "host-handler-test", dev1Tree, mapper, delegate);
dev1Config.setPairDeviceId(CP2.deviceId()).setPairLocalPort(P9);
SegmentRoutingDeviceConfig dev2Config = new SegmentRoutingDeviceConfig();
JsonNode dev2Tree = mapper.createObjectNode();
dev2Config.init(CP2.deviceId(), "host-handler-test", dev2Tree, mapper, delegate);
dev2Config.setPairDeviceId(CP1.deviceId()).setPairLocalPort(P9);
MockNetworkConfigRegistry mockNetworkConfigRegistry = new MockNetworkConfigRegistry();
mockNetworkConfigRegistry.applyConfig(dev1Config);
mockNetworkConfigRegistry.applyConfig(dev2Config);
// Initialize Segment Routing Manager
srManager = new MockSegmentRoutingManager(NEXT_TABLE, ROUTER_MACS);
srManager.storageService = createMock(StorageService.class);
expect(srManager.storageService.consistentMapBuilder()).andReturn(new TestConsistentMap.Builder<>()).anyTimes();
expect(srManager.storageService.consistentMultimapBuilder()).andReturn(new TestConsistentMultimap.Builder<>()).anyTimes();
replay(srManager.storageService);
srManager.cfgService = new NetworkConfigRegistryAdapter();
srManager.deviceConfiguration = createMock(DeviceConfiguration.class);
srManager.flowObjectiveService = new MockFlowObjectiveService(BRIDGING_TABLE, NEXT_TABLE);
srManager.routingRulePopulator = new MockRoutingRulePopulator(srManager, ROUTING_TABLE);
srManager.defaultRoutingHandler = new MockDefaultRoutingHandler(srManager, SUBNET_TABLE, ROUTING_TABLE, LED_DEVICES);
srManager.interfaceService = new MockInterfaceService(INTERFACES);
hostService = new MockHostService(HOSTS);
srManager.hostService = hostService;
srManager.cfgService = mockNetworkConfigRegistry;
srManager.routeService = new MockRouteService(ROUTE_STORE);
srManager.phasedRecoveryService = createMock(PhasedRecoveryService.class);
expect(srManager.phasedRecoveryService.isEnabled()).andReturn(true).anyTimes();
replay(srManager.phasedRecoveryService);
routeHandler = new RouteHandler(srManager);
ROUTING_TABLE.clear();
BRIDGING_TABLE.clear();
SUBNET_TABLE.clear();
}
Aggregations