Add testLockdownVpn that mocks platform VPN.
Add a test for lockdown vpn that uses TYPE_IKEV2_IPSEC_PSK and mocks platform VPN by override in startLegacyVpnPrivileged(). In the context of ConnectivityService, setVpnDefaultForUids() is the main interaction. Refactor testLegacyLockdownVpn to take a VpnProfile and assert behaviors with and without setVpnDefaultForUids(). This includes: 1. Updating callback asserts and assertActiveNetworkInfo to reflect setVpnDefaultForUids(). 2. Adding TODOs where mCm.getActiveNetworkInfo() returns unexpected values. Bug: 230548427 Test: atest FrameworksNetTests Change-Id: Ida4a4bc745af5ba2fc251795b2ffca56ead79b7f
Loading
Please register or sign in to comment