From 30c89dc21866dedd53d396212ed903ba812c6b44 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Wed, 13 Apr 2022 11:25:15 +0200 Subject: [PATCH] Add EthernetTestInterface to list of created interfaces This is a bug that was missed in my last CL. Newly created EthernetTestIntefaces need to be added to the createdIfaces list, so they are properly destroyed on tearDown. Test: atest CtsNetTestCases:EthernetManagerTest Change-Id: I53bd728a7ecb5a37ae89079ade0a3ebdae304a1a --- tests/cts/net/src/android/net/cts/EthernetManagerTest.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt index 30e0015a1c..f7a2421b45 100644 --- a/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt +++ b/tests/cts/net/src/android/net/cts/EthernetManagerTest.kt @@ -177,7 +177,10 @@ class EthernetManagerTest { } private fun createInterface(): EthernetTestInterface { - return EthernetTestInterface(context, Handler(Looper.getMainLooper())) + return EthernetTestInterface( + context, + Handler(Looper.getMainLooper()) + ).also { createdIfaces.add(it) } } private fun setIncludeTestInterfaces(value: Boolean) {