<artifactId>openflowplugin-it</artifactId>
- <properties>
- <exam.version>3.0.0</exam.version>
- </properties>
-
<build>
<plugins>
<plugin>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
- <version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-link-mvn</artifactId>
- <version>${exam.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
- <version>${exam.version}</version>
</dependency>
<dependency>
<groupId>equinoxSDK381</groupId>
<artifactId>config-persister-file-xml-adapter</artifactId>
<scope>test</scope>
</dependency>
-
+
<dependency>
<groupId>org.openexi</groupId>
<artifactId>nagasena</artifactId>
<scope>test</scope>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
private static final ArrayBlockingQueue<Runnable> SCENARIO_POOL_QUEUE = new ArrayBlockingQueue<>(1);
- @Inject @Filter(timeout=20000)
+ @Inject @Filter(timeout=60000)
OpenflowPluginProvider openflowPluginProvider;
- @Inject
+ @Inject @Filter(timeout=60000)
BundleContext ctx;
-
- @Inject @Filter(timeout=20000)
+
+ @Inject @Filter(timeout=60000)
static DataBroker dataBroker;
-
- @Inject @Filter(timeout=20000)
+
+ @Inject @Filter(timeout=60000)
NotificationProviderService notificationService;
-
+
private SimpleClient switchSim;
private ThreadPoolLoggingExecutor scenarioPool;
}
}
}
-
+
/**
* test basic integration with OFLib running the handshake
* @throws Exception
public void testFlowMod() throws Exception {
LOG.debug("testFlowMod integration test");
TriggerTestListener brmListener = new TriggerTestListener();
-
+
dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
getWildcardPath(), brmListener, DataChangeScope.BASE);
-
+
switchSim = createSimpleClient();
switchSim.setSecuredClient(false);
Deque<ClientEvent> handshakeScenario = ScenarioFactory.createHandshakeScenarioVBM(
OFPaxOptionsAssistant.ofPluginBundles());
}
-
+
static FlowBuilder createTestFlow() {
short tableId = 0;
FlowBuilder flow = new FlowBuilder();
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
-
+
FlowId flowId = new FlowId("127");
FlowKey key = new FlowKey(flowId);
if (null == flow.isBarrier()) {
flow.setKey(key);
flow.setFlowName("Foo" + "X" + "f1");
-
+
return flow;
}
-
+
private static MatchBuilder createMatch1() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
match.setEthernetMatch(eth.build());
return match;
}
-
+
private static InstructionsBuilder createDecNwTtlInstructions() {
DecNwTtlBuilder ta = new DecNwTtlBuilder();
DecNwTtl decNwTtl = ta.build();
isb.setInstruction(instructions);
return isb;
}
-
- static void writeFlow(FlowBuilder flow, InstanceIdentifier<FlowCapableNode> flowNodeIdent) {
+
+ static void writeFlow(FlowBuilder flow, InstanceIdentifier<FlowCapableNode> flowNodeIdent) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
final InstanceIdentifier<Flow> path1 = flowNodeIdent.child(Table.class, new TableKey(flow.getTableId()))
.child(Flow.class, flow.getKey());
}
});
}
-
+
//TODO move to separate test util class
private final static Flow readFlow(InstanceIdentifier<Flow> flow) {
Flow searchedFlow = null;
ReadTransaction rt = dataBroker.newReadOnlyTransaction();
CheckedFuture<Optional<Flow>, ReadFailedException> flowFuture =
rt.read(LogicalDatastoreType.CONFIGURATION, flow);
-
+
try {
Optional<Flow> maybeFlow = flowFuture.checkedGet(500, TimeUnit.SECONDS);
if(maybeFlow.isPresent()) {
} catch (ReadFailedException e) {
LOG.error("Something wrong happened in DataStore. Getting FLOW for userId {} failed.", e);
}
-
+
return searchedFlow;
}
}
private final ArrayBlockingQueue<Runnable> SCENARIO_POOL_QUEUE = new ArrayBlockingQueue<>(1);
- @Inject @Filter(timeout=20000)
+ @Inject @Filter(timeout=60000)
OpenflowPluginProvider openflowPluginProvider;
- @Inject
+ @Inject @Filter(timeout=60000)
BundleContext ctx;
private SimpleClient switchSim;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.ops4j.pax.exam.util.Filter;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
* Exercise inventory listener ({@link OpendaylightInventoryListener#onNodeUpdated(NodeUpdated)})
*/
@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
public class SalIntegrationTest {
static final Logger LOG = LoggerFactory.getLogger(SalIntegrationTest.class);
private ThreadPoolLoggingExecutor scenarioPool;
private SimpleClient switchSim;
private Runnable finalCheck;
-
- @Inject
+
+ @Inject @Filter(timeout=60*000)
BundleContext ctx;
- @Inject
- @Filter(timeout=20*1000)
+ @Inject @Filter(timeout=60*1000)
BindingAwareBroker broker;
-
- @Inject
- @Filter(timeout=20*1000)
+
+ @Inject @Filter(timeout=60*1000)
OpenflowPluginProvider openflowPluginProvider;
/**
static long getFailSafeTimeout() {
return 30000;
}
-
+
/**
* test setup
* @throws InterruptedException
public void tearDown() {
SimulatorAssistant.waitForSwitchSimulatorOn(switchSim);
SimulatorAssistant.tearDownSwitchSimulatorAfterScenario(switchSim, scenarioPool, getFailSafeTimeout());
-
+
if (finalCheck != null) {
LOG.info("starting final check");
finalCheck.run();
};
ConsumerContext consumerReg = broker.registerConsumer(openflowConsumer, ctx);
assertNotNull(consumerReg);
-
+
LOG.debug("handshake integration test");
LOG.debug("openflowPluginProvider: " + openflowPluginProvider);
return options(systemProperty("osgi.console").value("2401"),
OFPaxOptionsAssistant.osgiConsoleBundles(),
OFPaxOptionsAssistant.loggingBudles(),
-
+
TestHelper.junitAndMockitoBundles(),
- TestHelper.mdSalCoreBundles(),
+ TestHelper.mdSalCoreBundles(),
TestHelper.configMinumumBundles(),
TestHelper.baseModelBundles(),
OFPaxOptionsAssistant.ofLibraryBundles(),
<artifactId>sal-binding-broker-impl</artifactId>
<version>${sal.binding.api.version}</version>
- <!-- excluding old models pulled as transient dependencies
+ <!-- excluding old models pulled as transient dependencies
TODO: remove -->
<exclusions>
<exclusion>
</configuration>
</plugin>
<plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
- <version>1.2.4</version>
- </plugin>
- <plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>