Fix the test flake in testChangeUnderlyingNetworks

The testChangeUnderlyingNetworks test enables the Wi-Fi network
and ensures it's connected. However, the CS can switch the
default network to Wi-Fi at any time when it becomes validated,
and if this happens after the test obtains the active network,
it leads to a mismatch on underlying networks and causes the test
to fail. Therefore, ensure the Wi-Fi network is validated before
obtaining the active network.

Fix: 332967125
Test: atest CtsHostsideNetworkTests:com.android.cts.net.\
      HostsideVpnTests#testChangeUnderlyingNetworks --iteration
Change-Id: If71c2ea6608f26b1dbc9802ef49e1f14b202c156
1 file changed