2 * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netvirt.aclservice.tests;
10 import org.junit.Rule;
11 import org.junit.rules.MethodRule;
12 import org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorTestModule;
13 import org.opendaylight.genius.datastoreutils.testutils.TestableDataTreeChangeListenerModule;
14 import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.config.rev160806.AclserviceConfig.SecurityGroupMode;
18 public class AclServiceStatefulTest extends AclServiceTestBase {
20 public @Rule MethodRule guice = new GuiceRule(new AclServiceModule(),
21 new AclServiceTestModule(SecurityGroupMode.Stateful),
22 new TestableDataTreeChangeListenerModule(),
23 new JobCoordinatorTestModule());
25 private final FlowEntryObjectsStateful ipv4statefulentries = new FlowEntryObjectsStateful();
28 void newInterfaceCheck() {
29 assertFlowsInAnyOrder(ipv4statefulentries.expectedFlows(PORT_MAC_1));
33 void newInterfaceWithEtherTypeAclCheck() {
34 assertFlowsInAnyOrder(ipv4statefulentries.etherFlows());
38 public void newInterfaceWithTcpDstAclCheck() {
39 assertFlowsInAnyOrder(ipv4statefulentries.tcpFlows());
43 public void newInterfaceWithUdpDstAclCheck() {
44 assertFlowsInAnyOrder(ipv4statefulentries.udpFlows());
48 public void newInterfaceWithIcmpAclCheck() {
49 assertFlowsInAnyOrder(ipv4statefulentries.icmpFlows());
53 public void newInterfaceWithDstPortRangeCheck() {
54 assertFlowsInAnyOrder(ipv4statefulentries.dstRangeFlows());
58 public void newInterfaceWithDstAllPortsCheck() {
59 assertFlowsInAnyOrder(ipv4statefulentries.dstAllFlows());
63 void newInterfaceWithTwoAclsHavingSameRulesCheck() {
64 // TODO Fix up — this is broken since the Genius InstructionInfo clean-up
65 //assertFlowsInAnyOrder(FlowEntryObjectsStateful.icmpFlowsForTwoAclsHavingSameRules());
69 void newInterfaceWithAapIpv4AllCheck() {
70 assertFlowsInAnyOrder(ipv4statefulentries.aapWithIpv4AllFlows());
74 void newInterfaceWithAapCheck() {
75 assertFlowsInAnyOrder(ipv4statefulentries.aapFlows());
79 void newInterfaceWithMultipleAclCheck() {
80 assertFlowsInAnyOrder(ipv4statefulentries.multipleAcl());