Bug9245: Table=21 related exceptions fixes
[netvirt.git] / vpnservice / aclservice / impl / src / test / java / org / opendaylight / netvirt / aclservice / tests / AclServiceStatefulTest.java
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.netvirt.aclservice.tests;
9
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;
16
17
18 public class AclServiceStatefulTest extends AclServiceTestBase {
19
20     public @Rule MethodRule guice = new GuiceRule(new AclServiceModule(),
21             new AclServiceTestModule(SecurityGroupMode.Stateful),
22             new TestableDataTreeChangeListenerModule(),
23             new JobCoordinatorTestModule());
24
25     private final FlowEntryObjectsStateful ipv4statefulentries = new FlowEntryObjectsStateful();
26
27     @Override
28     void newInterfaceCheck() {
29         assertFlowsInAnyOrder(ipv4statefulentries.expectedFlows(PORT_MAC_1));
30     }
31
32     @Override
33     void newInterfaceWithEtherTypeAclCheck() {
34         assertFlowsInAnyOrder(ipv4statefulentries.etherFlows());
35     }
36
37     @Override
38     public void newInterfaceWithTcpDstAclCheck() {
39         assertFlowsInAnyOrder(ipv4statefulentries.tcpFlows());
40     }
41
42     @Override
43     public void newInterfaceWithUdpDstAclCheck() {
44         assertFlowsInAnyOrder(ipv4statefulentries.udpFlows());
45     }
46
47     @Override
48     public void newInterfaceWithIcmpAclCheck() {
49         assertFlowsInAnyOrder(ipv4statefulentries.icmpFlows());
50     }
51
52     @Override
53     public void newInterfaceWithDstPortRangeCheck() {
54         assertFlowsInAnyOrder(ipv4statefulentries.dstRangeFlows());
55     }
56
57     @Override
58     public void newInterfaceWithDstAllPortsCheck() {
59         assertFlowsInAnyOrder(ipv4statefulentries.dstAllFlows());
60     }
61
62     @Override
63     void newInterfaceWithTwoAclsHavingSameRulesCheck() {
64         // TODO Fix up — this is broken since the Genius InstructionInfo clean-up
65         //assertFlowsInAnyOrder(FlowEntryObjectsStateful.icmpFlowsForTwoAclsHavingSameRules());
66     }
67
68     @Override
69     void newInterfaceWithAapIpv4AllCheck() {
70         assertFlowsInAnyOrder(ipv4statefulentries.aapWithIpv4AllFlows());
71     }
72
73     @Override
74     void newInterfaceWithAapCheck() {
75         assertFlowsInAnyOrder(ipv4statefulentries.aapFlows());
76     }
77
78     @Override
79     void newInterfaceWithMultipleAclCheck() {
80         assertFlowsInAnyOrder(ipv4statefulentries.multipleAcl());
81     }
82 }