Search in sources :

Example 1 with ScenarioHandler

use of org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler 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);
}
Also used : ScenarioHandler(org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler) ClientEvent(org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent) Test(org.junit.Test)

Example 2 with ScenarioHandler

use of org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler 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);
}
Also used : ScenarioHandler(org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler) ClientEvent(org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent) Test(org.junit.Test)

Example 3 with ScenarioHandler

use of org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler 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);
}
Also used : ScenarioHandler(org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler) ClientEvent(org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent) Test(org.junit.Test)

Example 4 with ScenarioHandler

use of org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler 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);
}
Also used : ScenarioHandler(org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler) ClientEvent(org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent) SleepEvent(org.opendaylight.openflowjava.protocol.impl.clients.SleepEvent) Test(org.junit.Test)

Example 5 with ScenarioHandler

use of org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler 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");
}
Also used : ScenarioHandler(org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler) OFClient(org.opendaylight.openflowjava.protocol.impl.clients.OFClient) ClientEvent(org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)14 ScenarioHandler (org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler)14 ClientEvent (org.opendaylight.openflowjava.protocol.impl.clients.ClientEvent)13 OFClient (org.opendaylight.openflowjava.protocol.impl.clients.OFClient)6 SleepEvent (org.opendaylight.openflowjava.protocol.impl.clients.SleepEvent)5 WaitForMessageEvent (org.opendaylight.openflowjava.protocol.impl.clients.WaitForMessageEvent)4 SendEvent (org.opendaylight.openflowjava.protocol.impl.clients.SendEvent)3 DataTreeIdentifier (org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier)1 ConsumerContext (org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext)1 BindingAwareConsumer (org.opendaylight.controller.sal.binding.api.BindingAwareConsumer)1 NotificationService (org.opendaylight.controller.sal.binding.api.NotificationService)1 ListeningSimpleClient (org.opendaylight.openflowjava.protocol.impl.clients.ListeningSimpleClient)1 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)1