Commit graph android_packages_modules_Co.../staticlibs/devicetests/com
Message SHA1
Fix CompatUtil on Q and R
CompatUtil was missing return statements and falled back to S
behavior even on Q and R.

Bug: 179329291
Change-Id: I8efb8e56948383c29d476e0b090619bac156d372
Test: atest CtsNetTestCasesLatestSdk

Remi NGUYEN VAN   commited 2021-03-12 01:25:40 +00:00
d105ecf8f1
Rename StringNetworkSpecifier to Ethernet
To keep the tests passing on Q and R, add a CompatUtil class that will
keep creating StringNetworkSpecifiers (now removed) instead.

Bug: 179329291
Test: atest CtsNetTestCases
Merged-In: I14c1ac7cee0ec32353b38ebca4ae6c5cd2e25541

Change-Id: I14c1ac7cee0ec32353b38ebca4ae6c5cd2e25541

Remi NGUYEN VAN   commited 2021-03-01 17:41:10 +09:00
9671ec4073
Move util classes to their destination package
Test: FrameworksWifiTests FrameworksNetTests
Change-Id: I93e9cfd968e08f983e3fd9f7196c455c79a0f32d
Merged-In: Id19c650246a8f3d55d7b6a874840a6eebcd9eb17

Chalard Jean   commited 2020-12-16 08:50:20 +09:00
ceaf7d0edc
Add logging to TestableNetworkCallback.
This is not super useful because it cannot identify different
NetworkCallback objects from each other, but I've found it to be
better than nothing.

Test: manual
Change-Id: Ib402161f361c0f9fb68701bf171cbc99f598dafd

Lorenzo Colitti   commited 2020-12-14 14:43:42 +09:00
a726723ffb
Add autoStart parameter to TapPacketReader rule
Setting autoStart to false allows tests to manually start the
TapPacketReader rule, either via method call (allowing callers to
specify their own Handler) or an annotation.

Bug: 168868607
Test: atest NetworkStackIntegrationTests using autoStart = false
Change-Id: Ic295d659250795c45181dc3c0ac0aaacba854f0b

Remi NGUYEN VAN   commited 2020-10-02 15:14:21 +09:00
539aece60f
Add TapPacketReaderRule
This test rule allows tests to easily create a tap interface, a
TapPacketReader on it, and tear them down after the test.

Bug: 168868607
Test: atest NetworkStackIntegrationTests
Change-Id: Ibc167f5c9a8a1b295e8f6c8384a55a1e3410fcdc

Remi NGUYEN VAN   commited 2020-09-30 17:59:41 +09:00
b904113030
Add TapPacketReader#startAsyncForTest, poll
Add a startAsyncForTest method to attempt to start the TapPacketReader
on its handler thread. The method will not report failures to start
(especially failures to create the socket), so it is only added in
TapPacketReader for test code, and not FdEventsReader which would be in
production code.

Rename popPacket to poll, keeping the old version as deprecated
for compatibility. "pop" normally refers to removing a packet from the
top of a LIFO stack, so it is not appropriate naming here.

Test: m
Bug: 168868607
Change-Id: I19184aaca018165856d1d5e5d24b976ae75d1664

Remi NGUYEN VAN   commited 2020-09-25 12:28:43 +09:00
3b1e9265eb
Add test utilities for shell permission identity
Add utilities allowing to run lambdas with shell permissions, in kotlin
and java tests.

Bug: 168868607
Test: m
Change-Id: Iaab38d498338b9e95d263789119cd0813983087d

Remi NGUYEN VAN   commited 2020-09-25 11:42:38 +09:00
a60293a5e9
Add eventuallyExpect overload
eventuallyExpect is inline function with reified type which
is not accessible from java. Add an open overloaded method to
support the usage.

Bug: 162323152
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Test: atest TestableNetworkCallbackTest
Change-Id: Ifd2256e08d7e5d092d57594350ac8ed1c1727afb

Chiachang Wang   commited 2020-09-02 17:46:28 +08:00
dea21b79a3
Remove backward compatibility flag
Kotlin updates to 1.4 and fixes an issue where @JvmOverload methods
were not final.
See https://kotlinlang.org/docs/reference/compatibility-guide-14.html#generated-overloads-for-jvmoverloads-on-open-methods-should-be-final

Remove the backward compatibility flag by special-casing the method
that needs to be overridden at this time, which gets rid of the
local concern.

Bug: 166499531
Test: Builds, atest ConnectivityServiceTest
Change-Id: Ia13c67876f99dafd77d890e82d62453713b7b5fe

Chalard Jean   commited 2020-08-28 16:56:55 +09:00
d59af18458
Merge changes from topic "metrics_cts_tests"
* changes:
  Add utilities to test tap interface networks
  Add PacketFilter utilities for DNS testing

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-08-24 07:13:40 +00:00
edb36498eb
Add utilities to test tap interface networks
Add an ArpResponder based on a generic PacketResponder class, and a
TestHttpServer based on NanoHttpd.

Test: tests based on these utilities
Bug: 160617623
Bug: 160656765
Change-Id: I50b872a8b23e8df997e8f62f0adc7c0256c4d74d

Remi NGUYEN VAN   commited 2020-08-14 12:54:41 +09:00
7995b438eb
Rename utils to remove the Kt suffix
Nobody cares what language this is written in

Test: builds
Change-Id: I3ed3bce276479fd503e716a06fd4912da8c49eda

Chalard Jean   commited 2020-07-31 15:24:34 +09:00
b1856fe06b
Fix issues reported by checkstyle
Test: builds
Change-Id: I41979cc8096a682c6844df0825ee56ab00a828b5

Chalard Jean   commited 2020-07-31 09:58:14 +09:00
e06c5c8fc0
Move utilities to libs/net
These files used to be in the network stack directory, but the libs
directory is a much more suitable place for them.

Also fix a typo : ConcurrentIntepreter → ConcurrentInterpreter

Also move {FdEvents,Packet}Reader to internal annotations. That's
what they should have been using in the first place anyway.

Note that this does not fix preupload issues reported by
checkstyle to make review easier. The fixes are in a followup
patch to this one.

Test: checkbuild
Change-Id: I675077fd42cbb092c0e6bd56571f2fc022e582fd

Chalard Jean   commited 2020-07-30 22:10:51 +09:00
48c6c7d838