Fix testIpClientIsNotStartedWhenLinkIsDown.
This test is failing at HEAD because the known bug it is
testing for is fixed. Check that IpClient is (correctly) not
started when link is down. In order to ensure that the test is
correct and that not starting IpClient is not caused by some
other setup problem in the test, ensure that IpClient is also
(correctly) started if later on link does come up.
Test: atest EthernetServiceTests
Test: atest --rerun-until-failure 100 EthernetNetworkFactoryTest#testIpClientIsNotStartedWhenLinkIsDown
Change-Id: Id30bc9be1fc3ecf3d10c12d0b23c64814f4dbf9c
diff --git a/tests/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java b/tests/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java
index 6e7c267..e10497e 100644
--- a/tests/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java
+++ b/tests/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java
@@ -456,9 +456,10 @@
.build();
mNetFactory.needNetworkFor(specificNetRequest);
- // TODO(b/155707957): BUG: IPClient should not be started when the interface link state
- // is down.
- verify(mDeps).makeIpClient(any(), any(), any());
+ verify(mDeps, never()).makeIpClient(any(), any(), any());
+
+ mNetFactory.updateInterfaceLinkState(TEST_IFACE, true, NULL_LISTENER);
+ verify(mDeps).makeIpClient(any(), eq(TEST_IFACE), any());
}
@Test