summaryrefslogtreecommitdiff
path: root/tests/tun_interface.cpp
AgeCommit message (Collapse)Author
2020-05-29Add tap support to TunInterface.Lorenzo Colitti
This allows callers to create a tap interface instead of a tun. Also specify IFF_NO_PI in order to make it easier for users of this class to read data from the tun. No existing users actually check the data, so this is safe. Bug: 150736748 Test: atest netd_integration_test Change-Id: Ic2e46bb864978b969ae5c1b8c2bdc5379d298f5a
2020-02-01Merge "ClatdController & tests/tun_interface: change from /dev/tun to ↵Maciej Żenczykowski
/dev/net/tun"
2020-01-27ClatdController & tests/tun_interface: change from /dev/tun to /dev/net/tunMaciej Żenczykowski
(this is the upstream default location of the 'tun' special device) Test: build, atest Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ie834a16264dc1188aa9f3fb40cb5e0e5643737cc
2020-01-26add nodad=true to TunInterface::addAddress()Maciej Żenczykowski
This is presumed to maybe hopefully fix a race condition test failure in BinderTest#ClatdStartStop... Based on testing we go from 35 in 1000 failres to 0 in 1000. Test: build, atest Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I16eab409c39f5c9711d322c5df611f7bcb46c4c9
2019-10-18Fix an error propagation bug in tests/tun_interface.cppMaciej Żenczykowski
ifc_add_address() returns -errno on error, and doesn't necessarily set 'errno' (for example if error came in via netlink message). Test: builds Bug: 142764715 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I9151649785d7c3cc4316d0e35e9b83dfa0d5053e
2019-04-02netd tun tests - find(":") -> find(':')Maciej Żenczykowski
Resolves: system/netd/tests/tun_interface.cpp:148:19: warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [performance-faster-string-find] Test: builds Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I1e86cc386859b8a7c20c651d5efd25501dc45e53
2019-02-27Ensure that addresses have actually been created in TunInterface.Lorenzo Colitti
Currently TunInterface assumes that IP addresses are created immediately as soon as ifc_add_address returns. However, IPv6 addresses, even if created with IFA_F_NODAD or optimistic DAD, are not created immediately and are not actually usable when the netlink ACK returns. Ensure tests aren't flaky by waiting for RTM_NEWADDR for the address after creating it. Test: system/netd/tests/runtests.sh Change-Id: I5db5e25b24329ecbe953b592997b6c1358722c5c
2019-01-23Netd unsolicited event portingLuke Huang
Use another buffer to log unsolicited event. Test: built, flashed, booted Test: 1. manual test datacall/wifi work 2. manual test tethering work 3. run cts StrictModeTest pass 4. manual test data alert work 5. manual idletimer work Change-Id: I1e4ed360b0c9d60c14bc7f0ffdf578fc557d3643
2018-11-19Nat-related commands portingLuke Huang
Test: built, flashed, booted system/netd/tests/runtests.sh passes Change-Id: I14e80377bc1b7c08993c3cf8fbf2b6fd0f99f4ba
2018-09-11bandwidth-related commands portingLuke Huang
Test: built, flashed, booted system/netd/tests/runtests.sh passes Change-Id: I7db81136dfaa581d4257a05aad64059dc0cd7976
2018-07-25Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I226a0599db4f7c3557e55cade7869d00bd314949
2018-02-14Make TunInterface more useful.Lorenzo Colitti
- Support more than one TunInterface per process by adding some randomness to the interface name. - Export include files so it can be used from other directories. - Add a method to get the interface index. Bug: 73032258 Test: netd_unit_test passes, netd_integration_test has no new failures Change-Id: I0968cd394e18e51aec6b48f07ac626ba2496160f
2017-02-28Move createTunInterface to its own test file for use elsewhere.Lorenzo Colitti
Bug: 28362720 Test: test-only change. netd_{unit,integration}_test pass. Change-Id: I89f7c922ae8f8a550db58938dacff92390cc1d0f