Refactor testCreateTransform and add IPv6 and encap coverage.
Currently, testCreateTransform only tests IPv4 transport mode.
Add support for IPv6 transport mode and IPv4 transport mode with
UDP encap.
Also use a try-with-resources to free the SPI and the transform
instead of relying on explicit close() calls. This requires
factoring out the code that creates the transform to a helper
method because try-with-resources blocks can only contain
assignments and not code.
Bug: 259001350
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.IpSecManagerTest
Change-Id: I96107996ea0ac573460d0242d82c6706df192d24
1 file changed