Commit graph android_packages_modules_Co.../tests
Message SHA1
Merge "Revert consider TEMPORARILY_NOT_METERED as unmetered in data usage"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-12-02 11:27:27 +00:00
841b1f33d5
Revert consider TEMPORARILY_NOT_METERED as unmetered in data usage
Currently, NET_CAPABILITY_TEMPORARILY_NOT_METERED traffic is
counted as unmetered data usage, and "mobile data usage"
settings screen shows metered data usage which means it doesn't
include TEMPORARILY_NOT_METERED traffic. However, some carriers
show TEMPORARILY_NOT_METERED data usage in customer's bill which
would be confusing if the data usage in the device shows different
results. Thus, revert the change to avoid confusing.

Bug: 183776809
Test: FrameworksNetTests
Change-Id: I4ef25095462adf30b1ecf82134996739f167930d

Aaron Huang   commited 2022-12-02 16:04:55 +08:00
c5a05d1d8f
Merge "Make mMatchSubscriberIds as a NonNull variable"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-12-02 03:08:14 +00:00
b4b8198b89
Merge "Send MdnsServiceInfo on onServiceRemoved callback"
Paul Hu   authored and   Gerrit Code Review   commited 2022-12-02 01:33:40 +00:00
79e239eacb
Make mMatchSubscriberIds as a NonNull variable
In current design, mMatchSubscriberIds can be null which has the
same meaning with empty set, and is not easy to maintain since it
need more checks for this variable when mSubscriberId is null.
Thus make mMatchSubscriberIds NonNull for the maintenance.

Bug: 238843364
Test: build, FrameworksNetTests
Change-Id: I6cfc529b5f4a39ded8598283ff968f2f4d1bc89f

Aaron Huang   commited 2022-11-30 16:38:24 +00:00
859884a48f
Remove unused methods from NetworkTemplate
NetworkTemplate.Builder was introduced in Android T and the callers
outside of Connectivity module should use this Builder to build a
template instead. Thus remove the buildTemplate* methods from
NetworkTemplate class. Also, deprecate the methods which are
annotated with @UnsupportedAppUsage and also use Builder to build
the template.

Bug: 238843364
Test: build, FrameworksNetTests
Change-Id: I3190325f6663e4771edf5c7a19bf5ecc7780bf12

Aaron Huang   commited 2022-11-30 16:38:19 +00:00
a8a6da0db9
Send MdnsServiceInfo on onServiceRemoved callback
Send MdnsServiceInfo on onServiceRemoved callback which include
service name, service type and other info instead of service name
only. These extra info is necessary for service lost callback on
NsdService on the following changes.

Bug: 254166302
Test: atest FrameworksNetTests
Change-Id: Ibacbef4b893209bbc2a37376bf26d713ce41429c

Paul Hu   commited 2022-11-29 11:51:16 +08:00
039d8111e0
Merge "Use a random service type for NsdManagerTest"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-11-24 05:37:22 +00:00
6b62604bee
Merge "Use a longer timeout for service registration"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-11-24 05:36:55 +00:00
ef81865662
Merge changes from topic "PermissionMonitorOnHandlerThread"
* changes:
  Add synchronized to UidRange getter and dump methods
  Deal with permission update on handler thread
  Running PermissionMonitor#startMonitoring on handler thread

Paul Hu   authored and   Gerrit Code Review   commited 2022-11-23 02:59:17 +00:00
562cdacfee
Deal with permission update on handler thread
To ensure that permission cannot change while CS is doing works,
scoring networks, sending callbacks, etc. So making all
permission update are running on handler thread.

Bug: 232048835
Test: FrameworksNetTests CtsNetTestCases
Change-Id: I5380ec8ff1282a1056d9063848e0fff8b3a570ec

Paul Hu   commited 2022-11-22 07:18:36 +00:00
51f816be4a
Merge "Wait for launcher is shown after calling pressHome"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-11-22 07:06:16 +00:00
a814e9c364
Wait for launcher is shown after calling pressHome
In current code, the test will call pressHome before show
network notification but it does not verify the home screen
is shown. The test might be failed due to the notification
shade is still opened. Thus adding an assertion to verify
the launcher is shown.

Bug: 255643296
Test: FrameworksNetTest:NetworkNotificationManagerTest
Change-Id: Iee3476a26030b9ba72994dee624e0e6974c9369f

Aaron Huang   commited 2022-11-21 10:47:58 +00:00
2c07b827e7
Merge "Reinstate sleep pending better fix"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-18 13:59:50 +00:00
61845d0b10
Merge "Refactor CarrierPrivilegeAuthenticatorTest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-18 12:05:53 +00:00
adb9c9e83a
Reinstate sleep pending better fix
Bug: 259506077
Test: ConnectivityDiagnosticsManagerTest
Change-Id: I2fa304e978267dc4fd23012d128150f6bbf32133

