Search in sources :

Example 11 with OFMeterMod

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

the class ReplaceInstallFlowTest method installOneSwitchNoneFlow.

@Test
public void installOneSwitchNoneFlow() throws IOException, InterruptedException {
    String value = Resources.toString(getClass().getResource("/install_one_switch_none_flow.json"), Charsets.UTF_8);
    InstallOneSwitchFlow data = (InstallOneSwitchFlow) prepareData(value);
    OFMeterMod meterCommand = scheme.installMeter(data.getBandwidth(), 1024, data.getMeterId());
    OFFlowAdd flowCommand = scheme.oneSwitchNoneFlowMod(data.getInputPort(), data.getOutputPort(), data.getMeterId(), 123L);
    runTest(value, flowCommand, meterCommand, null, null);
}
Also used : InstallOneSwitchFlow(org.openkilda.messaging.command.flow.InstallOneSwitchFlow) OFMeterMod(org.projectfloodlight.openflow.protocol.OFMeterMod) OFFlowAdd(org.projectfloodlight.openflow.protocol.OFFlowAdd) Test(org.junit.Test)

Example 12 with OFMeterMod

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

the class SwitchManagerTest method deleteMeter.

@Test
public void deleteMeter() throws SwitchOperationException {
    final Capture<OFMeterMod> capture = prepareForMeterTest();
    switchManager.deleteMeter(dpid, meterId);
    final OFMeterMod meterMod = capture.getValue();
    assertEquals(meterMod.getCommand(), OFMeterModCommand.DELETE);
    assertEquals(meterMod.getMeterId(), meterId);
}
Also used : OFMeterMod(org.projectfloodlight.openflow.protocol.OFMeterMod) Test(org.junit.Test)

Aggregations

OFMeterMod (org.projectfloodlight.openflow.protocol.OFMeterMod)12 Test (org.junit.Test)9 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)9 InstallIngressFlow (org.openkilda.messaging.command.flow.InstallIngressFlow)4 InstallOneSwitchFlow (org.openkilda.messaging.command.flow.InstallOneSwitchFlow)4 OFFactory (org.projectfloodlight.openflow.protocol.OFFactory)2 HashSet (java.util.HashSet)1 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)1 MeterPool (org.openkilda.floodlight.switchmanager.MeterPool)1 OFMeterFlags (org.projectfloodlight.openflow.protocol.OFMeterFlags)1 OFMeterBandDrop (org.projectfloodlight.openflow.protocol.meterband.OFMeterBandDrop)1