Commit graph android_packages_modules_Co.../tests/net/java/com/android
Message SHA1
Merge "Test that if an RA sets the same prefix as DNS, nothing happens."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-05-24 10:59:40 +00:00
eafdd034f8
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
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c

Lorenzo Colitti   commited 2020-05-21 17:26:00 +09:00
16b28e2b22
Merge "Suppress deprecation warnings in LegacyTypeTrackerTest."
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-21 07:47:45 +00:00
8d55b55f60
Suppress deprecation warnings in LegacyTypeTrackerTest.
This saves dozens of warnings every time FrameworkNetTests is
compiled. There is nothing we can do about those warnings because
LegacyTypeTracker's reason for existence is to power deprecated
APIs.

Test: m FrameworksNetTests
Change-Id: I4d65b0aade493e12b56a94247efbf9d1ad7bb4b9

Lorenzo Colitti   commited 2020-05-20 20:53:16 +09:00
84f1909fb1
Merge "Address nit from aosp/1301317"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-15 06:43:42 +00:00
1894a79964
Merge "Add methods for IKEv2/IPsec test mode profiles"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-05-15 02:18:02 +00:00
56b98b0206
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

Benedict Wong   commited 2020-05-12 22:55:55 -07:00
0d7bed76cb
Merge "Set owner and administrator UIDs for test networks."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-05-12 16:52:07 +00:00
2ba1b8ecd1
Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5

Chalard Jean   commited 2020-05-11 13:25:16 +09:00
4f8109f638
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
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec

Chalard Jean   commited 2020-05-11 10:44:50 +09:00
fbd6a2c012
Merge "Fix a bug where a spurious capabilities callback is sent."
Chalard Jean   authored and   Gerrit Code Review   commited 2020-05-08 00:49:33 +00:00
0d4995dcb7
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
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249

Chalard Jean   commited 2020-05-07 12:07:03 +09:00
d568791283
[SM10] Adopt helper class to monitor RAT type change per sub
Test: atest NetworkStatsServiceTest
Bug: 146415925
Change-Id: I45c3aa9046b316c8cd0943543d620a22e4afefd1
Merged-In: I45c3aa9046b316c8cd0943543d620a22e4afefd1
(cherry picked from commit 219faff07bdc58c14fe58fc525e86383db1f8167)

junyulai   commited 2020-05-05 18:37:29 +08:00
d33735c952
Filter debug entries for each vpn
NetworkStats calculation needs to filter out debug entries to
prevent over counting. While NetworkStatsFactory migrates data
usage over a VPN to the TUN network, NetworkStatsFactory does
not filter out debug entries per vpn which will cause debug
entries left and cause exception.

Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
      and verify no exception
Change-Id: I3525edc385b07858b48c7add2d331c4b5a2e84ad

Chiachang Wang   commited 2020-04-29 15:07:45 +08:00
1d5c290e38
Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811

Chiachang Wang   commited 2020-04-29 13:44:50 +08:00
88fa813bd7
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

Cody Kesting   commited 2020-04-27 20:54:57 -07:00
fc7cad313d
Merge "Add tests for Tunnel, Transport mode application with released SPIs"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-04-24 22:32:41 +00:00
27a2f1dff8
Merge "Use TransformRecord to get SPI instead of SpiRecord"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-04-24 22:32:41 +00:00
88c8a19311
Merge "Address comments on NetworkStack AIDL v6"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-04-24 11:56:32 +00:00
0e93810453
Address comments on NetworkStack AIDL v6
Address issues found during AIDL review:
 - Rename clientAddr to singleClientAddr
 - Do not use a ParcelableBundle for notifyNetworkTested or
   notifyDataStallSuspected; instead use AIDL parcelables for stronger
   backwards compatibility guarantees.

Test: atest NetworkMonitorTest ConnectivityServiceTest
      ConnectivityServiceIntegrationTest, manual
Bug: 153500847
Change-Id: Id9b71784e5f6294d203230e57737979e063ff0f8

Remi NGUYEN VAN   commited 2020-04-24 18:52:02 +09:00
9b647ca69a
Set attributionTag for noteOp(WRITE_SETTINGS) calls
Test: atest FrameworksNetTests TetheringTests:TetheringServiceTest
Bug: 136595429
Merged-In: I33f787644c44d7b0e5ce17a433820cfcd985cdfb
Change-Id: Ic3d937e7bb5141798234ed5b2852c1f768e97495

Philip P. Moltmann   commited 2020-04-20 18:00:03 -07:00
7bc33dfb89
Stop prefix discovery if an RA prefix arrives in DISCOVERING
Currently, if a prefix is learned from an RA while prefix
discovery is running, clatd will be correctly started, but
prefix discovery will be stopped.

