Commit Graph

8285 Commits

Author SHA1 Message Date
Chiachang Wang
4d2791b1a6 Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Merged-In: I4f827664c528bea30cc957a0a617dd37693f4460
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-16 01:57:46 +00:00
Aaron Huang
32f8a56636 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev 2020-06-12 01:58:59 +00:00
TreeHugger Robot
ab6c4a7685 Merge "Fix original-package support" into rvc-dev 2020-06-10 20:51:39 +00:00
Winson
af8399a682 Fix original-package support
This broke in P. Basic support was broken by a simple negation
issue with the logic that checks for the original package.

That, along with the suggestion in the bug to fix the renamed
package association means this should now work as expected,
carrying data over from a previous installed, differently named
package.

Bug: 131355130
Bug: 132749720
Bug: 111967720

Test: atest PackageManagerServiceHostTests

Change-Id: Ifc4c7af47c4b633cd27ba4a40b6baa0e27960d71
2020-06-10 10:34:43 -07:00
Lorenzo Colitti
50440f899e Merge "Update extra info before registering" into rvc-dev 2020-06-10 15:17:38 +00:00
Aaron Huang
e4e86e1cad Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-09 00:40:36 +08:00
Chiachang Wang
be7265d261 Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Merged-In: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-05 01:46:06 +00:00
JW Wang
864d59ed70 Clean up rollbacks and test apps
See comment#6.

Clean up rollbacks and test apps before and after running tests.
This ensure we are in a good and expected condition when running tests.

Bug: 154080003
Test: atest RollbackTest
Test: atest MultiUserRollbackTest
Test: atest NetworkStagedRollbackTest
Test: atest StagedRollbackTest

Change-Id: If10fc8865e644611f1cf6a9db9d6dca6c7f11aee
2020-06-04 14:45:11 +08:00
Gavin Corkery
ac7b17b98d Unbind explicit health check controller when possible
Ensure that calls to sync requests with the explicit health
check controller are always sent if the list of packages
pending health checks is empty, so that the controller can
unbind. This will allow extservices to be killed by lmkd
on low memory devices.

Test: atest PackageWatchdogTest
Test: atest NetworkStagedRollbackTest
Test: check logcat to see that the service is unbound
Bug: 156323728
Change-Id: If615a337760b2057b962284bde8565b593d82a50
2020-06-01 23:11:07 +01:00
JW Wang
be052c6abe Merge "Add tests for snapshot-deletion (2/n)" into rvc-dev 2020-05-30 13:17:56 +00:00
Benedict Wong
c5401ef015 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev 2020-05-29 17:17:10 +00:00
Gavin Corkery
4f5af837be Merge "Revert "Ensure that health check controller is unbound correctly"" into rvc-dev 2020-05-29 12:02:55 +00:00
Gavin Corkery
64201f9d9c Revert "Ensure that health check controller is unbound correctly"
This reverts commit 553c94bcab.

Reason for revert: Breaks NetworkStagedRollbackTest. Will re-submit change once I have a fix for that issue
Bug: 157662759
Change-Id: If81c01c597f37ff01924c8b038cbd38f77e7fa06
2020-05-29 10:25:35 +00:00
JW Wang
e90db5aba3 Add tests for snapshot-deletion (2/n)
1. Document behavior changes due to ag/11475396
2. Test snapshots are deleted after restoration

See go/rollbackmanager-snapshot-deletion for more details.

Bug: 151805360
Test: atest StagedRollbackTest

Change-Id: Ia8993f82073a145889243bcefc74b6336bf71749
2020-05-29 15:49:54 +08:00
Automerger Merge Worker
891ee84b99 Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: Ia9797bb93aa4ff89147a77823d342dc22aec6a25
Merged-In: I69f7a2971cc5985d0f0078aecc39d4d6a6130033
(cherry-picked from aosp/1311654)
2020-05-29 02:28:59 +00:00
Benedict Wong
29d6412115 Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
Merged-In: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
(cherry picked from commit e84a17dd17)
2020-05-28 19:07:29 -07:00
Maciej Żenczykowski
b2603a3193 NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
This should no longer be needed after all the cleanups.

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I289d935f84b616ed857ef4c5a7427d57c282d00c
Merged-In: I289d935f84b616ed857ef4c5a7427d57c282d00c
2020-05-28 02:44:20 -07:00
Maciej Żenczykowski
d09cef39c5 NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b
Merged-In: I0121a4ac7ee824adc5930bab786d550b2f00b05b
2020-05-28 02:44:10 -07:00
Maciej Żenczykowski
e07aa4a466 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

