From 5216fc9eefded0b7033073f2630ee5178dec8d35 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Wed, 9 Feb 2022 08:53:59 +0900 Subject: [PATCH] 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 --- .../server/ethernet/EthernetNetworkFactoryTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java b/tests/ethernet/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java index 6e7c267445..e10497e4e3 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 @@ public class EthernetNetworkFactoryTest { .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