/*
- * Copyright (c) 2015 - 2016 Inocybe and others. All rights reserved.
+ * Copyright © 2015, 2017 Inocybe 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,
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.api.support.membermodification.MemberModifier;
@Mock private SecurityServicesManager securityServices;
@Mock private SecurityGroupCacheManger securityGroupCacheManger;
@Mock private INeutronSecurityRuleCRUD neutronSecurityRuleCache;
+ @Mock private NodeId nodeId;
private List<Neutron_IPs> neutronSrcIpList = new ArrayList<>();
private List<Neutron_IPs> neutronDestIpList = new ArrayList<>();
private static NodeBuilder nodeBuilder;
private static Answer<Object> answer() {
- return new Answer<Object>() {
- @Override
- public CheckedFuture<Void, TransactionCommitFailedException> answer(InvocationOnMock invocation)
- throws Throwable {
- flowBuilder = (FlowBuilder) invocation.getArguments()[0];
- nodeBuilder = (NodeBuilder) invocation.getArguments()[1];
- return null;
- }
+ return invocation -> {
+ flowBuilder = (FlowBuilder) invocation.getArguments()[0];
+ nodeBuilder = (NodeBuilder) invocation.getArguments()[1];
+ return null;
};
}
/**
* Test method {@link EgressAclService#programPortSecurityGroup(java.lang.Long, java.lang.String,
* java.lang.String, long, NeutronSecurityGroup,
- * java.lang.String, boolean)} when portSecurityRule is incomplete
+ * java.lang.String, NodeId, boolean)} when portSecurityRule is incomplete
*/
@Test
public void testProgramPortSecurityGroupWithIncompleteRule() throws Exception {
when(neutronSecurityRuleCache.getAllNeutronSecurityRules()).thenReturn(portSecurityList);
ingressAclServiceSpy.programPortSecurityGroup(
- Long.valueOf(1554), "2", MAC_ADDRESS, 124, localSecurityGroup, PORT_UUID, false);
+ 1554L, "2", MAC_ADDRESS, 124, localSecurityGroup, PORT_UUID, nodeId, false);
}
/**
when(portSecurityRule.getSecurityRulePortMin()).thenReturn(null);
when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
- ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,true);
+ ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, true);
verify(writeTransaction, times(1)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
verify(writeTransaction, times(1)).submit();
when(portSecurityIpv6Rule.getSecurityRulePortMin()).thenReturn(null);
when(portSecurityIpv6Rule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
- ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, true);
+ ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, nodeId, true);
verify(writeTransaction, times(1)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
verify(writeTransaction, times(1)).submit();
when(portSecurityRule.getSecurityRulePortMin()).thenReturn(null);
when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
- ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,false);
+ ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, false);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(1)).submit();
when(portSecurityIpv6Rule.getSecurityRulePortMin()).thenReturn(null);
when(portSecurityIpv6Rule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
- ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, false);
+ ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, nodeId, false);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(1)).submit();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, true);
+ PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
- PORT_UUID, false);
+ PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
EthernetMatch ethMatch = match.getEthernetMatch();
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, true);
+ MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
Icmpv4Match icmpv4Match = match.getIcmpv4Match();
Assert.assertEquals(10, icmpv4Match.getIcmpv4Type().shortValue());
PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, true);
+ MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
Icmpv6Match icmpv6Match = match.getIcmpv6Match();
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, false);
+ MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
Icmpv4Match icmpv4Match = match.getIcmpv4Match();
Assert.assertEquals(20, icmpv4Match.getIcmpv4Type().shortValue());
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, false);
+ MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
Icmpv6Match icmpv6Match = match.getIcmpv6Match();
Assert.assertEquals(20, icmpv6Match.getIcmpv6Type().shortValue());
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, true);
+ MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
Icmpv4Match icmpv4Match =match.getIcmpv4Match();
Assert.assertEquals(30, icmpv4Match.getIcmpv4Type().shortValue());
any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, true);
+ MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, true);
Match match = flowBuilder.getMatch();
Icmpv6Match icmpv6Match =match.getIcmpv6Match();
Assert.assertEquals(30, icmpv6Match.getIcmpv6Type().shortValue());
.when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class), any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, false);
+ MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
Icmpv4Match icmpv4Match = match.getIcmpv4Match();
Assert.assertEquals(40, icmpv4Match.getIcmpv4Type().shortValue());
.when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class), any(NodeBuilder.class));
ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
- MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, false);
+ MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, false);
Match match = flowBuilder.getMatch();
Icmpv6Match icmpv6Match = match.getIcmpv6Match();
Assert.assertEquals(40, icmpv6Match.getIcmpv6Type().shortValue());
public void testProgramPortSecurityACLRuleInvalidEther() throws Exception {
when(portSecurityRule.getSecurityRuleEthertype()).thenReturn("IP");
- ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,false);
+ ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, false);
verify(writeTransaction, times(0)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(0)).submit();
public void testProgramPortSecurityACLRuleInvalidDirection() throws Exception {
when(portSecurityRule.getSecurityRuleDirection()).thenReturn("edgress");
- ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,false);
+ ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, false);
verify(writeTransaction, times(0)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(0)).submit();
public void testProgramFixedSecurityACLAdd2() throws Exception {
when(securityServices.isConntrackEnabled()).thenReturn(false);
- ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
+ ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
verify(writeTransaction, times(3)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
verify(writeTransaction, times(3)).submit();
public void testProgramFixedSecurityACLRemove2() throws Exception {
when(securityServices.isConntrackEnabled()).thenReturn(false);
- ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
+ ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
verify(writeTransaction, times(3)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(3)).submit();
public void testProgramFixedSecurityACLAdd4() throws Exception {
when(securityServices.isConntrackEnabled()).thenReturn(true);
- ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
+ ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
verify(writeTransaction, times(8)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
verify(writeTransaction, times(8)).submit();
public void testProgramFixedSecurityACLRemove4() throws Exception {
when(securityServices.isConntrackEnabled()).thenReturn(true);
- ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
+ ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
verify(writeTransaction, times(8)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(8)).submit();