Bug 4996 - Wrong flows when using SFC coexistence
[netvirt.git] / openstack / net-virt-sfc / impl / src / test / java / org / opendaylight / ovsdb / openstack / netvirt / sfc / workaround / services / AclMatchesTest.java
1 /*
2  * Copyright © 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
9 package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
10
11 import static org.junit.Assert.assertEquals;
12
13 import org.junit.Test;
14 import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.MatchesBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
18
19 public class AclMatchesTest {
20     @Test
21     public void buildMatchTest() {
22         AclUtils aclUtils = new AclUtils();
23         MatchesBuilder matchesBuilder = aclUtils.matchesBuilder(new MatchesBuilder(), 80);
24         AclMatches aclMatches = new AclMatches(matchesBuilder.build());
25         MatchBuilder matchBuilder = new MatchBuilder();
26         MatchUtils.createIpProtocolMatch(matchBuilder, (short)6);
27         MatchUtils.addLayer4Match(matchBuilder, 6, 0, 80);
28         assertEquals(matchBuilder.build(), aclMatches.buildMatch().build());
29     }
30 }