Add a test for starting the legacy VPN.
The legacy VPN has, among many parameters, a host to connect to. This host can be specified as a numeric address, or as a hostname. When it's a name, resolution is required. Currently, name resolution is performed by the native VPN daemons racoon and mtpd. When a hostname is used, the framework does not know the IP address of the VPN server and does not add a throw route for the VPN server IP address. On older kernels this does not matter because the legacy PPP kernel code binds the PPP socket to the right network, but on newer devices that use the upstream PPP code, this does not work. See b/133797637. This patch instruments the legacy VPN code so that it can be run in tests, and uses this instrumentation to simulate passing a configuration that contains a host, and verifies that the arguments passed to the mptd and racoon daemons receive the expected server address, and that the expected throw route is correctly installed. It then adds two tests : one specifying the server as a numeric address, and one as a hostname. As the resolution is currently broken, the latter of these tests is added disabled, and the followup fix to the issue enables it. This test is basic and very targeted, but it's what we need right now. Also there are plans to remove this entire code path in S, so the test being ad-hoc is not much of a problem. Test: this Bug: 158974172 Change-Id: I96f4bbb9b109e3e5813d083bed1989d88fb156b8 Merged-In: I3c4a94181bd71df68121fa0f71669fa4fa588bdd (cherry picked from commit dece7f3f)
Loading
Please register or sign in to comment