In order to fix this, make it possible to call
stopPrefixDiscovery without transitioning to IDLE state (which
is obviously necessary in this case), by moving the assignment of
the next state from that method to its callers. For consistency,
do the same for startPrefixDiscovery.

Bug: 150648313
Test: new test coverage
Change-Id: I3803fa3d9806848b331c35ee8bac256934bd1f21

Lorenzo Colitti   commited 2020-04-20 17:54:20 +09:00
38c6519a90
Make the Nat464Xlat tests more realistic.
464xlat will never be started on a network that is not connected,
or on a network that has no IPv6 address.

This is a no-op test-only change but it is necessary for an
upcoming change that violates some of the invalid assumptions
currently made by this test and causes it to fail.

Bug: 150648313
Test: test-only change
Change-Id: I41766e9adaa7c24454648b371e6e3cc647693be5

Lorenzo Colitti   commited 2020-04-20 17:54:20 +09:00
c6bd5847c9
Support learning the NAT64 prefix from two different sources.
The NAT64 prefix from the RA always takes precedence over the
NAT64 prefix from DNS discovery, because it is detected faster,
and detecting it does not require sending any packets.

Bug: 150648313
Test: new unit test
Change-Id: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902

Lorenzo Colitti   commited 2020-04-20 16:50:53 +09:00
e2eade021a
Merge "Add testTransportTypesEqual to dnsmanager test cases"
Bruce Chen   authored and   Gerrit Code Review   commited 2020-04-17 02:59:15 +00:00
0e97073a4d
Merge "[SP27.3] Rename TestableNetworkStatsProvider"
Junyu Lai   authored and   Gerrit Code Review   commited 2020-04-17 02:24:55 +00:00
9151f7c748
Merge "Support changing the NAT64 prefix without removing it."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-04-16 16:24:57 +00:00
f09bc1734f
Add testTransportTypesEqual to dnsmanager test cases
A test that ensures that NetworkCapabilities.TRANSPORT_* is eaual
to IDnsResolver.TRANSPORT_* for every possible value of each.

Bug: 153267602
Test: atest FrameworksNetTests
Change-Id: I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417

chenbruce   commited 2020-04-16 18:04:16 +08:00
01950be123
Support changing the NAT64 prefix without removing it.
This cannot (currently) happen with DNS64 detection, but it can
happen with the PREF64 option.

Bug: 150648313
Test: atest ConnectivityServiceTest Nat464XlatTest --rerun-until-failure 100
Change-Id: I789fe9d46d3ac5d074ae697d23013f24a9e0246d

Lorenzo Colitti   commited 2020-04-16 00:07:30 +09:00
7f3d684631
[SP27.3] Rename TestableNetworkStatsProvider
Currently, TestableNetworkStatsProvider is a subclass of
INetworkStatsProvider. This is not very accurate naming after
API council review feedback since now we have
NetworkStatsProvider as a system api interface.

This is the counter-part change of actual renaming CL in
NetworkStack.

Test: atest FrameworksNetTests TetheringTests
Bug: 150643374
Change-Id: Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7
Merged-In: Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7
(cherry-picked from ag/10976522)

junyulai   commited 2020-04-15 19:01:13 +08:00
d8d7916d95
Merge "Set transport types to resolver"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-04-13 07:03:20 +00:00
d275ec139a
Set transport types to resolver
For a given network, resolver doesn't know what transport types are.
Therefore, when a new network is created or transport types are changed
in a give network, transport types will be updated and sent by calling
setResolverConfiguration(). In the same time, if link properties or
transport types are null, setResolverConfiguration() won't be called.
The original behaviors of setResolverConfiguration() aren't changed.
Only increasing one new behavior that when a given network has transport
type change, calling setResolverConfiguration() directly and resolver
updates the transport types for that given network.

Bug: 143732914
Test: atest FrameworksNetTests
      atest FrameworksNetIntegrationTests
Merged-In: I03fc5c62dfd9a51a78a720860531df282fdecc20
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53

chenbruce   commited 2020-04-11 23:00:13 +08:00
7b2f898a9a
Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
Merged-In: I4d6681d90705b68c3349f4124e434a29b50fd3a2

Hall Liu   commited 2020-04-07 17:13:19 -07:00
a85ea98c7a
Rename the *Nat64Prefix to *Nat64PrefixFromDns.
This just a rename with no functional changes at all. It is
preparation for supporting getting the NAT64 prefix from the
RA.

Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Change-Id: Ia9a09a708870827b1e4cf068f930fa9542dd116c

