Search in sources :

Example 1 with MplsTcCriterion

use of org.onosproject.net.flow.criteria.MplsTcCriterion in project onos by opennetworkinglab.

the class PiCriterionTranslatorsTest method testMplsTcCriterion.

@Test
public void testMplsTcCriterion() throws Exception {
    byte[] mplsTc = new byte[1];
    random.nextBytes(mplsTc);
    int bitWidth = 16;
    MplsTcCriterion criterion = (MplsTcCriterion) Criteria.matchMplsTc(mplsTc[0]);
    PiExactFieldMatch exactMatch = (PiExactFieldMatch) translateCriterion(criterion, fieldId, EXACT, bitWidth);
    assertThat(exactMatch.value().asReadOnlyBuffer().get(1), is(criterion.tc()));
}
Also used : MplsTcCriterion(org.onosproject.net.flow.criteria.MplsTcCriterion) PiExactFieldMatch(org.onosproject.net.pi.runtime.PiExactFieldMatch) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MplsTcCriterion (org.onosproject.net.flow.criteria.MplsTcCriterion)1 PiExactFieldMatch (org.onosproject.net.pi.runtime.PiExactFieldMatch)1