The test will fail on T without an updated connectivity module, as it
uses new behavior implemented by a newer module version, such as
TestNetworkManager#createTapInterface(boolean, boolean).
Bug: 236558929
Change-Id: Ia74a31c8f7aabb4aae8eead5bba9f31cb7f2dd8d
Test: atest EthernetManagerTest
This is needed due to BpfLoader v0.18 supporting more
functionality and thus bpf code compilation by default using
larger structs than it did during S.
Bug: 218408035
Test: booted on cuttlefish, atest CtsNativeNetTestCases
OBSigned-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55
Maciej Żenczykowskicommited 2022-06-18 19:00:19 -07:00
Add unit tests for IKEv2 VPN setup and handling network change.
Bug: 192077544
Test: atest VpnTest (new tests)
Change-Id: Idd13a3ae57a521901c576bdd33ca0170e94be048
Adds an outcome receiver and wraps the EthernetManager#enableInterface
and EthernetManager#disableInterface APIs.
Test: m -- test only change
Change-Id: I7064edda3ebbdd91e2bf28651fdf85b9a7cf2134
A callback is expected to be sent on either success or failure when the
EthernetManager#updateConfiguration API is called.
Currently, if this API is called for an active interface and marked
restricted, after the IP provisioning process is started in
EthernetNetworkFactory, the interface will then processe all the
onNetworkUneeded requests for the newly restricted network. Assuming no
apps have requests for this particular network or restricted networks,
the network will be stopped once the outstanding network request count
reaches zero.
If provisioning hasn't completed yet for the original
updateConfiguration call, the original callback will be cleared out on
stop and will never notify the original caller of
EthernetManager#updateConfiguration whose call was aborted.
Bug: 235907515
Test: eth unit and cts tests
Change-Id: I91359272c07e090039049370ba9f438546fce3ad
This is not allowed and causes the test to fail. Instead of
deleting the test, skip it on user builds, so it will still run
on userdebug builds (e.g., in presubmit).
Fix: 233551762
Test: CtsHostsideNetworkTests:com.android.cts.net.HostsideLinkPropertiesGatingTests on flame-user
Merged-In: I8a64b86700d250d5871639772e9e0721d93cceba
Change-Id: I1d5fce58057456d4a335e2198325e79666348cef
Lorenzo Colitticommited 2022-06-15 06:42:03 +00:00
RateLimitTest is flaky on ADT-3; it slightly exceeds the limit when
limiting at 1MB/s.
This may be related to using a tun instead of a tap interface. After
adding the interface MAC address to TestNetworkInterface, this test
should be adapted to use a tap interface and properly account for burst
size in U.
Bug: 231495412
Test: atest RateLimitTest
Change-Id: I645267d7143c2364c93998eaa71502e2aa10b5a6
Revert "Make VPN more testable and update NC during network change"
Revert submission 2113906-mobike-ut
Reason for revert: b/235853154 Test files build failed on tm-mainline-prod
Reverted Changes:
I739016db1:Add unit tests for IKEv2 VPN setup and MOBIKE
Ic0f0c5496:Make VPN more testable and update NC during networ...
Change-Id: I9e8695078633822d3051aed27dcd617e0b8da6e5
The tests fail on user builds because they target T and attempt
to override the compat change, which is not allowed on user
builds because the change defaults to on for apps targeting T+.
Fix this by marking the tests max target SDK 31.
Also improve the tests a bit:
- Use a RuleChain to make it explicit that
CtsNetTestCasesMaxTargetSdk31 should be evaluated before
EnableCompatChanges (otherwise the compat change rule would
crash on user builds even if the max target SDK rule was going
to skip the test anyway).
- Fix the IgnoreUpTo for all exclude route tests to say S+.
Currently:
- One says R+, which is incorrect because the updated
LinkProperties code is in the connectivity module, which only
goes back to S, not R.
- The others say T+, which is incorrect because the update code
is present on S.
Fix: 233553525
Test: LinkProperties test in CtsNetTestCasesLatestSdk passes on T user build
Test: LinkProperties test in CtsNetTestCasesMaxTargetSdk31 passes on T user build
Change-Id: Ie0e2f6761b90a65813ed3610c7b5e930a9fdc982
Lorenzo Colitticommited 2022-06-13 02:01:35 +00:00
Add unit tests for IKEv2 VPN setup and handling network change.
Bug: 192077544
Test: atest VpnTest (new tests)
Change-Id: I739016db1b139b722b54c828fcc3babc5b1f14c4
Revert submission 2046446-tethering_entitlement_MTS
Reason for revert: This test never pass. Now tethering module release is blocked by MTS fail. TH don't catch this probably because b/234680138 cause this test don't actually run at the moment.
Reverted Changes:
Ica95c0d5b:Add a test BroadCastReceiver to receive carrier Co...
I5f758fe0c:[Tethering] Add MTS method to TetheringManagerTest...
Change-Id: I0d94debb5c573bd41617adb48d6e81ae7ff1a0da
LOCKDOWN_VPN was in the FirewallChain IntDef but this was not a right
place because LOCKDOWN_VPN was not a valid value for Connectivity APIs
that take an argument annotated with @FirewallChain(setUidFirewallRule,
setFirewallChainEnabled, replaceFirewallChain).
LOCKDOWN_VPN was in the FirewallChain IntDef because
BpfNetMaps#setUidRule was used to add/remove LOCKDOWN_VPN entries.
This commit adds BpfNetMaps#updateUidLockdownRule and uses this to
add/remove LOCKDOWN_VPN entries instead of BpfNetMaps#setUidRule and
removes LOCKDOWN from FirewallChain.
Bug: 206482423
Test: atest TrafficControllerTest ConnectivityServiceTest
PermissionMonitorTest HostsideVpnTests#testBlockIncomingPacket
Change-Id: Iff9b9792fc0f208f153e10e396c6d5034b412d7c
Marking the test as flaky while we work to identify the
root cause.
Also, for doze and appstandby related tests, we need
to enable the restriction everytime before starting
the activity. Add a TODO to update it.
Bug: 231440256
Test: atest tests/tests/app.usage/src/android/app/usage/cts/BroadcastResponseStatsTest.java
Change-Id: I97e8bdb6f3d0bd62bb98214ed0bf3cb0386bb21e
Merged-In: I97e8bdb6f3d0bd62bb98214ed0bf3cb0386bb21e
This change reverts aosp/1777887. The exception was used to get
the stack while the mMobileIfaces contains null interface, and
currently mMobileIfaces is protected by making it volatile so
it is fine to be removed.
Also, fix style error in NetworkStatsServiceTest
Test: build, FrameworksNetTests
Change-Id: I8435354f8cfd05589c0231f3bb8cbaa66c0525cf
Test if retry mechanism is working or not when there is a
recoverable Ikev2 error.
Bug: 229350078
Test: atest FrameworksNetTests:VpnTest
Change-Id: I5e881c6b42aeb98adce598587e2a7e49be7d9643
In internalGetSummaryForNetwork, the history object will not
include the latest bucket because of the logic in
NetworkStatsHistory#recordHistory would only include buckets
that atomically occur in the inclusive time range.
This makes querySummaryForDevice callers who are also sensitive
to the latest bucket fails.
This CL revert the behavior back to S, in T this is temporarily
changed after aosp/1937268.
Also, for test purpose, this CL change System.currentTimeMillis to
use mClock when querying.
Test: NetworkStatsServiceTest#testGetLatestSummary
Bug: 233733267
Change-Id: I55e2a5d953622b68da36a9b8d3e57c88d57543b0
Merged-In: I55e2a5d953622b68da36a9b8d3e57c88d57543b0
(pure cherry-picked from ag/18670248)
This CL adds unit test to test onThresholdReached event
would unregister and re-register usage callback.
Test: MultipathPolicyTrackerTest#testOnThresholdReached
Bug: 233733267
Change-Id: I6e43ae93055009d91b0795a4466f2c02f4403c0a
Merged-In: I6e43ae93055009d91b0795a4466f2c02f4403c0a
(pure cherry-picked from ag/18579049)
NetworkStatsHistory internally assumes that bucketStart is
sorted at all times. However, in the fields, we've found there
are some buckets of NetworkStatsHistory do not preserve the
order of timestamp, which is caught by the IAE when addEntry
is called.
In order to provide backward compatibility, return sorted items
instead of throwing IAE when adding entry into
NetworkStatsHistory instance.
Test: atest android.net.netstats.NetworkStatsHistoryTest#testBuilder
Bug: 233825704
Change-Id: If3187384bd1e90770ca5873b8ec73e852fff543d
Merged-In: If3187384bd1e90770ca5873b8ec73e852fff543d
(pure cherry-picked from ag/18581718)
In current design, the interface will be removed from the list if
the network disconnected which will cause getUidStatsForTransport()
returns unexpected snapshot to caller since the list is empty.
This change also remove interface name from all entries before
the method returns the result.
Bug: 231514741
Test: FrameworksNetTests
manual test
Change-Id: Ie60829a65d0d9b5b63ad353695a820c0586e3665
Merged-In: Ie60829a65d0d9b5b63ad353695a820c0586e3665