Wrap use of test interface in EthernetTestInterface

NsdManagerDownstreamTetheringTest closed the test interface without
waiting on the STATE_ABSENT callback from ethernet service. This meant
that during setUp, an ethernet test interface might
still have been present from the previous test causing the test to be
flaky.

Note that flakiness was not uncovered until a recent change in
EthernetTetheringTestBase, which skips tests when a built-in ethernet
interface is present. This check used to throw an assumption failure if
any interface for tethering was already available, but was recently
changed to only throw the assumption failure if said interface is not
named testtap%d. So this test has always been broken, it just was not
obvious because the flakes would result in the test getting skipped.

Test: atest NsdManagerDownstreamTetheringTest --iterations 20
Bug: 348064142
Change-Id: I15f2aeacdf621a4413bda032331abb64c75d86a7
1 file changed