Fixing PushTestIntents command to ignore WITHDRAW_REQ
Change-Id: I5b45c8b0304dbe730830fe4ba8a468a68fe35ab6
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -40,6 +40,7 @@ import org.onlab.onos.net.intent.PointToPointIntent; | ... | @@ -40,6 +40,7 @@ import org.onlab.onos.net.intent.PointToPointIntent; |
40 | import org.onlab.packet.Ethernet; | 40 | import org.onlab.packet.Ethernet; |
41 | import org.onlab.packet.MacAddress; | 41 | import org.onlab.packet.MacAddress; |
42 | 42 | ||
43 | +import java.util.EnumSet; | ||
43 | import java.util.List; | 44 | import java.util.List; |
44 | import java.util.concurrent.CountDownLatch; | 45 | import java.util.concurrent.CountDownLatch; |
45 | import java.util.concurrent.TimeUnit; | 46 | import java.util.concurrent.TimeUnit; |
... | @@ -235,6 +236,8 @@ public class IntentPushTestCommand extends AbstractShellCommand | ... | @@ -235,6 +236,8 @@ public class IntentPushTestCommand extends AbstractShellCommand |
235 | return deviceString.substring(0, slash); | 236 | return deviceString.substring(0, slash); |
236 | } | 237 | } |
237 | 238 | ||
239 | + private static final EnumSet<IntentEvent.Type> IGNORE_EVENT | ||
240 | + = EnumSet.of(Type.INSTALL_REQ, Type.WITHDRAW_REQ); | ||
238 | @Override | 241 | @Override |
239 | public void event(IntentEvent event) { | 242 | public void event(IntentEvent event) { |
240 | Type expected = add ? Type.INSTALLED : Type.WITHDRAWN; | 243 | Type expected = add ? Type.INSTALLED : Type.WITHDRAWN; |
... | @@ -245,7 +248,7 @@ public class IntentPushTestCommand extends AbstractShellCommand | ... | @@ -245,7 +248,7 @@ public class IntentPushTestCommand extends AbstractShellCommand |
245 | } else { | 248 | } else { |
246 | log.warn("install event latch is null"); | 249 | log.warn("install event latch is null"); |
247 | } | 250 | } |
248 | - } else if (event.type() != Type.INSTALL_REQ) { | 251 | + } else if (IGNORE_EVENT.contains(event.type())) { |
249 | log.info("Unexpected intent event: {}", event); | 252 | log.info("Unexpected intent event: {}", event); |
250 | } | 253 | } |
251 | } | 254 | } | ... | ... |
-
Please register or login to post a comment