Dup fds to stop finalizers from invalidating them.
The hostside VPN tests were failing because finalizers were
closing the ParcelFileDescriptors that we use to get socekt fds.
The close operations were causing the fds to be marked as invalid
(i.e., -1), causing the tests' system calls on them to fail with
EBADF.
Fix this by dup(2)ing the fds and closing the original objects.
Also, add some asserts to debug this sort of failure.
Fix: 35927643
Test: HostsideVpnTests passed 20/20 times on bullhead
Change-Id: If88530b5bd32622bd4726cd6f0907f731209bb43
(cherry picked from commit a7ec8300d98e92c1363303f7f103bf0787d13a27)
2 files changed
tree: a80a232f481238f0aa570498c767f32671d826a1
- tests/