use of net.floodlightcontroller.core.SwitchDescription in project open-kilda by telstra.
the class ReplaceInstallFlowTest method initScheme.
protected void initScheme() {
scheme = new ReplaceSchemeOutputCommands();
switchDescription = new SwitchDescription("", "", "", "", "");
}
use of net.floodlightcontroller.core.SwitchDescription in project open-kilda by telstra.
the class PathTest method setUp.
@Before
public void setUp() throws Exception {
cntx = new FloodlightContext();
FloodlightModuleContext fmc = new FloodlightModuleContext();
fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
fmc.addService(IOFSwitchService.class, getMockSwitchService());
swDescription = factory.buildDescStatsReply().build();
swFeatures = factory.buildFeaturesReply().setNBuffers(1000).build();
sw1Port1 = EasyMock.createMock(OFPortDesc.class);
sw2Port1 = EasyMock.createMock(OFPortDesc.class);
expect(sw1Port1.getHwAddr()).andReturn(MacAddress.of(sw1HwAddrTarget)).anyTimes();
expect(sw1Port1.getPortNo()).andReturn(OFPort.of(1));
expect(sw2Port1.getHwAddr()).andReturn(MacAddress.of(sw2HwAddrTarget)).anyTimes();
expect(sw2Port1.getPortNo()).andReturn(OFPort.of(1));
sw1 = EasyMock.createMock(IOFSwitch.class);
expect(sw1.getId()).andReturn(sw1Id).anyTimes();
expect(sw1.getPort(OFPort.of(1))).andReturn(sw1Port1).anyTimes();
expect(sw1.getOFFactory()).andReturn(factory).anyTimes();
expect(sw1.getBuffers()).andReturn(swFeatures.getNBuffers()).anyTimes();
expect(sw1.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_TABLE)).andReturn(true).anyTimes();
expect(sw1.getSwitchDescription()).andReturn(new SwitchDescription(swDescription)).anyTimes();
expect(sw1.isActive()).andReturn(true).anyTimes();
expect(sw1.getLatency()).andReturn(U64.of(10L)).anyTimes();
expect(sw1.getInetAddress()).andReturn(sw1InetAddr).anyTimes();
sw2 = EasyMock.createMock(IOFSwitch.class);
expect(sw2.getId()).andReturn(sw2Id).anyTimes();
expect(sw2.getPort(OFPort.of(1))).andReturn(sw1Port1).anyTimes();
expect(sw2.getOFFactory()).andReturn(factory).anyTimes();
expect(sw2.getBuffers()).andReturn(swFeatures.getNBuffers()).anyTimes();
expect(sw2.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_TABLE)).andReturn(true).anyTimes();
expect(sw2.getSwitchDescription()).andReturn(new SwitchDescription(swDescription)).anyTimes();
expect(sw2.isActive()).andReturn(true).anyTimes();
expect(sw2.getLatency()).andReturn(U64.of(10L)).anyTimes();
expect(sw2.getInetAddress()).andReturn(sw2InetAddr).anyTimes();
replay(sw1Port1);
replay(sw2Port1);
replay(sw1);
replay(sw2);
packetIn = EasyMock.createMock(OFPacketIn.class);
pvs.initAlgorithm("secret");
}
use of net.floodlightcontroller.core.SwitchDescription in project open-kilda by telstra.
the class PathVerificationFlowTest method setUp.
@Before
public void setUp() throws Exception {
logger = LoggerFactory.getLogger(PathVerificationFlowTest.class);
cntx = new FloodlightContext();
FloodlightModuleContext fmc = new FloodlightModuleContext();
fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
swDescription = factory.buildDescStatsReply().build();
swFeatures = factory.buildFeaturesReply().setNBuffers(1000).build();
sw = EasyMock.createMock(IOFSwitch.class);
expect(sw.getId()).andReturn(swDpid).anyTimes();
expect(sw.getOFFactory()).andReturn(factory).anyTimes();
expect(sw.getBuffers()).andReturn(swFeatures.getNBuffers()).anyTimes();
expect(sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_TABLE)).andReturn(true).anyTimes();
expect(sw.getSwitchDescription()).andReturn(new SwitchDescription(swDescription)).anyTimes();
expect(sw.isActive()).andReturn(true).anyTimes();
expect(sw.getLatency()).andReturn(U64.of(10L)).anyTimes();
replay(sw);
pvs = new PathVerificationService();
}
use of net.floodlightcontroller.core.SwitchDescription in project open-kilda by telstra.
the class FloodlightTestCase method buildMockIOFSwitch.
public IOFSwitch buildMockIOFSwitch(Long id, OFPortDesc portDesc, OFFactory factory, OFDescStatsReply swDesc, InetSocketAddress inetAddr) {
IOFSwitch sw = EasyMock.createMock(IOFSwitch.class);
expect(sw.getId()).andReturn(DatapathId.of(id)).anyTimes();
expect(sw.getPort(OFPort.of(1))).andReturn(portDesc).anyTimes();
expect(sw.getOFFactory()).andReturn(factory).anyTimes();
expect(sw.getBuffers()).andReturn(swFeatures.getNBuffers()).anyTimes();
expect(sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_TABLE)).andReturn(true).anyTimes();
expect(sw.getSwitchDescription()).andReturn(new SwitchDescription(swDesc)).anyTimes();
expect(sw.isActive()).andReturn(true).anyTimes();
expect(sw.getLatency()).andReturn(U64.of(10L)).anyTimes();
expect(sw.getInetAddress()).andReturn(inetAddr).anyTimes();
return sw;
}
Aggregations