Enable AD-SAL application to configure OF 1.3 PUSH_VLAN action.
[controller.git] / opendaylight / sal / api / src / test / java / org / opendaylight / controller / sal / action / ActionTest.java
index 3fe9a18b3fa545cbdcf279092c272c43a34d4cc1..14f0d83ff670d7343b1b67e59796cdec44223cf9 100644 (file)
@@ -87,6 +87,24 @@ public class ActionTest {
 
         action = new PushVlan(EtherTypes.QINQ, 0x4, -1, 2000);
         Assert.assertFalse(action.isValid());
+
+        // OF 1.3 PUSH_VLAN test.
+        for (EtherTypes tag: EtherTypes.values()) {
+            int t = tag.intValue();
+            boolean valid =
+                (tag == EtherTypes.VLANTAGGED || tag == EtherTypes.QINQ);
+            PushVlan pv = new PushVlan(tag);
+            Assert.assertEquals(valid, pv.isValid());
+            if (valid) {
+                Assert.assertEquals(t, pv.getTag());
+            }
+
+            pv = new PushVlan(t);
+            Assert.assertEquals(valid, pv.isValid());
+            if (valid) {
+                Assert.assertEquals(t, pv.getTag());
+            }
+        }
     }
 
     @Test