Fix for T3 test paths

Change-Id: I1ab45904f360349abaa5489c9ca89a5d1a69c82e
(cherry picked from commit d5aa3416e53c2ffd1e11faad23d9b2567f2a21fd)
This commit is contained in:
Andrea Campanella 2018-01-18 16:54:34 +01:00
parent 3ed7585479
commit 2bc55dd335
2 changed files with 16 additions and 8 deletions

View File

@ -50,6 +50,10 @@ import org.onosproject.net.provider.ProviderId;
*/
final class T3TestObjects {
private T3TestObjects(){
//banning construction
}
private static final String HOST_ONE_MAC = "00:00:00:00:00:01";
private static final String HOST_TWO_MAC = "00:00:00:00:00:02";
private static final String HOST_ONE_VLAN = "None";
@ -221,7 +225,8 @@ final class T3TestObjects {
private static final GroupBuckets BUCKETS_MULTIPLE = new GroupBuckets(ImmutableList.of(BUCKET, BUCKET_2));
static final Group TOPO_GROUP = new DefaultGroup(TOPO_GROUP_ID, TOPO_GROUP_FLOW_DEVICE, Group.Type.SELECT, BUCKETS_MULTIPLE);
static final Group TOPO_GROUP = new DefaultGroup(TOPO_GROUP_ID, TOPO_GROUP_FLOW_DEVICE,
Group.Type.SELECT, BUCKETS_MULTIPLE);
static final FlowEntry TOPO_SECOND_INPUT_FLOW_ENTRY = new DefaultFlowEntry(TOPO_SECOND_INPUT_FLOW);
@ -231,7 +236,8 @@ final class T3TestObjects {
static final ConnectPoint TOPO_FLOW_OUT_CP_1 = ConnectPoint.deviceConnectPoint(TOPO_GROUP_FLOW_DEVICE + "/" + 2);
protected static final ConnectPoint TOPO_FLOW_OUT_CP_2 = ConnectPoint.deviceConnectPoint(TOPO_GROUP_FLOW_DEVICE + "/" + 3);
protected static final ConnectPoint TOPO_FLOW_OUT_CP_2 =
ConnectPoint.deviceConnectPoint(TOPO_GROUP_FLOW_DEVICE + "/" + 3);
static final ConnectPoint TOPO_FLOW_4_IN_CP = ConnectPoint.deviceConnectPoint(TOPO_FLOW_4_DEVICE + "/" + 1);
@ -303,6 +309,7 @@ final class T3TestObjects {
static final TrafficSelector PACKET_OK = DefaultTrafficSelector.builder()
.matchInPort(PortNumber.portNumber(1))
.matchEthType(EthType.EtherType.IPV4.ethType().toShort())
.matchIPSrc(IpPrefix.valueOf("127.0.0.1/32"))
.matchIPDst(IpPrefix.valueOf("127.0.0.2/32"))
.build();

View File

@ -28,7 +28,6 @@ import org.onosproject.net.DefaultLink;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Host;
import org.onosproject.net.Link;
import org.onosproject.net.device.DeviceServiceAdapter;
import org.onosproject.net.driver.DefaultDriver;
import org.onosproject.net.driver.Driver;
import org.onosproject.net.driver.DriverServiceAdapter;
@ -84,7 +83,7 @@ public class TroubleshootManagerTest {
}
/**
* Tests failure on device with no flows
* Tests failure on device with no flows.
*/
@Test
public void noFlows() {
@ -113,7 +112,8 @@ public class TroubleshootManagerTest {
//Test Success
StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, DUAL_FLOW_IN_CP, DUAL_FLOW_DEVICE, DUAL_FLOW_OUT_CP, 1);
StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, DUAL_FLOW_IN_CP, DUAL_FLOW_DEVICE,
DUAL_FLOW_OUT_CP, 1);
//Testing Vlan
Criterion criterion = traceSuccess.getGroupOuputs(DUAL_FLOW_DEVICE).get(0).
@ -135,7 +135,8 @@ public class TroubleshootManagerTest {
@Test
public void flowAndGroup() throws Exception {
StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, GROUP_FLOW_IN_CP, GROUP_FLOW_DEVICE, GROUP_FLOW_OUT_CP, 1);
StaticPacketTrace traceSuccess = testSuccess(PACKET_OK, GROUP_FLOW_IN_CP, GROUP_FLOW_DEVICE,
GROUP_FLOW_OUT_CP, 1);
assertTrue("Wrong Output Group", traceSuccess.getGroupOuputs(GROUP_FLOW_DEVICE)
.get(0).getGroups().contains(GROUP));
@ -234,7 +235,7 @@ public class TroubleshootManagerTest {
return ImmutableList.of(TOPO_SINGLE_FLOW_ENTRY, TOPO_SECOND_INPUT_FLOW_ENTRY);
} else if (deviceId.equals(TOPO_GROUP_FLOW_DEVICE)) {
return ImmutableList.of(TOPO_GROUP_FLOW_ENTRY);
} else if (deviceId.equals(HARDWARE_DEVICE)){
} else if (deviceId.equals(HARDWARE_DEVICE)) {
return ImmutableList.of(HARDWARE_ETH_FLOW_ENTRY, HARDWARE_FLOW_ENTRY);
}
return ImmutableList.of();
@ -244,7 +245,7 @@ public class TroubleshootManagerTest {
private class TestDriverService extends DriverServiceAdapter {
@Override
public Driver getDriver(DeviceId deviceId) {
if(deviceId.equals(HARDWARE_DEVICE)){
if (deviceId.equals(HARDWARE_DEVICE)) {
return new DefaultDriver("ofdpa", ImmutableList.of(),
"test", "test", "test", new HashMap<>(), new HashMap<>());
}