Chalard Jean   commited 2022-11-18 17:18:01 +09:00
c4cff7e40c
Merge "Move VpnTransportInfoTest to common test"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-11-18 05:44:20 +00:00
dfea18945c
Move VpnTransportInfoTest to common test
Move VpnTransportInfoTest to common test to add the cts
coverage.

Annotate @ConnectivityModuleTest so that the test will
not fail with module that is not up-to-date, and use
assertParcelingIsLossless to prevent similar order module
in device case.

Bug: 256775913
Test: atest CtsNetTestCases:android.net.VpnTransportInfoTest
Change-Id: I1c40a4fc42468748d71c3df5c18b2ceb5b3769e1

chiachangwang   commited 2022-11-18 02:17:33 +00:00
91bac1953c
Merge "Add MdnsNsecRecord"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-11-17 08:00:15 +00:00
0f92b69af7
Merge "Test API behavior change in standalone test case"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-11-17 06:28:25 +00:00
0e7ecc0dd1
Merge changes I0f8e6590,I61a1bb91
* changes:
  Add MdnsAnyRecord
  Add constructors to MDNS records

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-11-16 09:12:57 +00:00
b683dfcea5
Use a random service type for NsdManagerTest
When two devices connected to the same access point run the test
simultaneously, they may find each other when discovering for the same
service type, instead of finding themselves as expected by the test.

Similarly to the service name, use a random service type to avoid that.

Bug: 257459913
Bug: 248121960
Test: atest
Change-Id: I462841fb4331c6e441b74302f6463986472f1340

Remi NGUYEN VAN   commited 2022-11-16 17:29:10 +09:00
d4ec70f7ec
Add MdnsNsecRecord
NSEC records are included as mDNS negative responses, as per
RFC6762 6.1.

Bug: 241738458
Test: atest
Change-Id: I1546a2c10447ad46321f595b714c7ee7f6dc34c7

Remi NGUYEN VAN   commited 2022-11-16 15:57:30 +09:00
3ce3a4a9ca
Merge "Verify bypassability in the VPN network capabilities"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-11-16 05:57:00 +00:00
b7577c6d42
Merge "ethernet: consolidate interface enabling functions in EthernetTracker"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-16 05:51:42 +00:00
b6f2a3e587
Add MdnsAnyRecord
The record is useful for mDNS questions in mDNS probes.

Bug: 241738458
Test: atest
Change-Id: I0f8e659048b6e1d7c3ae1640fbd2d57d723ea9b1

Remi NGUYEN VAN   commited 2022-11-16 14:40:47 +09:00
e8d3e6d58c
Merge "Support shouldTestUApis"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-15 16:04:35 +00:00
7a2660719c
Refactor CarrierPrivilegeAuthenticatorTest
Refactor this test to make it easier to test the no-op
refactoring coming as a follow-up

Test: this
Change-Id: I47c81bdec2b8f9575835ba664b61721d5f2c69ff

Chalard Jean   commited 2022-11-15 19:27:56 +09:00
23890c29c5
Use a longer timeout for service registration
NsdManager may take some time to register a service when the device
hostname is already used on the network, as after probing it needs to
choose another hostname and try again. As the default hostname is
"Android" and the alternatives are "Android-2", "Android-3", ..., this
may take several seconds: RFC6762 8.1 says probing should be 3 packets
with a 250ms interval.

Relax the timeout to 10s, which should allow ~10 conflicts before the
test starts failing; at that point, MDNS isn't reliably testable on the
network.

Bug: 248121960
Bug: 257459913
Bug: 257393724
Test: atest
Change-Id: I31e47787ed9661524edd6b676342fb9a442408a8

Remi NGUYEN VAN   commited 2022-11-15 18:34:10 +09:00
22d349083c
Support shouldTestUApis
This is needed by follow-up CL to properly skip tests on T, T-
devices.

Test: TH
Bug: 258471863
Change-Id: If292751ee7ff3bb6e3683eef50066b445e2ca731

Junyu Lai   commited 2022-11-15 16:04:39 +08:00
28187fffcb
Merge "Use eventually expect to wait for blocked status change"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-11-15 07:10:26 +00:00
a3200dacfc
Test API behavior change in standalone test case
In previous CL, the behavior was modified in the module,
but the test was not skipped for T device with unmodified module,
which usually happens in some specific test suites, e.g. wifi MTS.

Move the assertion to another test and annotate with
@ConnectivityModuleTest to indicate that the test needs
to be executed with updated module to prevent from breaking
the test.

Test: atest CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest# \
      testRegisterNetworkCallback
      on tm-qpr-dev devices
Fix: 258471863
Change-Id: Ifb3d1ac45ebde727ad719b45497ab458ad0a4b7a

Junyu Lai   commited 2022-11-15 14:01:09 +08:00
19ff0a7e95
Verify bypassability in the VPN network capabilities
Bug: 256775913
Test: atest FrameworksNetTests
Change-Id: I6600714e5fc7c5d78fa7b8bb29c0c8840ec69637

