<version>${neutron.version}</version>
<type>xml</type>
</dependency>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>dummyprovider</artifactId>
- <version>${neutron.version}</version>
- </dependency>
<!-- Faas -->
<dependency>
<feature version="${neutron.version}">odl-neutron-service</feature>
<feature version="${project.version}">odl-groupbasedpolicy-base</feature>
<bundle>mvn:org.opendaylight.groupbasedpolicy/l2-l3-domain-extension/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.neutron/dummyprovider/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.groupbasedpolicy/neutron-mapper/{{VERSION}}</bundle>
<configfile finalname="${config.configfile.directory}/15-l2-l3-domain-extension.xml">mvn:org.opendaylight.groupbasedpolicy/l2-l3-domain-extension/{{VERSION}}/xml/config</configfile>
<configfile finalname="${config.configfile.directory}/15-neutron-mapper.xml">mvn:org.opendaylight.groupbasedpolicy/neutron-mapper/{{VERSION}}/xml/config</configfile>
public class NeutronMapper implements DataTreeChangeListener<Neutron>, AutoCloseable {
private final static SecurityRuleBuilder EIG_INGRESS_IPV4_SEC_RULE_BUILDER = new SecurityRuleBuilder()
- .setId(new Uuid("0a629f80-2408-11e6-b67b-9e71128cae77"))
+ .setUuid(new Uuid("0a629f80-2408-11e6-b67b-9e71128cae77"))
.setDirection(DirectionIngress.class)
.setEthertype(EthertypeV4.class)
.setSecurityGroupId(MappingUtils.EIG_UUID);
private final static SecurityRuleBuilder EIG_EGRESS_IPV4_SEC_RULE_BUILDER = new SecurityRuleBuilder()
- .setId(new Uuid("0f1789be-2408-11e6-b67b-9e71128cae77"))
+ .setUuid(new Uuid("0f1789be-2408-11e6-b67b-9e71128cae77"))
.setDirection(DirectionEgress.class)
.setEthertype(EthertypeV4.class)
.setSecurityGroupId(MappingUtils.EIG_UUID);
private final static SecurityRuleBuilder EIG_INGRESS_IPV6_SEC_RULE_BUILDER = new SecurityRuleBuilder()
- .setId(new Uuid("139b7f90-2408-11e6-b67b-9e71128cae77"))
+ .setUuid(new Uuid("139b7f90-2408-11e6-b67b-9e71128cae77"))
.setDirection(DirectionIngress.class)
.setEthertype(EthertypeV6.class)
.setSecurityGroupId(MappingUtils.EIG_UUID);
private final static SecurityRuleBuilder EIG_EGRESS_IPV6_SEC_RULE_BUILDER = new SecurityRuleBuilder()
- .setId(new Uuid("17517202-2408-11e6-b67b-9e71128cae77"))
+ .setUuid(new Uuid("17517202-2408-11e6-b67b-9e71128cae77"))
.setDirection(DirectionEgress.class)
.setEthertype(EthertypeV6.class)
.setSecurityGroupId(MappingUtils.EIG_UUID);
private final static SecurityGroupBuilder EIG_SEC_GROUP_BUILDER =
- new SecurityGroupBuilder().setUuid(MappingUtils.EIG_UUID).setDescription("EXTERNAL_group");
+ new SecurityGroupBuilder().setUuid(MappingUtils.EIG_UUID);
private final NeutronNetworkAware networkAware;
private final NeutronSecurityGroupAware securityGroupAware;
private AddressEndpointRegBuilder createBasicMacAddrEpInputBuilder(Port port,
NetworkDomainId networkContainment, @Nullable List<EndpointGroupId> endpointGroupsToAdd) {
AddressEndpointRegBuilder addrEpbuilder = new AddressEndpointRegBuilder().setAddressType(MacAddressType.class)
- .setAddress(port.getMacAddress())
+ .setAddress(port.getMacAddress().getValue())
.setAddressType(MacAddressType.class)
.setContextType(MappingUtils.L2_BRDIGE_DOMAIN)
.setContextId(new ContextId(port.getNetworkId().getValue()))
Port port) {
return new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterEndpointInputBuilder().setL2Context(
new L2BridgeDomainId(port.getNetworkId().getValue()))
- .setMacAddress(new MacAddress(port.getMacAddress()))
+ .setMacAddress(new MacAddress(port.getMacAddress().getValue()))
.setTenant(new TenantId(port.getTenantId().getValue()))
.setTimestamp(System.currentTimeMillis());
}
}
UniqueId portId = new UniqueId(port.getUuid().getValue());
EndpointKey epKey = new EndpointKey(new L2BridgeDomainId(port.getNetworkId().getValue()), new MacAddress(
- port.getMacAddress()));
+ port.getMacAddress().getValue()));
LOG.trace("Adding Port-Endpoint mapping for port {} (device owner {}) and endpoint {}", port.getUuid()
.getValue(), port.getDeviceOwner(), epKey);
EndpointByPort endpointByPort = MappingFactory.createEndpointByPort(epKey, portId);
if (isUnregisteredEndpoint) {
UniqueId portId = new UniqueId(port.getUuid().getValue());
EndpointKey epKey = new EndpointKey(new L2BridgeDomainId(port.getNetworkId().getValue()), new MacAddress(
- port.getMacAddress()));
+ port.getMacAddress().getValue()));
LOG.trace("Removing Port-Endpoint mapping for port {} (device owner {}) and endpoint {}", port.getUuid()
.getValue(), port.getDeviceOwner(), epKey);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
if (isUnregisteredBaseEndpoint) {
UniqueId portId = new UniqueId(port.getUuid().getValue());
EndpointKey epKey = new EndpointKey(new L2BridgeDomainId(port.getNetworkId().getValue()), new MacAddress(
- port.getMacAddress()));
+ port.getMacAddress().getValue()));
LOG.trace("Removing Port-BaseEndpoint mapping for port {} (device owner {}) and endpoint {}",
port.getUuid().getValue(), port.getDeviceOwner(), epKey);
- PortByBaseEndpointKey portByBaseEndpointKey = new PortByBaseEndpointKey(port.getMacAddress(),
+ PortByBaseEndpointKey portByBaseEndpointKey = new PortByBaseEndpointKey(port.getMacAddress().getValue(),
MacAddressType.class, new ContextId(port.getNetworkId().getValue()), MappingUtils.L2_BRDIGE_DOMAIN);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
NeutronGbpIidFactory.baseEndpointByPortIid(portId), rwTx);
UnregisterEndpointInputBuilder inputBuilder = new UnregisterEndpointInputBuilder();
List<AddressEndpointUnreg> list = new ArrayList<>();
AddressEndpointUnregBuilder addrL2EpUnregBuilder = new AddressEndpointUnregBuilder();
- addrL2EpUnregBuilder.setAddress(port.getMacAddress())
+ addrL2EpUnregBuilder.setAddress(port.getMacAddress().getValue())
.setAddressType(MacAddressType.class)
.setContextId(new ContextId(port.getNetworkId().getValue()))
.setContextType(MappingUtils.L2_BRDIGE_DOMAIN);
org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.UnregisterEndpointInputBuilder inputBuilder =
new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.UnregisterEndpointInputBuilder();
L2 l2Ep = new L2Builder().setL2Context(new L2BridgeDomainId(port.getNetworkId().getValue()))
- .setMacAddress(new MacAddress(port.getMacAddress()))
+ .setMacAddress(new MacAddress(port.getMacAddress().getValue()))
.build();
inputBuilder.setL2(ImmutableList.of(l2Ep));
// we've registered EP with only first IP so remove only EP with first IP
LOG.debug("Name exception", e);
}
}
- if (!Strings.isNullOrEmpty(secGroup.getDescription())) {
- try {
- epgBuilder.setDescription(new Description(secGroup.getDescription()));
- } catch (Exception e) {
- LOG.info("Description '{}' of Neutron Security-group '{}' is ignored.",
- secGroup.getDescription(), secGroup.getUuid().getValue());
- LOG.debug("Description exception", e);
- }
- }
epgBuilder.setIntraGroupPolicy(IntraGroupPolicy.RequireContract);
rwTx.put(LogicalDatastoreType.CONFIGURATION, IidFactory.endpointGroupIid(tId, epgId),
epgBuilder.build(), true);
import org.opendaylight.groupbasedpolicy.neutron.mapper.EndpointRegistrator;
import org.opendaylight.groupbasedpolicy.neutron.mapper.util.MappingUtils;
import org.opendaylight.groupbasedpolicy.neutron.mapper.util.NetworkUtils;
-import org.opendaylight.groupbasedpolicy.neutron.mapper.util.Utils;
import org.opendaylight.groupbasedpolicy.util.DataStoreHelper;
import org.opendaylight.groupbasedpolicy.util.IidFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets.Subnet subnet,
IpAddress virtualRouterIp) {
SubnetBuilder sb = new SubnetBuilder();
- sb.setIpPrefix(Utils.createIpPrefix(subnet.getCidr()));
+ sb.setIpPrefix(subnet.getCidr());
sb.setVirtualRouterIp(virtualRouterIp);
NetworkDomainBuilder ndb = new NetworkDomainBuilder();
if (!Strings.isNullOrEmpty(subnet.getName())) {
LOG.debug("Name exception", e);
}
}
- subnetBuilder.setIpPrefix(Utils.createIpPrefix(subnet.getCidr()));
+ subnetBuilder.setIpPrefix(subnet.getCidr());
subnetBuilder.setVirtualRouterIp(virtualRouterIp);
return subnetBuilder.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolIcmpV6;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolTcp;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolUdp;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;\r
\r
import com.google.common.collect.ImmutableList;\r
}\r
\r
public static ContractId getContractId(SecurityRule secRule) {\r
- return new ContractId(secRule.getId().getValue());\r
+ return new ContractId(secRule.getUuid().getValue());\r
}\r
\r
public static ClassifierInstance getClassifierInstance(SecurityRule secRule) {\r
* {@link ProtocolUdp}, {@link ProtocolIcmp}, {@link ProtocolIcmpV6}\r
*/\r
public static Long getProtocol(SecurityRule secRule) {\r
- Class<? extends ProtocolBase> protocol = secRule.getProtocol();\r
+ SecurityRuleAttributes.Protocol protocol = secRule.getProtocol();\r
if (protocol == null) {\r
return null;\r
}\r
- if (protocol.isAssignableFrom(ProtocolTcp.class)) {\r
- return IpProtoClassifierDefinition.TCP_VALUE;\r
+ if (protocol.getUint8() != null) {\r
+ return protocol.getUint8().longValue();\r
}\r
- if (protocol.isAssignableFrom(ProtocolUdp.class)) {\r
- return IpProtoClassifierDefinition.UDP_VALUE;\r
- }\r
- if (protocol.isAssignableFrom(ProtocolIcmp.class)) {\r
- return IpProtoClassifierDefinition.ICMP_VALUE;\r
- }\r
- if (protocol.isAssignableFrom(ProtocolIcmpV6.class)) {\r
- return IpProtoClassifierDefinition.ICMPv6_VALUE;\r
+ if (protocol.getIdentityref() != null) {\r
+ if (protocol.getIdentityref().equals(ProtocolTcp.class)) {\r
+ return IpProtoClassifierDefinition.TCP_VALUE;\r
+ }\r
+ if (protocol.getIdentityref().equals(ProtocolUdp.class)) {\r
+ return IpProtoClassifierDefinition.UDP_VALUE;\r
+ }\r
+ if (protocol.getIdentityref().equals(ProtocolIcmp.class)) {\r
+ return IpProtoClassifierDefinition.ICMP_VALUE;\r
+ }\r
+ if (protocol.getIdentityref().equals(ProtocolIcmpV6.class)) {\r
+ return IpProtoClassifierDefinition.ICMPv6_VALUE;\r
+ }\r
}\r
throw new IllegalArgumentException("Neutron Security Rule Protocol value " + protocol + " is not supported.");\r
}\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.HasDirection.Direction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;
public class SecRuleNameDecoder {
.append(portMax.longValue());
}
}
- Class<? extends ProtocolBase> protocol = secRule.getProtocol();
+ SecurityRuleAttributes.Protocol protocol = secRule.getProtocol();
if (protocol != null) {
if (keyBuilder.length() > 0) {
keyBuilder.append(MappingUtils.NAME_DOUBLE_DELIMETER);
}
+ String protocolString = "";
+ if (protocol.getUint8() != null) {
+ protocolString = protocol.getUint8().toString();
+ } else if (protocol.getIdentityref() != null) {
+ protocolString = protocol.getIdentityref().getSimpleName();
+ }
keyBuilder.append(IpProtoClassifierDefinition.DEFINITION.getName().getValue())
.append(MappingUtils.NAME_VALUE_DELIMETER)
- .append(protocol.getSimpleName());
+ .append(protocolString);
}
Class<? extends EthertypeBase> ethertype = secRule.getEthertype();
if (ethertype != null) {
return Optional.absent();
}
for (SecurityRule secRule : securityRules.getSecurityRule()) {
- if (secRule.getId().equals(uuid)) {
+ if (secRule.getUuid().equals(uuid)) {
return Optional.of(secRule);
}
}
import org.opendaylight.groupbasedpolicy.neutron.mapper.test.NeutronMapperAssert;
import org.opendaylight.groupbasedpolicy.neutron.mapper.test.NeutronMapperDataBrokerTest;
import org.opendaylight.groupbasedpolicy.neutron.mapper.util.PortUtils;
+import org.opendaylight.groupbasedpolicy.neutron.mapper.util.Utils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.RegisterEndpointInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.UnregisterEndpointInput;
.setDeviceId("deviceId")
.setFixedIps(ImmutableList.of(portIpWithSubnet))
.setNetworkId(networkUuid)
- .setMacAddress("00:00:00:00:35:02")
+ .setMacAddress(new MacAddress("00:00:00:00:35:02"))
.build();
Port neutronPort2 = new PortBuilder().setTenantId(new Uuid(tenantUuid))
.setFixedIps(ImmutableList.of(portIpWithSubnet))
.setDeviceOwner(PortUtils.DEVICE_OWNER_DHCP)
.setFixedIps(ImmutableList.of(portIpWithSubnet))
.setNetworkId(networkUuid)
- .setMacAddress("00:00:00:00:35:02")
+ .setMacAddress(new MacAddress("00:00:00:00:35:02"))
.build();
Ports neutronPorts = new PortsBuilder().setPort(ImmutableList.of(neutronPort1, neutronPort2)).build();
when(neutron.getPorts()).thenReturn(neutronPorts);
.setUuid(portUuid)
.setDeviceId("deviceId")
.setNetworkId(networkUuid)
- .setMacAddress("00:00:00:00:35:02");
+ .setMacAddress(new MacAddress("00:00:00:00:35:02"));
}
private Subnets createSubnets() {
.setUuid(subnetUuid)
.setName("subnetName")
.setNetworkId(networkUuid)
- .setCidr("10.0.0.0/24")
+ .setCidr(Utils.createIpPrefix("10.0.0.0/24"))
.build();
return new SubnetsBuilder().setSubnet(ImmutableList.of(subnet)).build();
}
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.groupbasedpolicy.neutron.mapper.EndpointRegistrator;
import org.opendaylight.groupbasedpolicy.neutron.mapper.test.NeutronMapperDataBrokerTest;
+import org.opendaylight.groupbasedpolicy.neutron.mapper.util.Utils;
import org.opendaylight.groupbasedpolicy.util.DataStoreHelper;
import org.opendaylight.groupbasedpolicy.util.IidFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
.setName("subnetName")
.setNetworkId(networkUuid)
.setGatewayIp(ipAddress)
- .setCidr("10.0.0.0/24")
+ .setCidr(Utils.createIpPrefix("10.0.0.0/24"))
.build();
return new SubnetsBuilder().setSubnet(ImmutableList.of(subnet)).build();
}
SecurityGroup secGroupA = new SecurityGroupBuilder().setUuid(new Uuid(uuid))
.setTenantId(new Uuid(tenantId))
.setName("correctName")
- .setDescription("correct description")
.build();
groupAware.onCreated(secGroupA, null);
SecurityGroup secGroupA = new SecurityGroupBuilder().setUuid(new Uuid(uuid))
.setTenantId(new Uuid(tenantId))
.setName("123")
- .setDescription(longDescription)
.build();
groupAware.onCreated(secGroupA, null);
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolTcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.NeutronBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.SecurityGroupsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.security.groups.SecurityGroup;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.SecurityRulesBuilder;
"dabfd4da-af89-45dd-85f8-181768c1b4c9", tenant, EthertypeV4.class, DirectionEgress.class, goldSecGrp,
null);
String serverSecGrp = "71cf4fe5-b146-409e-8151-cd921298ce32";
- SecurityRule serverIn80Tcp10_1_1_0 = new SecurityRuleBuilder().setId(new Uuid("9dbb533d-d9b2-4dc9-bae7-ee60c8df184d"))
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ SecurityRule serverIn80Tcp10_1_1_0 = new SecurityRuleBuilder().setUuid(new Uuid("9dbb533d-d9b2-4dc9-bae7-ee60c8df184d"))
.setTenantId(new Uuid(tenant))
.setEthertype(EthertypeV4.class)
- .setProtocol(ProtocolTcp.class)
+ .setProtocol(protocolTcp)
.setPortRangeMin(80)
.setPortRangeMax(80)
.setDirection(DirectionIngress.class)
.setSecurityGroupId(new Uuid(serverSecGrp))
.setRemoteIpPrefix(new IpPrefix(new Ipv4Prefix("10.1.1.0/24")))
.build();
- SecurityRule serverInIp20_1_1_0 = new SecurityRuleBuilder().setId(new Uuid("adf7e558-de47-4f9e-a9b8-96e19db5d1ac"))
+ SecurityRule serverInIp20_1_1_0 = new SecurityRuleBuilder().setUuid(new Uuid("adf7e558-de47-4f9e-a9b8-96e19db5d1ac"))
.setTenantId(new Uuid(tenant))
.setEthertype(EthertypeV4.class)
.setDirection(DirectionIngress.class)
.get();
assertTrue(potentialTenant.isPresent());
Optional<Contract> potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(goldInIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(goldInIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
Contract contract = potentialContract.get();
PolicyAssert.assertContract(contract, goldInIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(goldOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(goldOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, goldOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, serverOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverIn80Tcp10_1_1_0.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverIn80Tcp10_1_1_0.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContractWithEic(contract, serverIn80Tcp10_1_1_0);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverInIp20_1_1_0.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverInIp20_1_1_0.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContractWithEic(contract, serverInIp20_1_1_0);
EndpointGroup epg = potentialEpg.get();
PolicyAssert.assertConsumerNamedSelectors(
epg,
- ImmutableSet.of(new ContractId(goldInIpv4.getId().getValue()),
- new ContractId(goldOutIpv4.getId().getValue()),
- new ContractId(serverIn80Tcp10_1_1_0.getId().getValue()),
- new ContractId(serverInIp20_1_1_0.getId().getValue()),
- new ContractId(serverOutIpv4.getId().getValue())));
+ ImmutableSet.of(new ContractId(goldInIpv4.getUuid().getValue()),
+ new ContractId(goldOutIpv4.getUuid().getValue()),
+ new ContractId(serverIn80Tcp10_1_1_0.getUuid().getValue()),
+ new ContractId(serverInIp20_1_1_0.getUuid().getValue()),
+ new ContractId(serverOutIpv4.getUuid().getValue())));
potentialEpg = rwTx.read(LogicalDatastoreType.CONFIGURATION,
IidFactory.endpointGroupIid(tenantId, new EndpointGroupId(serverSecGrp))).get();
assertTrue(potentialEpg.isPresent());
epg = potentialEpg.get();
PolicyAssert.assertConsumerNamedSelectors(epg, ImmutableSet.of(
- new ContractId(serverIn80Tcp10_1_1_0.getId().getValue()),
- new ContractId(serverInIp20_1_1_0.getId().getValue()),
- new ContractId(goldInIpv4.getId().getValue())));
+ new ContractId(serverIn80Tcp10_1_1_0.getUuid().getValue()),
+ new ContractId(serverInIp20_1_1_0.getUuid().getValue()),
+ new ContractId(goldInIpv4.getUuid().getValue())));
}
@Test
ruleAware.addNeutronSecurityRule(serverInIpv4, neutron, rwTx);
TenantId tenantId = new TenantId(tenant);
Optional<Contract> potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(goldInIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(goldInIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
Contract contract = potentialContract.get();
PolicyAssert.assertContract(contract, goldInIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(goldOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(goldOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, goldOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, serverOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverInIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverInIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, serverInIpv4);
EndpointGroup epg = potentialEpg.get();
PolicyAssert.assertConsumerNamedSelectors(
epg,
- ImmutableSet.of(new ContractId(goldInIpv4.getId().getValue()),
- new ContractId(goldOutIpv4.getId().getValue()),
- new ContractId(serverOutIpv4.getId().getValue()),
- new ContractId(serverInIpv4.getId().getValue())));
+ ImmutableSet.of(new ContractId(goldInIpv4.getUuid().getValue()),
+ new ContractId(goldOutIpv4.getUuid().getValue()),
+ new ContractId(serverOutIpv4.getUuid().getValue()),
+ new ContractId(serverInIpv4.getUuid().getValue())));
potentialEpg = rwTx.read(LogicalDatastoreType.CONFIGURATION,
IidFactory.endpointGroupIid(tenantId, new EndpointGroupId(serverSecGrp))).get();
assertTrue(potentialEpg.isPresent());
PolicyAssert.assertConsumerNamedSelectors(
epg,
- ImmutableSet.of(new ContractId(goldInIpv4.getId().getValue()),
- new ContractId(goldOutIpv4.getId().getValue()),
- new ContractId(serverOutIpv4.getId().getValue()),
- new ContractId(serverInIpv4.getId().getValue())));
+ ImmutableSet.of(new ContractId(goldInIpv4.getUuid().getValue()),
+ new ContractId(goldOutIpv4.getUuid().getValue()),
+ new ContractId(serverOutIpv4.getUuid().getValue()),
+ new ContractId(serverInIpv4.getUuid().getValue())));
}
@Test
SecurityRule serverOutIpv4 = NeutronEntityFactory.securityRuleWithEtherType(
"8b9c48d3-44a8-46be-be35-6f3237d98071", tenant, EthertypeV4.class, DirectionEgress.class, serverSecGrp,
null);
- SecurityRule serverIn80TcpIpv4 = new SecurityRuleBuilder().setId(new Uuid("adf7e558-de47-4f9e-a9b8-96e19db5d1ac"))
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ SecurityRule serverIn80TcpIpv4 = new SecurityRuleBuilder().setUuid(new Uuid("adf7e558-de47-4f9e-a9b8-96e19db5d1ac"))
.setTenantId(new Uuid(tenant))
.setEthertype(EthertypeV4.class)
- .setProtocol(ProtocolTcp.class)
+ .setProtocol(protocolTcp)
.setPortRangeMin(80)
.setPortRangeMax(80)
.setDirection(DirectionIngress.class)
ruleAware.addNeutronSecurityRule(serverIn80TcpIpv4, neutron, rwTx);
TenantId tenantId = new TenantId(tenant);
Optional<Contract> potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(goldInIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(goldInIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
Contract contract = potentialContract.get();
PolicyAssert.assertContract(contract, goldInIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(goldOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(goldOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, goldOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, serverOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(serverIn80TcpIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(serverIn80TcpIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, serverIn80TcpIpv4);
EndpointGroup epg = potentialEpg.get();
PolicyAssert.assertConsumerNamedSelectors(
epg,
- ImmutableSet.of(new ContractId(goldInIpv4.getId().getValue()),
- new ContractId(goldOutIpv4.getId().getValue()),
- new ContractId(serverOutIpv4.getId().getValue()),
- new ContractId(serverIn80TcpIpv4.getId().getValue())));
+ ImmutableSet.of(new ContractId(goldInIpv4.getUuid().getValue()),
+ new ContractId(goldOutIpv4.getUuid().getValue()),
+ new ContractId(serverOutIpv4.getUuid().getValue()),
+ new ContractId(serverIn80TcpIpv4.getUuid().getValue())));
potentialEpg = rwTx.read(LogicalDatastoreType.CONFIGURATION,
IidFactory.endpointGroupIid(tenantId, new EndpointGroupId(serverSecGrp))).get();
assertTrue(potentialEpg.isPresent());
epg = potentialEpg.get();
PolicyAssert.assertConsumerNamedSelectors(
epg,
- ImmutableSet.of(new ContractId(goldInIpv4.getId().getValue()),
- new ContractId(serverIn80TcpIpv4.getId().getValue())));
+ ImmutableSet.of(new ContractId(goldInIpv4.getUuid().getValue()),
+ new ContractId(serverIn80TcpIpv4.getUuid().getValue())));
}
@Test
ruleAware.addNeutronSecurityRule(defaultOutIpv6, neutron, rwTx);
TenantId tenantId = new TenantId(tenant);
Optional<Contract> potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(defaultInIpv4Default.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(defaultInIpv4Default.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
Contract contract = potentialContract.get();
PolicyAssert.assertContract(contract, defaultInIpv4Default);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(defaultInIpv6Default.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(defaultInIpv6Default.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, defaultInIpv6Default);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(defaultOutIpv4.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(defaultOutIpv4.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, defaultOutIpv4);
potentialContract = rwTx.read(LogicalDatastoreType.CONFIGURATION,
- IidFactory.contractIid(tenantId, new ContractId(defaultOutIpv6.getId().getValue()))).get();
+ IidFactory.contractIid(tenantId, new ContractId(defaultOutIpv6.getUuid().getValue()))).get();
assertTrue(potentialContract.isPresent());
contract = potentialContract.get();
PolicyAssert.assertContract(contract, defaultOutIpv6);
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolTcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.NeutronBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.SecurityGroupsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.security.groups.SecurityGroup;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;
// create neutron security rule
private SecurityRule buildNeutronSecurityRule() {
- return new SecurityRuleBuilder().setId(new Uuid(RULE_ID))
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ return new SecurityRuleBuilder().setUuid(new Uuid(RULE_ID))
.setTenantId(new Uuid(RULE_TENANT_ID))
.setSecurityGroupId(new Uuid(RULE_GROUP_ID))
.setRemoteIpPrefix(new IpPrefix(new Ipv4Prefix("192.0.0.1/24")))
.setPortRangeMin(1000)
.setPortRangeMax(5000)
- .setProtocol(ProtocolTcp.class)
+ .setProtocol(protocolTcp)
.setEthertype(EthertypeV4.class)
.setDirection(DirectionIngress.class)
.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolIcmp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolTcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolUdp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRuleBuilder;
@Before
public void setUp() throws Exception {
- secRuleBuilder = new SecurityRuleBuilder().setId(new Uuid("01234567-abcd-ef01-0123-0123456789ab"));
+ secRuleBuilder = new SecurityRuleBuilder().setUuid(new Uuid("01234567-abcd-ef01-0123-0123456789ab"));
}
@Test
@Test
public final void testGetClassifierInstance_EthertypeAndProtocol() {
secRuleBuilder.setEthertype(EthertypeV4.class);
- secRuleBuilder.setProtocol(ProtocolTcp.class);
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ secRuleBuilder.setProtocol(protocolTcp);
ClassifierInstance ci = SecRuleEntityDecoder.getClassifierInstance(secRuleBuilder.build());
Assert.assertEquals(IpProtoClassifierDefinition.DEFINITION.getId(), ci.getClassifierDefinitionId());
// name is ip_proto_tcp__ether_type_IPv4
@Test
public final void testGetClassifierInstance_EthertypeAndProtocolAndPort() {
secRuleBuilder.setEthertype(EthertypeV4.class);
- secRuleBuilder.setProtocol(ProtocolTcp.class);
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ secRuleBuilder.setProtocol(protocolTcp);
secRuleBuilder.setPortRangeMin(5);
secRuleBuilder.setPortRangeMax(5);
ClassifierInstance ci = SecRuleEntityDecoder.getClassifierInstance(secRuleBuilder.build());
@Test
public final void testGetClassifierInstance_EthertypeAndProtocolAndPorts() {
secRuleBuilder.setEthertype(EthertypeV4.class);
- secRuleBuilder.setProtocol(ProtocolTcp.class);
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ secRuleBuilder.setProtocol(protocolTcp);
secRuleBuilder.setPortRangeMin(5);
secRuleBuilder.setPortRangeMax(10);
ClassifierInstance ci = SecRuleEntityDecoder.getClassifierInstance(secRuleBuilder.build());
@Test
public void testIsProtocolOfOneWithinTwo_oneProtocolTcpTwoProtocolTcp() {
- SecurityRule one = secRuleBuilder.setProtocol(ProtocolTcp.class).build();
- SecurityRule two = secRuleBuilder.setProtocol(ProtocolTcp.class).build();
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ SecurityRule one = secRuleBuilder.setProtocol(protocolTcp).build();
+ SecurityRule two = secRuleBuilder.setProtocol(protocolTcp).build();
assertTrue(SecRuleEntityDecoder.isProtocolOfOneWithinTwo(one, two));
}
@Test
public void testIsProtocolOfOneWithinTwo_oneProtocolTcpTwoProtocolNull() {
- SecurityRule one = secRuleBuilder.setProtocol(ProtocolTcp.class).build();
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ SecurityRule one = secRuleBuilder.setProtocol(protocolTcp).build();
SecurityRule two = secRuleBuilder.setProtocol(null).build();
assertTrue(SecRuleEntityDecoder.isProtocolOfOneWithinTwo(one, two));
}
@Test
public void testIsProtocolOfOneWithinTwo_oneProtocolTcpTwoProtocolUdp() {
- SecurityRule one = secRuleBuilder.setProtocol(ProtocolTcp.class).build();
- SecurityRule two = secRuleBuilder.setProtocol(ProtocolUdp.class).build();
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ SecurityRule one = secRuleBuilder.setProtocol(protocolTcp).build();
+ SecurityRuleAttributes.Protocol protocolUdp = new SecurityRuleAttributes.Protocol(ProtocolUdp.class);
+ SecurityRule two = secRuleBuilder.setProtocol(protocolUdp).build();
assertFalse(SecRuleEntityDecoder.isProtocolOfOneWithinTwo(one, two));
}
@Test
public void testIsProtocolOfOneWithinTwo_oneProtocolNullTwoProtocolTcp() {
SecurityRule one = secRuleBuilder.setProtocol(null).build();
- SecurityRule two = secRuleBuilder.setProtocol(ProtocolTcp.class).build();
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ SecurityRule two = secRuleBuilder.setProtocol(protocolTcp).build();
assertFalse(SecRuleEntityDecoder.isProtocolOfOneWithinTwo(one, two));
}
@Test
public final void testGetProtocol_protoTcp() {
- secRuleBuilder.setProtocol(ProtocolTcp.class);
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ secRuleBuilder.setProtocol(protocolTcp);
Assert.assertEquals(IpProtoClassifierDefinition.TCP_VALUE, SecRuleEntityDecoder.getProtocol(secRuleBuilder.build()));
}
@Test
public final void testGetProtocol_protoUdp() {
- secRuleBuilder.setProtocol(ProtocolUdp.class);
+ SecurityRuleAttributes.Protocol protocolUdp = new SecurityRuleAttributes.Protocol(ProtocolUdp.class);
+ secRuleBuilder.setProtocol(protocolUdp);
Assert.assertEquals(IpProtoClassifierDefinition.UDP_VALUE, SecRuleEntityDecoder.getProtocol(secRuleBuilder.build()));
}
@Test
public final void testGetProtocol_protoIcmp() {
- secRuleBuilder.setProtocol(ProtocolIcmp.class);
+ SecurityRuleAttributes.Protocol protocolIcmp = new SecurityRuleAttributes.Protocol(ProtocolIcmp.class);
+ secRuleBuilder.setProtocol(protocolIcmp);
Assert.assertEquals(IpProtoClassifierDefinition.ICMP_VALUE, SecRuleEntityDecoder.getProtocol(secRuleBuilder.build()));
}
@Test
public final void testGetProtocol_protoUnknown() {
- secRuleBuilder.setProtocol(UnknownProtocol.class);
+ SecurityRuleAttributes.Protocol protocolUnknown = new SecurityRuleAttributes.Protocol(UnknownProtocol.class);
+ secRuleBuilder.setProtocol(protocolUnknown);
thrown.expect(IllegalArgumentException.class);
SecRuleEntityDecoder.getProtocol(secRuleBuilder.build());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionIngress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeV4;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolTcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRuleBuilder;
public class SecRuleNameDecoderTest {
@Before
public void setUp() throws Exception {
- secRule = new SecurityRuleBuilder().setId(new Uuid("01234567-abcd-ef01-0123-0123456789ab"));
+ secRule = new SecurityRuleBuilder().setUuid(new Uuid("01234567-abcd-ef01-0123-0123456789ab"));
}
@Test
public final void testGetClassifierInstanceName() {
secRule.setDirection(DirectionIngress.class);
secRule.setEthertype(EthertypeV4.class);
- secRule.setProtocol(ProtocolTcp.class);
+ SecurityRuleAttributes.Protocol protocolTcp = new SecurityRuleAttributes.Protocol(ProtocolTcp.class);
+ secRule.setProtocol(protocolTcp);
secRule.setPortRangeMin(8010);
secRule.setPortRangeMax(8020);
StringBuilder frmtBuilder = new StringBuilder();
.append(EtherTypeClassifierDefinition.DEFINITION.getName().getValue())
.append(MappingUtils.NAME_VALUE_DELIMETER)
.append("%s");
- String frmtClsfName = String.format(frmtBuilder.toString(), 8010, 8020, secRule.getProtocol().getSimpleName(),
+ String frmtClsfName = String.format(frmtBuilder.toString(), 8010, 8020, secRule.getProtocol().getIdentityref().getSimpleName(),
secRule.getEthertype().getSimpleName());
ClassifierName expectedClsfInstanceName = new ClassifierName(frmtClsfName);
assertEquals(expectedClsfInstanceName, SecRuleNameDecoder.getClassifierInstanceName(secRule.build()));
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.security.groups.SecurityGroup;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.security.groups.SecurityGroupBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;
public static SecurityRule securityRuleWithoutGroupIds(String id, String tenant, Class<? extends EthertypeBase> etherType,
Class<? extends DirectionBase> direction, Class<? extends ProtocolBase> protocol, int portMin, int portMax) {
+ SecurityRuleAttributes.Protocol proto = new SecurityRuleAttributes.Protocol(protocol);
SecurityRuleBuilder secRule = new SecurityRuleBuilder();
- secRule.setId(new Uuid(id));
+ secRule.setUuid(new Uuid(id));
secRule.setTenantId(new Uuid(tenant));
secRule.setEthertype(etherType);
secRule.setDirection(direction);
- secRule.setProtocol(protocol);
+ secRule.setProtocol(proto);
secRule.setPortRangeMin(portMin);
secRule.setPortRangeMax(portMax);
return secRule.build();
public static SecurityRule securityRuleWithEtherType(String id, String tenant,
Class<? extends EthertypeBase> etherType, Class<? extends DirectionBase> direction, String ownerGroupId,
String remoteGroupId) {
- SecurityRuleBuilder securityRuleBuilder = new SecurityRuleBuilder().setId(new Uuid(id))
+ SecurityRuleBuilder securityRuleBuilder = new SecurityRuleBuilder().setUuid(new Uuid(id))
.setTenantId(new Uuid(tenant))
.setEthertype(etherType)
.setDirection(direction)
}
public static void assertContractWithEic(Contract contract, SecurityRule secRule) {
- assertEquals(new ContractId(secRule.getId().getValue()), contract.getId());
+ assertEquals(new ContractId(secRule.getUuid().getValue()), contract.getId());
assertNull(contract.getQuality());
assertNull(contract.getTarget());
assertOneClauseWithEicWithOneSubject(contract, secRule);
}
public static void assertContract(Contract contract, SecurityRule secRule) {
- assertEquals(new ContractId(secRule.getId().getValue()), contract.getId());
+ assertEquals(new ContractId(secRule.getUuid().getValue()), contract.getId());
assertNull(contract.getQuality());
assertNull(contract.getTarget());
assertOneClauseWithOneSubject(contract, secRule);
<artifactId>neutron-mapper</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.neutron</groupId>
- <artifactId>neutron-spi</artifactId>
- <version>${neutron.version}</version>
- </dependency>
<dependency>
<groupId>org.opendaylight.groupbasedpolicy</groupId>
<artifactId>vpp-renderer</artifactId>
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>