Search in sources :

Example 1 with OFDescStatsReply

use of org.projectfloodlight.openflow.protocol.OFDescStatsReply in project open-kilda by telstra.

the class PathVerificationCommonTests method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();
    fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
    fmc.addService(FeatureDetectorService.class, featureDetectorService);
    fmc.addService(IOFSwitchService.class, getMockSwitchService());
    pvs = new PathVerificationService();
    pvs.initAlgorithm("secret");
    fmc.addConfigParam(pvs, "isl_bandwidth_quotient", "0.0");
    fmc.addConfigParam(pvs, "hmac256-secret", "secret");
    fmc.addConfigParam(pvs, "bootstrap-servers", "");
    pvs.init(fmc);
    InetSocketAddress srcIpTarget = new InetSocketAddress("192.168.10.1", 200);
    long switchId = 0x112233445566L;
    OFPortDesc portDescription = EasyMock.createMock(OFPortDesc.class);
    OFDescStatsReply swDescription = factory.buildDescStatsReply().build();
    sw = buildMockIoFSwitch(switchId, portDescription, factory, swDescription, srcIpTarget);
    replay(sw);
}
Also used : OFDescStatsReply(org.projectfloodlight.openflow.protocol.OFDescStatsReply) OFPortDesc(org.projectfloodlight.openflow.protocol.OFPortDesc) InetSocketAddress(java.net.InetSocketAddress) FloodlightModuleContext(net.floodlightcontroller.core.module.FloodlightModuleContext) Before(org.junit.Before)

Example 2 with OFDescStatsReply

use of org.projectfloodlight.openflow.protocol.OFDescStatsReply in project open-kilda by telstra.

the class PathVerificationPacketOutTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    FloodlightModuleContext fmc = new FloodlightModuleContext();
    fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
    fmc.addService(IOFSwitchService.class, getMockSwitchService());
    fmc.addService(FeatureDetectorService.class, featureDetectorService);
    OFDescStatsReply swDescription = factory.buildDescStatsReply().build();
    PathVerificationServiceConfig config = EasyMock.createMock(PathVerificationServiceConfig.class);
    expect(config.getVerificationBcastPacketDst()).andReturn(VERIFICATION_BCAST_PACKET_DST).anyTimes();
    replay(config);
    pvs = new PathVerificationService();
    pvs.setConfig(config);
    pvs.initAlgorithm("secret");
    fmc.addConfigParam(pvs, "isl_bandwidth_quotient", "0.0");
    fmc.addConfigParam(pvs, "hmac256-secret", "secret");
    fmc.addConfigParam(pvs, "bootstrap-servers", "");
    pvs.init(fmc);
    srcIpTarget = new InetSocketAddress("192.168.10.1", 200);
    dstIpTarget = new InetSocketAddress("192.168.10.101", 100);
    long sw1HwAddrTarget = 0x112233445566L;
    long sw2HwAddrTarget = 0xAABBCCDDEEFFL;
    OFPortDesc sw1Port1 = EasyMock.createMock(OFPortDesc.class);
    OFPortDesc sw2Port1 = EasyMock.createMock(OFPortDesc.class);
    expect(sw2Port1.getHwAddr()).andReturn(MacAddress.of(sw2HwAddrTarget)).anyTimes();
    replay(sw2Port1);
    sw1 = buildMockIoFSwitch(sw1HwAddrTarget, sw1Port1, factory, swDescription, srcIpTarget);
    sw2 = buildMockIoFSwitch(sw2HwAddrTarget, sw2Port1, factory, swDescription, dstIpTarget);
    replay(sw1);
    replay(sw2);
}
Also used : OFDescStatsReply(org.projectfloodlight.openflow.protocol.OFDescStatsReply) OFPortDesc(org.projectfloodlight.openflow.protocol.OFPortDesc) InetSocketAddress(java.net.InetSocketAddress) FloodlightModuleContext(net.floodlightcontroller.core.module.FloodlightModuleContext) Before(org.junit.Before)

Aggregations

InetSocketAddress (java.net.InetSocketAddress)2 FloodlightModuleContext (net.floodlightcontroller.core.module.FloodlightModuleContext)2 Before (org.junit.Before)2 OFDescStatsReply (org.projectfloodlight.openflow.protocol.OFDescStatsReply)2 OFPortDesc (org.projectfloodlight.openflow.protocol.OFPortDesc)2