/*
* Copyright (c) 2013-2014 Cisco Systems, Inc. and others. All rights reserved.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0 which accompanies this distribution,
-* and is available at http://www.eclipse.org/legal/epl-v10.html
-*/
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.controller.sal.compatibility.test;
import static org.junit.Assert.assertEquals;
Layer3Match layer3Match = match.getLayer3Match();
boolean arpFound = false;
if (layer3Match instanceof ArpMatch) {
- assertEquals("Source IP address is wrong.", "192.168.100.100", ((ArpMatch) layer3Match)
+ assertEquals("Source IP address is wrong.", "192.168.100.100/32", ((ArpMatch) layer3Match)
.getArpSourceTransportAddress().getValue());
- assertEquals("Destination IP address is wrong.", "192.168.100.101", ((ArpMatch) layer3Match)
+ assertEquals("Destination IP address is wrong.", "192.168.100.101/32", ((ArpMatch) layer3Match)
.getArpTargetTransportAddress().getValue());
assertEquals("Source MAC address is wrong.", "ff:ee:dd:cc:bb:aa", ((ArpMatch) layer3Match)
.getArpSourceHardwareAddress().getAddress().getValue());
boolean ipv4Found = false;
layer3Match = match.getLayer3Match();
if (layer3Match instanceof Ipv4Match) {
- assertEquals("Source IP address is wrong.", "192.168.100.102", ((Ipv4Match) layer3Match)
+ assertEquals("Source IP address is wrong.", "192.168.100.102/32", ((Ipv4Match) layer3Match)
.getIpv4Source().getValue());
- assertEquals("Destination IP address is wrong.", "192.168.100.103", ((Ipv4Match) layer3Match)
+ assertEquals("Destination IP address is wrong.", "192.168.100.103/32", ((Ipv4Match) layer3Match)
.getIpv4Destination().getValue());
}
assertNotNull("Ipv4 wasn't found", ipv4Found);
boolean ipv6Found = false;
layer3Match = match.getLayer3Match();
if (layer3Match instanceof Ipv6Match) {
- assertEquals("Source IP address is wrong.", "2001:db8:85a3::8a2e:370:7335", ((Ipv6Match) layer3Match)
+ assertEquals("Source IP address is wrong.", "2001:db8:85a3::8a2e:370:7335/128", ((Ipv6Match) layer3Match)
.getIpv6Source().getValue());
- assertEquals("Destination IP address is wrong.", "2001:db8:85a3::8a2e:370:7336",
+ assertEquals("Destination IP address is wrong.", "2001:db8:85a3::8a2e:370:7336/128",
((Ipv6Match) layer3Match).getIpv6Destination().getValue());
}
assertNotNull("Ipv6 wasn't found", ipv6Found);
if (cl.isInstance(innerAction)) {
numOfFoundActions++;
if (innerAction instanceof PushVlanActionCase) {
- assertEquals("Wrong value of cfi in PushVlanAction.", (Integer) 1, ((PushVlanActionCase) innerAction).getPushVlanAction()
- .getCfi().getValue());
- assertEquals("Wrong value of pcp in PushVlanAction.", (Integer) 7,
- ((PushVlanActionCase) innerAction).getPushVlanAction().getPcp());
assertEquals("Wrong value of tag in PushVlanAction.", (Integer) 0x8100,
- ((PushVlanActionCase) innerAction).getPushVlanAction().getTag());
- assertEquals("Wrong value of vlad ID in PushVlanAction.", (Integer) 4095,
- ((PushVlanActionCase) innerAction).getPushVlanAction().getVlanId().getValue());
+ ((PushVlanActionCase) innerAction).getPushVlanAction().getEthernetType());
} else if (innerAction instanceof SetDlDstActionCase) {
assertEquals("Wrong MAC destination address in SetDlDstAction.", "ff:ee:dd:cc:bb:aa",
((SetDlDstActionCase) innerAction).getSetDlDstAction().getAddress().getValue());
boolean ipv4AddressFound = false;
if (address instanceof Ipv4) {
ipv4AddressFound = true;
- assertEquals("Wrong IP address type in SetNextHopAction.", "192.168.100.100", ((Ipv4) address)
+ assertEquals("Wrong IP address type in SetNextHopAction.", "192.168.100.100/32", ((Ipv4) address)
.getIpv4Address().getValue());
}
assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
} else if (innerAction instanceof SetNwTosActionCase) {
- assertEquals("Wrong TOS in SetNwTosAction.", (Integer) 63, ((SetNwTosActionCase) innerAction).getSetNwTosAction().getTos());
+ assertEquals("Wrong TOS in SetNwTosAction.", (Integer) 252, ((SetNwTosActionCase) innerAction).getSetNwTosAction().getTos());
} else if (innerAction instanceof SetNwDstActionCase) {
Address address = ((SetNwDstActionCase) innerAction).getSetNwDstAction().getAddress();
boolean ipv4AddressFound = false;
if (address instanceof Ipv4) {
ipv4AddressFound = true;
- assertEquals("Wrong IP address type in SetNwDstAction.", "192.168.100.101", ((Ipv4) address)
+ assertEquals("Wrong IP address type in SetNwDstAction.", "192.168.100.101/32", ((Ipv4) address)
.getIpv4Address().getValue());
}
assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
boolean ipv4AddressFound = false;
if (address instanceof Ipv4) {
ipv4AddressFound = true;
- assertEquals("Wrong IP address type in SetNwSrcAction.", "192.168.100.102", ((Ipv4) address)
+ assertEquals("Wrong IP address type in SetNwSrcAction.", "192.168.100.102/32", ((Ipv4) address)
.getIpv4Address().getValue());
}
assertTrue("Ipv4 address wasn't found.", ipv4AddressFound);
salActions.add(new Loopback());
// salActions.add(new Output //TODO: mapping is missing
salActions.add(new PopVlan());
- salActions.add(new PushVlan(0x8100, 7, 1, 4095));
+ salActions.add(new PushVlan(0x8100));
salActions.add(new SetDlDst(new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa}));
salActions.add(new SetDlSrc(new byte[]{(byte )0xff,(byte )0xee,(byte )0xdd,(byte )0xcc,(byte )0xbb,(byte )0xaa}));
salActions.add(new SetDlType(513));