use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class ScenarioFactory method createHandshakeScenario.
/**
* @param auxId
* @param pluginVersionBitmap
* @return handshake scenario without switch version bitmap
*/
public static Deque<ClientEvent> createHandshakeScenario(short auxId, String pluginVersionBitmap) {
Deque<ClientEvent> stack = new ArrayDeque<>();
stack.addFirst(new SendEvent(ByteBufUtils.hexStringToBytes("04 00 00 08 00 00 00 01")));
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")));
addSleep(stack);
return stack;
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class IntegrationTest method testTlsHandshake.
/**
* Library integration and secured communication test with handshake.
*/
@Test
public void testTlsHandshake() throws Exception {
setUp(TransportProtocol.TLS);
final int amountOfCLients = 1;
final Deque<ClientEvent> scenario = ScenarioFactory.createHandshakeScenario();
final ScenarioHandler handler = new ScenarioHandler(scenario);
final List<OFClient> clients = createAndStartClient(amountOfCLients, handler, TransportProtocol.TLS, ClientType.SIMPLE);
final OFClient firstClient = clients.get(0);
firstClient.getScenarioDone().get();
Thread.sleep(1000);
LOGGER.debug("testTlsHandshake() Finished");
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class IntegrationTest method testTlsHandshakeAndEcho.
/**
* Library integration and secured communication test with handshake + echo exchange.
*/
@Test
public void testTlsHandshakeAndEcho() throws Exception {
setUp(TransportProtocol.TLS);
final int amountOfCLients = 1;
final Deque<ClientEvent> scenario = ScenarioFactory.createHandshakeScenario();
scenario.addFirst(new SleepEvent(1000));
scenario.addFirst(new SendEvent(ByteBufUtils.hexStringToBytes("04 02 00 08 00 00 00 04")));
scenario.addFirst(new SleepEvent(1000));
scenario.addFirst(new WaitForMessageEvent(ByteBufUtils.hexStringToBytes("04 03 00 08 00 00 00 04")));
final ScenarioHandler handler = new ScenarioHandler(scenario);
final List<OFClient> clients = createAndStartClient(amountOfCLients, handler, TransportProtocol.TLS, ClientType.SIMPLE);
final OFClient firstClient = clients.get(0);
firstClient.getScenarioDone().get();
LOGGER.debug("testTlsHandshakeAndEcho() Finished");
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class IntegrationTest method testUdpHandshakeAndEcho.
/**
* Library udp integration and communication test with handshake + echo exchange.
*/
@Test
public void testUdpHandshakeAndEcho() throws Exception {
setUp(TransportProtocol.UDP);
final int amountOfCLients = 1;
final Deque<ClientEvent> scenario = ScenarioFactory.createHandshakeScenario();
scenario.addFirst(new SleepEvent(1000));
scenario.addFirst(new SendEvent(ByteBufUtils.hexStringToBytes("04 02 00 08 00 00 00 04")));
scenario.addFirst(new SleepEvent(1000));
scenario.addFirst(new WaitForMessageEvent(ByteBufUtils.hexStringToBytes("04 03 00 08 00 00 00 04")));
final ScenarioHandler handler = new ScenarioHandler(scenario);
final List<OFClient> clients = createAndStartClient(amountOfCLients, handler, TransportProtocol.UDP, ClientType.SIMPLE);
final OFClient firstClient = clients.get(0);
firstClient.getScenarioDone().get();
LOGGER.debug("testUdpHandshakeAndEcho() Finished");
}
use of org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent in project openflowplugin by opendaylight.
the class IntegrationTest method testHandshakeAndEcho.
/**
* Library integration and communication test with handshake + echo exchange.
*/
@Test
public void testHandshakeAndEcho() throws Exception {
setUp(TransportProtocol.TCP);
final int amountOfCLients = 1;
final Deque<ClientEvent> scenario = ScenarioFactory.createHandshakeScenario();
scenario.addFirst(new SleepEvent(1000));
scenario.addFirst(new SendEvent(ByteBufUtils.hexStringToBytes("04 02 00 08 00 00 00 04")));
scenario.addFirst(new SleepEvent(1000));
scenario.addFirst(new WaitForMessageEvent(ByteBufUtils.hexStringToBytes("04 03 00 08 00 00 00 04")));
final ScenarioHandler handler = new ScenarioHandler(scenario);
final List<OFClient> clients = createAndStartClient(amountOfCLients, handler, TransportProtocol.TCP, ClientType.SIMPLE);
final OFClient firstClient = clients.get(0);
firstClient.getScenarioDone().get();
LOGGER.debug("testHandshakeAndEcho() Finished");
}
Aggregations