when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
when(nodeCacheManager.getNode(nodeId_1)).thenReturn(node);
when(neutronPort_Vm1.getMacAddress()).thenReturn("attached-mac");
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, true);
- verify(egressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(true));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, true);
+ verify(egressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(true));
}
/**
securityRuleList.add(neutronSecurityRule_1);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_INGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, true);
- verify(ingressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(true));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, true);
+ verify(ingressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(true));
}
/**
securityRuleList.add(neutronSecurityRule_1);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_EGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(egressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(egressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
/**
securityRuleList.add(neutronSecurityRule_1);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_INGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(ingressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(ingressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
/**
securityRuleList.add(neutronSecurityRule_1);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_INGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(null, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(null, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
/**
when(neutronPort_Vm1.getSecurityGroups()).thenReturn(null);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_INGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
/**
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_INGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
when(southbound.getInterfaceExternalIdsValue(any(OvsdbTerminationPointAugmentation.class),eq("attached-mac"))).thenReturn(null);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(ingressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(ingressAclService, times(1)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
securityRuleList.add(neutronSecurityRule_1);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn(NeutronSecurityRule.DIRECTION_INGRESS);
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV6);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
/**
securityRuleList.add(neutronSecurityRule_1);
when(neutronSecurityRule_1.getSecurityRuleDirection()).thenReturn("outgress");
when(neutronSecurityRule_1.getSecurityRuleEthertype()).thenReturn(NeutronSecurityRule.ETHERTYPE_IPV4);
- when(neutronSecurityGroup_1.getSecurityGroupName()).thenReturn(SECURITY_GROUP_ID_1);
- securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, neutronSecurityGroup_1, false);
- verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutronSecurityGroup_1), eq(neutron_ip_1), eq(false));
+ securityServicesImpl.syncSecurityRule(neutronPort_Vm1, neutronSecurityRule_1, neutron_ip_1, nodeId_1, false);
+ verify(ingressAclService, times(0)).programPortSecurityRule(eq(new Long(1)), eq("1000"), eq("attached-mac"), eq(neutronSecurityRule_1), eq(neutron_ip_1), eq(false));
}
@Test