vsock_test has been flaky - the test in host would receive ECONNRESET
when reading from the client's vsock socket. This was due to the guest
exiting immediately after writing to the socket. This in turn terminated
crosvm, including the vhost-vsock backend, and reset the socket.
Fix this by having the guest wait for a reply from the host before
shutting down and explicitly shutting down the connection.
Bug: 238733740
Test: atest VirtualizationTestCases.64
Change-Id: I36c678f469fc3269902f5d8b1eb73cd431661ae6
Vsock test depends on two process groups running simultanously:
VirtManager+CrosVM and vsock_server. This was orchestrated by a Java
test runner running on the PC. With all the recent changes to the test,
it is now possible to run the former from AndroidTest.xml (and
eventually that will be completely removed) and convert vsock_server to
a GTest binary installed and invoked directly by TradeFed.
A common GTest class VirtualizationTest is added for hosting individual
test cases and sharing common code. Vsock test is converted to a single
TEST_F instance.
The test target is now called VirtualizationTestCases (dropped Host).
Bug: 181615964
Test: atest VirtualizationTestCases
Change-Id: I5a64d25ecc8f278250cfc3b196b8910ca8b8af52