use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class OFPluginToLibraryTest method handshakeOk2.
/**
* test basic integration with OFLib running the handshake (with version bitmap)
* @throws Exception
*/
@Test
public void handshakeOk2() throws Exception {
LOG.debug("handshakeOk2 integration test");
switchSim = createSimpleClient();
switchSim.setSecuredClient(false);
Deque<ClientEvent> handshakeScenario = ScenarioFactory.createHandshakeScenario((short) 0, ScenarioFactory.VERSION_BITMAP_10_13);
ScenarioHandler scenario = new ScenarioHandler(handshakeScenario);
switchSim.setScenarioHandler(scenario);
scenarioPool.execute(switchSim);
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class OFPluginToLibraryTest method handshakeFail1.
/**
* test basic integration with OFLib running the handshake:
* creating auxiliary connection without primary connection -- FAIL
* @throws Exception
*/
@Test
public void handshakeFail1() throws Exception {
LOG.debug("handshakeFail1 integration test");
switchSim = createSimpleClient();
switchSim.setSecuredClient(false);
Deque<ClientEvent> handshakeScenario = ScenarioFactory.createHandshakeScenario((short) 1, ScenarioFactory.VERSION_BITMAP_10_13);
ScenarioHandler scenario = new ScenarioHandler(handshakeScenario);
switchSim.setScenarioHandler(scenario);
scenarioPool.execute(switchSim);
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class OFPluginToLibraryTest method handshakeOkNoVBM_OF10_SingleHello.
/**
* test with Mininet running OF10 and OFP running OF13/OF10
*
* Mininet issues an OFPT_ERROR on the version compatability Mininet doesn't
* issue a second HELLO
*
* @throws Exception
*/
@Test
public void handshakeOkNoVBM_OF10_SingleHello() throws Exception {
LOG.debug("handshakeOkMLX10 integration test");
LOG.debug("openflowPluginProvider: " + openflowPluginProvider);
switchSim = createSimpleClient();
switchSim.setSecuredClient(false);
Deque<ClientEvent> handshakeScenario = ScenarioFactory.createHandshakeScenarioNOVBM_OF10_OneHello();
ScenarioHandler scenario = new ScenarioHandler(handshakeScenario);
switchSim.setScenarioHandler(scenario);
scenarioPool.execute(switchSim);
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class OFPluginToLibraryTest method handshakeFail2.
/**
* test basic integration with OFLib running the handshake
* adding 5s wait as first event of switch -- FAIL
* @throws Exception
*/
@Test
public void handshakeFail2() throws Exception {
LOG.debug("handshakeFail2 integration test");
LOG.debug("openflowPluginProvider: " + openflowPluginProvider);
switchSim = createSimpleClient();
switchSim.setSecuredClient(false);
Deque<ClientEvent> handshakeScenario = ScenarioFactory.createHandshakeScenario((short) 0, ScenarioFactory.VERSION_BITMAP_10_13);
handshakeScenario.addFirst(new SleepEvent(5000));
ScenarioHandler scenario = new ScenarioHandler(handshakeScenario);
switchSim.setScenarioHandler(scenario);
scenarioPool.execute(switchSim);
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class ScenarioFactory method createHandshakeScenarioVBM.
/**
* Creates stack with handshake needed messages.
* <ol> XID of messages:
* <li> hello sent - 00000001
* <li> hello waiting - 00000015
* <li> featuresrequest waiting - 00000002
* <li> featuresreply sent - 00000002
* </ol>
* @param switchVersionBitmap
* @param auxId
* @param pluginVersionBitmap
* @param addSleep if true - then add final sleep {@link #DEFAULT_SCENARIO_SLEEP}
* @return stack filled with Handshake messages
*/
public static Deque<ClientEvent> createHandshakeScenarioVBM(String switchVersionBitmap, short auxId, String pluginVersionBitmap, boolean addSleep) {
Deque<ClientEvent> stack = new ArrayDeque<>();
stack.addFirst(new SendEvent(ByteBufUtils.hexStringToBytes("04 00 00 10 00 00 00 01 " + switchVersionBitmap)));
stack.addFirst(new WaitForMessageEvent(ByteBufUtils.hexStringToBytes("04 00 00 10 00 00 00 15 " + pluginVersionBitmap)));
stack.addFirst(new WaitForMessageEvent(ByteBufUtils.hexStringToBytes("04 05 00 08 00 00 00 02")));
stack.addFirst(new SendEvent(ByteBufUtils.hexStringToBytes("04 06 00 20 00 00 00 02 " + "00 01 02 03 04 05 06 07 " + "00 01 02 03 01 " + Integer.toHexString(auxId) + " 00 00 00 01 02 03 00 01 02 03")));
if (addSleep) {
addSleep(stack);
}
return stack;
}
Aggregations