(so just copy over the rx stats from the before file)

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3
Merged-In: Ie73ba0586dafde67bc2726db26e07f7268c18be3
2020-05-28 02:44:02 -07:00
Maciej Żenczykowski
c9e6605320 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5
Merged-In: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5
2020-05-28 02:43:53 -07:00
Maciej Żenczykowski
68d998de26 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifebd946e06b5fa2eeb7ff4fc0b1c423097021692
Merged-In: Ifebd946e06b5fa2eeb7ff4fc0b1c423097021692
2020-05-28 02:43:44 -07:00
Maciej Żenczykowski
6affb9bb01 fix android.net.NetworkStatsTest#testApply464xlatAdjustments
Test: atest NetworkStatsTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib12ee88295eb502f6da13d212b4fd6298dea380f
Merged-In: Ib12ee88295eb502f6da13d212b4fd6298dea380f
2020-05-28 02:43:33 -07:00
Sudheer Shanka
7e24d133d0 Merge "Don't allow expired blobs to be accessed." into rvc-dev 2020-05-27 20:10:04 +00:00
Sudheer Shanka
8992c0514f Don't allow expired blobs to be accessed.
Bug: 147722548
Test: atest --test-mapping apex/blobstore
Change-Id: I7294124ba5ce3dcf42a0e7e9858311b1604ae185
2020-05-27 11:41:34 -07:00
Benedict Wong
8f29769362 Merge "Add methods for IKEv2/IPsec test mode profiles" into rvc-dev 2020-05-27 17:31:00 +00:00
Gavin Corkery
6a459b2b35 Merge "Ensure that health check controller is unbound correctly" into rvc-dev 2020-05-27 16:08:13 +00:00
Gavin Corkery
553c94bcab Ensure that health check controller is unbound correctly
Explicitly call into the health check controller if there are
no more packages to check. This is due to the fact that
the ExplicitHealthCheckController will unbind itself in this
case. If this call is not made, the controller will continue
running in the foreground and will not be killed by lmkd.

Test: atest PackageWatchdogTest
Test: check logcat to see that the service is unbound
Bug: 156323728
Change-Id: I0044d0832178ee90043d5e64e406df07ee2c36a2
2020-05-27 13:16:52 +01:00
Sudheer Shanka
61a459d77a Merge "Update a couple of blobstore params to be configurable." into rvc-dev 2020-05-26 23:54:33 +00:00
Sudheer Shanka
90ac4a69db Update a couple of blobstore params to be configurable.
Instead of hardcoding values for IDLE_JOB_PERIOD_MS and
SESSION_EXPIRY_TIMEOUT_MS, make them configurable.

Bug: 157503601
Test: atest --test-mapping apex/blobstore
Change-Id: I4846a98144224873444d4d73b2bedde258992ac4
2020-05-26 15:02:00 -07:00
TreeHugger Robot
12416fba4a Merge "AppLaunch: Run trial more times to tolerate possible failure in prefetto tracing." into rvc-dev 2020-05-26 18:45:12 +00:00
Lorenzo Colitti
7f7171c6a1 Inform the DNS resolver when it needs to do DNS64 synthesis.
This is only necessary when learning the NAT64 prefix from the
RA, because if the NAT64 prefix is learned from DNS, the DNS
resolver already knows the prefix and automatically enables
DNS64 synthesis.

The DNS resolver needs to be informed of the prefix any time
clat is running on a prefix learned from an RA. This is simple to
implement: just set the prefix when starting clat if prefix
discovery is not running, and clear the prefix when stopping clat
if prefix discovery was not running. This ensures that the prefix
is cleared iff it was set.

Bug: 156914456
Test: new unit test coverage
Original-Change: https://android-review.googlesource.com/1315578
Merged-In: If8ad2d30712a6df3e207c8d3e8a129705242191e
Change-Id: If8ad2d30712a6df3e207c8d3e8a129705242191e
2020-05-26 11:52:35 +00:00
Lorenzo Colitti
fbf205a380 Test that if an RA sets the same prefix as DNS, nothing happens.
This is not particularly likely to happen unless the pref64 RA is
sent by a different router than the main RA. But more tests are
always good, and this additional coverage will be more useful
in an upcoming change.

Bug: 150648313
Test: test-only change
Original-Change: https://android-review.googlesource.com/1316094
Merged-In: I3316d49d42100800740afadc4edf0a13a4d8377c
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c
2020-05-26 11:35:33 +00:00
Chalard Jean
4f94389c6d Merge "Address nit from aosp/1301317" into rvc-dev 2020-05-21 06:44:30 +00:00
Chalard Jean
9941ef7930 Merge "Fix a bug where VPNs start out suspended on cellular" into rvc-dev 2020-05-21 06:43:56 +00:00
Treehugger Robot
cbb1fd0a7b Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1307374
Merged-In: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-21 05:12:41 +00:00
Chalard Jean
8e53c79556 Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1301317
Merged-In: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
2020-05-21 05:10:37 +00:00
Chalard Jean
fe5e23f8a4 Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1305393
Merged-In: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
2020-05-21 05:09:15 +00:00
Yan Wang
61506d06bc AppLaunch: Run trial more times to tolerate possible failure in prefetto
tracing.