chiachangwang   authored and   Chiachang Wang   commited 2022-11-15 05:36:24 +00:00
d0a2805616
Merge "Expose vpn bypassability in VpnTransportInfo"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-11-15 05:35:08 +00:00
89d4bda742
Merge "Remove unnecessary permission mock for registerSystemDefaultNetwork"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-11-15 02:23:39 +00:00
c1294c2584
Merge "Enhance NetworkTemplate test"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-11-14 09:38:27 +00:00
ac28a04c6e
Merge "Move DeviceConfigRule to libs/net"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-14 09:34:58 +00:00
9e09b719af
Merge "Verifying equality of LinkProperties with callbacks"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-11-14 05:55:58 +00:00
b99524e467
Expose vpn bypassability in VpnTransportInfo
Bug: 256775913
Test: m framework-connectivity.stubs.source.system-update-current-api
Test: m lint-check
Test: atest FrameworksNetTests
Change-Id: I6aaad7b4372aa4f91df4bed89caea674031a6367

chiachangwang   commited 2022-11-11 08:38:17 +00:00
d12d2011cb
Wait for broadcast idle instead of sleep
In most cases, this change will make this test run faster,
as the device isn't processing a lot of broadcasts so the
broadcast queue becomes idle much earlier than 5 seconds
(tests on a Pixel 4A running AOSP indicate ~1 second).

On low-end devices, this will give the device a better
chance to actually pass the test in spite of high load.

The drawback is that this will wait for the broadcast
*queue* to be idle, so for all broadcasts to have been
delivered to all apps, not just the one this test is
interested in. To wit, there will be cases where this
will increase the length of the test. But this should
be a minority of cases.

Test: atest ConnectivityDiagnosticsManagerTest
Bug: 257412943
Change-Id: I84a8929635ee3a587ef2712a59323abe68fda31b

Chalard Jean   commited 2022-11-11 12:47:30 +09:00
a27bd9bc9d
Verifying equality of LinkProperties with callbacks
During the test, content of LinkProperties might be changed
according to network conditions, e.g. IPv6 RA, DNS64, etc.
Thus, verify equality of two LinkProperties got in different
time is not reliable and would cause flaky. Change it to
verify with the LinkProperties received from callbacks.

Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Fix: 254188130
Change-Id: I845940ff6c6defb1887bfda4bcb47f01382b40bc

Junyu Lai   commited 2022-11-11 10:47:49 +08:00
3c46660097
Move DeviceConfigRule to libs/net
The utility can be useful for tests in various repositories, not only
CTS.

Test: m
Change-Id: I8d674f96994418717a3adf1454e44c868ce032b1

Remi NGUYEN VAN   commited 2022-11-11 01:32:51 +00:00
047368dfb0
Merge "Add exported flag to exposed test runtime receiver"
Michael Groover   authored and   Gerrit Code Review   commited 2022-11-10 18:43:23 +00:00
c5144187fd
Merge "[Feature sync] Resolve class-level nullness suppression"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-10 13:53:31 +00:00
0448f36d60
Merge "Revert "Partially enforce permission when calling getNetworkInfoForUid""
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-11-10 12:13:56 +00:00
016269fbb8
Use eventually expect to wait for blocked status change
While the test case was running, if the network condition changes,
e.g. IPv6 RA received, the test case would fail since unexpected
LinkPropertiesChanged event was received, while blockedStatusChanged
event was expected.

Make the test wait for the expected event and ignore others to make
the test more robust.

Test: atest android.net.cts.ConnectivityManagerTest#testBlockedStatusCallback \
      --rerun-until-failure 100
Fix: 242833720
Change-Id: Ic3cd47773955d27445511dbd94733f91e3037596

Junyu Lai   commited 2022-11-10 16:01:11 +08:00
f256a043b2
Revert "Partially enforce permission when calling getNetworkInfoForUid"
This reverts commit 163cb98751.

Reason for revert: b/257407201

Change-Id: I412140117d25f4a4b439fff5aaa50785f33b0689

Junyu Lai   authored and   Gerrit Code Review   commited 2022-11-10 03:19:06 +00:00
d0cf7784dc
[Feature sync] Resolve class-level nullness suppression
This is a chery-picked commit from internal branch which is to
add nullability to reslove the nullness suppression.

Bug: 242631897
Bug: 254155029
Test: atest FrameworksNetTests
Change-Id: I289b0408c0c4ccdefc498d3b6d3f381c2b04132e

Paul Hu   commited 2022-11-10 01:57:46 +00:00
6c74a13512
Merge "ipsec - use ro.vendor.api_level instead of ro.product.first_api_level"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-11-09 22:38:36 +00:00
82a4e0a42e
Merge "[Feature sync] Fix issue where multiple SRV records with same host are not fully resolved"
Paul Hu   authored and   Gerrit Code Review   commited 2022-11-09 06:38:22 +00:00
b800e5903b