Lorenzo Colitti   commited 2020-04-02 22:48:03 +09:00
d523d1416d
Merge changes from topics "api-fix-networkagent", "satisfiedby"
* changes:
  Rename satisfiedBy into canBeSatisfiedBy
  Address further API council comments.

Chalard Jean   authored and   Gerrit Code Review   commited 2020-04-02 05:51:02 +00:00
9122e56202
Merge "Only apply VPN isolation if it's fully routed"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-04-02 04:10:12 +00:00
5c5d1a1282
Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
Merged-In: I076876a6662bde143ef7d315ce3767acafff93c1

Chalard Jean   authored and   Aaron Huang   commited 2020-04-01 20:38:30 +08:00
c62f9a53d8
Only apply VPN isolation if it's fully routed
VPN is considered fully routed if both IPv4 and IPv6 have
either a default route or a prohibit route.

Bug: 145332510
Test: atest FrameworksNetTests
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458

Rubin Xu   commited 2020-04-01 09:36:29 +01:00
ab8cf306ea
Merge "Use IBinder as key for ConnectivityDiagnostics storage in CS."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-03-31 17:00:03 +00:00
852715df47
Merge "Make VpnProfile.maxMtu default value match Ikev2VpnProfile"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-03-31 02:22:54 +00:00
0943dac366
Merge "Invoke onConnectivityReport on registering ConnectivityDiagnostics."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-03-31 00:06:26 +00:00
a365c81bfa
Use IBinder as key for ConnectivityDiagnostics storage in CS.
This change updates ConnectivityService to use IBinder instances as keys
when storing ConnectivityDiagnosticsCallbacks.

When storing ConnectivityDiagnosticsCallbacks in ConnectivityService,
the IConnectivityDiagnsoticsCallback is used as the key for
ConnectivityService.mConnectivityDiagnosticsCallbacks. However,
IConnectivityDiagnosticsCallback instances are received as different
objects. This causes them to produce different hashCode() values, so
attempts to remove an IConnectivityDiagnosticsCallback fail.

Bug: 150867635
Test: atest FrameworksNetTests
Change-Id: Ib99e68d5ae47fa27e12428f9a60a2c1204ac59a2

Cody Kesting   commited 2020-03-30 11:10:46 -07:00
31f1ff693b
Invoke onConnectivityReport on registering ConnectivityDiagnostics.
This change updates the behavior for registering
ConnectivityDiagnosticsCallbacks. Now, after a successful register()
call, callbacks will receive cached ConnectivityReports for all
matching, permissioned networks. This allows registrants to be updated
with the network state for their networks without having to wait for the
next network validation.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I924ba8fdcc847f453557021591bde38602fe089c

Cody Kesting   commited 2020-03-30 11:10:46 -07:00
b77bf707c6
Make VpnProfile.maxMtu default value match Ikev2VpnProfile
This change corrects the VpnProfile's maxMtu defaults to match that of
the Ikev2VpnProfile. 1400 is too high as a default, and Settings will
run into an issue here quite often.

Bug: 152573931
Test: FrameworksNetTests passing
Change-Id: I97ba5903b3cc1ed6a21c706ed3d78bd8ecbeee0c

Benedict Wong   commited 2020-03-27 11:52:40 -07:00
ec51fecfe6
Merge "Automatically set IPsec tunnel interface as up"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-03-25 04:18:50 +00:00
bc74233e8a
Merge changes from topic "netstack_constant_cherrypick"
* changes:
  Remove usage of Context.NETWORK_STACK_SERVICE
  Remove NETWORK_STACK_SERVICE constant

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-03-23 03:33:58 +00:00
10adc9a7b9
Remove usage of Context.NETWORK_STACK_SERVICE
The NetworkStack.getService() API should be used instead.

Bug: 151243982
Test: atest FrameworksNetTests TetheringTests
      Manual tethering test
Merged-In: I7855090bffbe895c8349ad4903b8f2eb55515f0b
(clean cherry-pick from internal branch)

Change-Id: If4af2846a82605e828287a9a4680d5547b76b802

Remi NGUYEN VAN   commited 2020-03-23 11:29:06 +09:00
fbb0836bc6
Merge "Change NetworkCapabilties administrator UIDs to be stored as int[]."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-03-19 18:09:26 +00:00
1a78f835eb
[SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90bf2e48a655ad19b162fe74a23bf3fb0 and
 fix merge conflict in SettingsBackupTest)

junyulai   commited 2020-03-19 10:10:07 +08:00
678befa63c
[SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
Merged-In: If330e85330a4ff713dd420c98d42fa741eabd90a
(cherry picked from commit 2d4fa2c0fae8c2d79a25093d9f732a33c2f91dd4)

junyulai   commited 2020-03-19 10:10:07 +08:00
2632681cf0