Bug: 156039247
Test: forrest runs
Change-Id: I152bca5d7ac2970894ae4147bcfeb88eaf4ed641
2020-05-21 01:18:35 +00:00
Benedict Wong
c13b6f0b03 Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f
Merged-In: I2511b39b27a1e29ae97907cdb12728d13fb1628f
(cherry picked from commit 9e18eeb4a6)
2020-05-16 00:15:14 +00:00
Hall Liu
1d932772a1 Merge "Add method to remove test from tracked loopers" into rvc-dev 2020-05-15 22:09:13 +00:00
TreeHugger Robot
71c1cb3e18 Merge "Add a test to check unusual home activities" into rvc-dev 2020-05-15 17:28:24 +00:00
Isaac Chen
c8607a3a5b Add a test to check unusual home activities
Framework's SystemUserHome and Shell's NullHome activities have no real
Home function and should only be used in bootable CSI products. They
should not exist or be enabled on normal products.

This test can help to find if they exist in the system without needing
to find them via Settings manually.

Bug: 149307007
Bug: 149780604
Bug: 154723738
Test: # On aosp_crosshatch with Shell's NullHome activity
      $ atest NullHomeTest
      ...
      arm64-v8a NullHomeTest
      ----------------------
      com.android.test.nullhome (1 Test)
      [1/1] com.android.test.nullhome.NullHomeTest#checkNullHome: FAILED (127ms)
      # On aosp_crosshatch without Shell's NullHome activity
      $ atest NullHomeTest
      ...
      arm64-v8a NullHomeTest
      ----------------------
      com.android.test.nullhome (1 Test)
      [1/1] com.android.test.nullhome.NullHomeTest#checkNullHome: PASSED (2ms)
Change-Id: I6f190ae33fc9e724adc0e53d07107e9a1ae0291f
2020-05-15 18:42:05 +08:00
TreeHugger Robot
54dd86ac12 Merge "Make sure uibench test app load list content" into rvc-dev 2020-05-15 06:51:26 +00:00
Cody Kesting
3fdb1831a4 Merge "Set owner and administrator UIDs for test networks." into rvc-dev 2020-05-14 18:56:16 +00:00
Riddle Hsu
3b0ceec95b Make sure uibench test app load list content
If the test app is relaunched by configuration change (e.g. the
testing device is put in landscape), the fragment will be kept
but its content needs to reload. Otherwise it will show a loading
animation that causes unexpected frame count.

This change makes ShadowGridActivity, ClippedListActivity,
MainActivity inherit CompatListActivity that sets new list adapter
to the existing fragment. So the list can show correct content.

Bug: 156473870
Test: atest UiBenchJankTests
Change-Id: Ie608baa7362642554c014f805c797d09f4cf3117
2020-05-14 20:44:19 +08:00
Hall Liu
a853b23c0e Add method to remove test from tracked loopers
Add method to remove a test from the sLoopers map, since keeping them
around forever results in a memory leak for large test suites.

Bug: 156287358
Test: atest FrameworksTelephonyTests
Change-Id: I553ea3a1dac3ff4107e0c7caabee26d21f4c52f8
2020-05-14 01:43:16 +00:00
Remi NGUYEN VAN
f20a14a0d3 Use the new NetworkStackConnector constructor
The constructor was changed to allow for unit tests.

Bug: 137328719
Test: atest FrameworksNetIntegrationTests
Original-Change: https://android-review.googlesource.com/1295360
Merged-In: I46f247268310e12d420531745a22e93cf3550e89
Change-Id: I46f247268310e12d420531745a22e93cf3550e89
2020-05-13 09:18:52 +00:00
Cody Kesting
0d8d6acd5b Set owner and administrator UIDs for test networks.
This change sets the owner and administrator UIDs for test networks when
their initial values match the UID for the app creating the test
network. This ensures that apps registering test networks can only make
themselves owners / administrators of the network.

Bug: 153449964
Test: atest NetworkAgentTest
Change-Id: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
Merged-In: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
(cherry picked from commit 35782280a2)
2020-05-12 20:33:42 +00:00
TreeHugger Robot
0cd6d1cb70 Merge changes I37dd459d,I1959f308 into rvc-dev
* changes:
  Add tests for Tunnel, Transport mode application with released SPIs
  Use TransformRecord to get SPI instead of SpiRecord
2020-05-12 20:30:03 +00:00
Charles Chen
5681f3e796 Merge "Add WindowMetricsHelper" into rvc-dev 2020-05-11 10:17:37 +00:00