Accept more than one SD in NsdManagerTest
In current implementation it's been assumed that there will be only one
interface registered for service discovery in mdnsresponder. In reality
there's possibility that some real but currently unused interfaces will
have link-local address assigned prior to registration, which will cause
mdnsresponder to register these interfaces for service discovery. This
will result in SERVICE_LOST and SERVICE_FOUND events to be received more
than one time. Current test implementation is not 100% prone for this
situation - depending upon time gap between both events it can PASS or
FAIL.
Fix by removing an assert on number of received events.
Change-Id: I147dc4d600f41f6d63d2b9e4bcb10efe90d5b3ec
(cherry picked from commit 2d8190d1ae75a78d061a64a733f39f3ab577f198)
diff --git a/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java b/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java
index d434728..e132cce 100644
--- a/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java
@@ -372,8 +372,6 @@
assertTrue(lastEvent != null);
assertTrue(lastEvent.mInfo.getServiceName().equals(registeredName));
- assertTrue(eventCacheSize() == 2);
-
// Register service again to see if we discover it
checkForAdditionalEvents();
clearEventCache();
@@ -405,7 +403,6 @@
lastEvent.mInfo.getServiceName());
assertTrue(lastEvent.mInfo.getServiceName().equals(registeredName));
- assertTrue(checkCacheSize(2));
checkForAdditionalEvents();
clearEventCache();