add AppModeFull@ to DnsResolverTest since WRITE_SECURE_SETTINGS
could not be ganted in instant mode.
Bug: 134897744
Test: atest DnsResolverTest
atest DnsResolverTest --instant
Change-Id: I267c19af1a1c5544ca752a364335ec728a478bb2
(cherry picked from commit 2af244f4127883ed967089f550f2cfe07936416d)
Temporary fix, this is still brittle to certificate changes
on the test host.
Bug: 134532880
Test: atest android.net.cts.SSLCertificateSocketFactoryTest
Change-Id: I6e8c8757963ef46009767925bfa512127d9daba7
Merged-In: I6e8c8757963ef46009767925bfa512127d9daba7
(cherry picked from commit 166e7121b173f2a4e3d6a9ded213e4c8679a9cfb)
This test fails on devices with headless user 0 when it tries to
verify apps with android:sharedUserId="android.uid.system" (and without
explicit ask for NETWORK_SETTINGS). Such apps get this permission
by default, but when running on user 1 they get UID 1001000, what doesn't
match SYSTEM_UID=1000.
By the chance of modifying this code, let's also add more verbose error
message (with UID), simplify it and reduce indentation count.
Bug: 120143468
Test: atest android.net.wifi.cts.WifiManagerTest#testNetworkSettingsPermission
Change-Id: Ifc09320cf738a518003126fad1ce31f5e38a3aff
This commit removes the mContext from IpSecBaseTest, and replaces it
with InstrumentationRegistry.getContext().
Bug: 72950854
Test: Ran on devices, passing.
Merged-In: If6fa359825aa9d1f7d4c8d49aba7a34925c073ed
Change-Id: If6fa359825aa9d1f7d4c8d49aba7a34925c073ed
(cherry picked from commit 69760fb5b62ae0e36c2a88bb20502dead3d7589b)
This commit adds tests that reflect outgoing packets, flipping the outer
src/dst headers to avoid the need to tear down and rebuild the outer
TUN.
This allows us to at least test that our implementation can interoperate
with itself.
Bug: 72950854
Test: this, passing
Merged-In: Ia969f78f4c1a0c0a017f5aad425a68852ff4433a
Change-Id: Ia969f78f4c1a0c0a017f5aad425a68852ff4433a
(cherry picked from commit 144937f3df37ee0b1d5484f10e8c86a8a70a9cb5)
This commit addresses comments from aosp/963067 and aosp/959617.
No behavioral/functional changes were made, only renames and minor style
nits addressed.
Bug: 72950854
Test: Ran on devices, working
Merged-In: I1702b91e245412f0142e9e47b7fb373b9b4e8126
Change-Id: I1702b91e245412f0142e9e47b7fb373b9b4e8126
(cherry picked from commit 68237a11f9532ca6c59d579adb374fe40b0b3bee)
1. add test case for testing bypass Private DNS
2. add null network test
3. minor change for cleanup
Bug: 130594022
Test: atest DnsResolverTest
Merged-In: I8dd48f11baf92d953ded237204a3c2cd3b58581d
(cherry picked from commit da665a0a78a2919c3e2edabafec463de3de9ddb7)
Change-Id: Iabb100c51fd80eca5ab0284bc891f4fb98492e8b
If kernel < 4.8 then it doesn't support get socket option
TCP_REPAIR_WINDOW, thus TCP keepalive cannot be supported.
However, it might still support NAT-T keepalive. Test TCP
keepalive only if it is supported by kernel.
Bug: 133652079
Test: atest android.net.cts.ConnectivityManagerTest#testMajorMinorVersionCompare \
android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimit \
android.net.cts.ConnectivityManagerTest#testSocketKeepaliveUnprivileged \
android.net.cts.ConnectivityManagerTest#testKeepaliveUnsupported \
android.net.cts.ConnectivityManagerTest#testCreateTcpKeepalive
Change-Id: I0a3ff07c482bb7c8cb05663678c10afcc0500861
Merged-In: I3f8456deea2b4ded762a413c8e27b58ce54ce0aa
(cherry picked from commit 57d91e6276b50bf0dd78f3643c4a979f584fcf38)
1. All ConnectivityManagerApi23Test were failed due to
WifiManager#setWifiEnabled doesn't allow to use since
Android Q. So we need to use shell command to enable/disable
Wi-Fi instead.
2. Some methods are duplicated between
ConnectivityManagerApi23Test and ConnectivityManagerTest, but
they are not identical. So put these methods into
ConnectivityUtils to clean up duplications and prevent fork
happened again.
Bug: 133334943
Bug: 133209319
Test: Run the below tests on Crosshatch, Sailfish, Bonito.
atest CtsNetApi23TestCases
atest CtsNetTestCases
Change-Id: Ic37111cb12a46f5c36c2be887250c5d762216f6e
Test runner will crash while tring to get test network service
in IpSecManagerTunnelTest. Because MANAGE_TEST_NETWORKS
permission can't be granted to instant apps. So ignore all tests
in this file.
Bug: 133399750
Test: atest CtsNetTestCases --instant
Change-Id: I31b7e12a5a0021185851ba4435a6c42d457f34b6
Merged-In: Ia18c6bfe791692f8835b127adf734ce3d2a4ba95
Merged-In: I697333a7a64d794208d80112bdc1d1e50c5d2b56
Merged-In: I31b7e12a5a0021185851ba4435a6c42d457f34b6
(cherry picked from commit eb29c90465)
Avoids relying on external storage and using the hardcoded /sdcard/ path.
Unrooted adb does not have access to non-user 0 sdcard paths, and so the "cp"
command fails when the test runs in user 10.
Fixes: 121400865
Test: cts-tradefed run cts-dev -m CtsNetTestCases -t android.net.cts.NetworkWatchlistTest#testGetWatchlistConfigHash in user 10.
Change-Id: Idc667072bcfbbe159416fa7c7b6b19045b52041d
1. Indicating CtsNetTestCases support instant app mode but
ignore some tests that cannot run in instant app mode.
2. Move some tests which need to test on API 23 into
CtsNetApi23TestCases module due to instant app package
must target at least API 26.
Bug: 123366918
Test: atest CtsNetTestCases --instant
Test: atest CtsNetApi23TestCases
Test: atest FrameworksNetTests
Change-Id: I4e828cbc48143e36c1be38b91c3c698122d4be5a
Fixes two potentially device/kernel specific, or flaky bugs:
1. Java interface checking by name seems to cache the lookup, resulting
in interface address checks occasionally failing (on delete).
2. Link-local addresses appear to be added on all links for some set of
kernels and devices.
This patch addresses both by only checking that the requested address
was added via a address-based NetworkInterface lookup.
Bug: 72950854
Test: Ran on sargo-eng on qt-dev/HEAD
Test: Manually verified that the addresses are indeed added/removed
Change-Id: I3babc72dfe72337c4d68facb1695aec15e504c90
Currently, unprivileged Nat-T keepalives are limited to 1 slot
per uid. Add CTS to verify that the keepalive slots are limited
as customized for unprivileged requests.
Bug: 129371366
Test: atest android.net.cts
.ConnectivityManagerTest#testSocketKeepaliveUnprivileged
--generate-new-metrics 10
(Clean cherry-pick of aosp/957205)
Change-Id: I60b9e9ae9cf2b63490493ced9738cd2f402c3f9b
Merged-In: I60b9e9ae9cf2b63490493ced9738cd2f402c3f9b
Per SDK requirement, OEM is required to support minimum number of
concurrent keepalives. Implement CTS to verify this.
Bug: 129371366
Test: atest android.net.cts
.ConnectivityManagerTest#testSocketKeepaliveLimit
--generate-new-metrics 10
(Clean cherry-pick of aosp/937026)
Change-Id: I8be89116bed5c4dedb2ca42b6d633aa9e8c6a49a
Merged-In: I8be89116bed5c4dedb2ca42b6d633aa9e8c6a49a
This patch fixes an incompatibility where some tests in the same
hierarchy were using Junit3, and other Junit4
No functional test changes made
Bug: 72950854
Test: Ran on devices, working
Change-Id: I79d231e202ba25ad5f57b44b387bebd7f012aa95
This commit adds a second condition to whether the device is expected to
have the tunnel mode feature. If a device's first API/launch version is
Q or above, require IPsec tunnels
Bug: 72950854
Test: Ran on device with first API level < Q and == Q.
Merged-In: I545444bb483b0f5de45d00a07dc45aeb9e9cbdf7
Change-Id: I7b849ad24a04b6b7899a80f1856236b5ceb5a839
(cherry picked from commit d2465991d9)
This change adds single-direction tests for the IPsec Tunnel Mode API.
In the outbound direction, TUNs are used to capture outgoing packets,
and values are inspected. In the inbound direction, packets are built
manually, using the PacketUtils framework. Additional testing for
end-to-end integration tests will follow in aosp/941021 using packet
reflection via the TUN.
Bug: 72950854
Test: This; passing
Change-Id: Ic4181fc857fa880db5553314efa914f870dbe87c
Merged-In: Ic4181fc857fa880db5553314efa914f870dbe87c
(cherry picked from commit d708a4c217f13c9028427d98031394f0933482bf)
This change adds utility methods to generate packets incrementally. It
supports UDP, ESP, IPv4, IPv6 packet generation.
For ESP, it exclusively does AES-CBC, HMAC-SHA256.
Bug: 72950854
Test: This
Change-Id: Icffeed2ebb2005d79faf04f48fd5126d1d6fb175
Merged-In: Icffeed2ebb2005d79faf04f48fd5126d1d6fb175
(cherry picked from commit 0e4743d56553d698ac45ae548f31019ea6e91541)
This patch adds a TunUtils class, allowing for packet capture over a TUN
interface, inspection of some basic header fields, and reflection of
packets with flipped src/dst headers.
Bug: 72950854
Test: Ran, passing
Change-Id: I9fdba4a905886c7a4820d86ef52c0cc1843215b2
Merged-In: I9fdba4a905886c7a4820d86ef52c0cc1843215b2
(cherry picked from commit 2f07cd8551d755a4076e94b9e620bc446a66bf54)
If tunnel feature does is not present, skip tests.
Bug: 117183273
Test: This
Change-Id: I62fcc2cbca8bf3d2b70da5646303a7059a0df663
Merged-In: I62fcc2cbca8bf3d2b70da5646303a7059a0df663
(cherry picked from commit 698c99fcf03a4e1afb028ac66852140762a7f2b1)
Set app_idle_constants in NetPolicyTestsPreparer is not always successful(suspect timing issue).
Set app_idle_constants in AbstractRestrictBackgroundNetworkTestCase again to make sure.
Bug: 115393390
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testAppIdleMetered_whenCharging
Change-Id: I41148bc7eea0825537133f0471ceefeb5b05d763
These are not multi-ABI because the behaviour does not depend on
the ABI of the app. Some of the APIs are ultimately backed by JNI
code in the system server, but that only depends on the system
server's ABI, not the app's.
Enable instant mode because these applications are subject to the
same network restrictions as other apps.
Fix: 123364589
Test: atest CtsHostsideNetworkTests
Test: cts-tradefed run commandAndExit cts --enable-parameterized-modules --module-parameter instant_app -m CtsHostsideNetworkTests
Change-Id: Ib3c4cd365ffe95889d51a236f035ea84516f0abd
(cherry picked from commit ad17ee9e92)
There is use cases in NFC that need this permission.
Bug:131195124
Test: Cts pass after NFC app add NETWORK_SETTINGS permission
Change-Id: Iec5a08721da43767cfd0ced51e73a1b757b0d97a
...so this does not happen again.
This is a test for the fix in Ic91660d974dce21f2affdcacaeffe9accf8451ac
Bug: 1866121
Test: This
Change-Id: Ib7ee866f65baf99b46a31e2115355a42a829421e
(cherry picked from commit d60c09fd4db5deb81900af5208cc9306e2f77b3b)
Merged-In: Iba7ed3fe8cb23d7d14a29f2259a08e9c833db146
Merged-In: I10882b8d9a62766acfff6ec18afb3d813c631fd3
(cherry picked from commit d1008aa730)
Tests cover scenarios related to whether VPN has explicitly declared its
underlying networks plus whether it is an always metered VPN.
For each of these scenarios, we ensure VPN meteredness based on its
capabilities and ConnectivityManager#isActiveNetworkMetered matches.
Bug: 123727651
Test: atest HostsideVpnTests
Change-Id: I2dea70c1c432d05b1a22c945f1e3e17166e4132d
Merged-In: I3030e5468a55bbc32be2a753f098dcf7f0256af8
am: b54262d012 -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3a984ca812 is in history
Change-Id: Ib19798ab58a3a6c033706aed4a712fc93a93ed13
am: 151652e818 -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3a984ca812 is in history
Change-Id: I7e7e774bcfe3e6e103b4bcf71a41e944f9012d32
am: c3f02ab985 -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3a984ca812 is in history
Change-Id: I487838837d6d205831af7f38aed7a06e15cd9190
am: 57a0d8740c -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3a984ca812 is in history
Change-Id: I85522db22dc64a1bae8750e90dd582758f4c1278
am: ea06420fed -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3852fd92f5 is in history
Change-Id: I11e54158235688c4d77ebea3a1d6137d3660bac7