Commit graph android_packages_modules_Co.../staticlibs/hostdevice/com/android
Message SHA1
[VCN04.1] Add assert tool for Set
Test: TH
Bug: 175662146
Change-Id: Ib7e2e61a987def59f8e8fc841d07f37ae894573d

junyulai   commited 2021-03-09 20:08:38 +08:00
0c813cc91e
[FUI22.1] Add assert utilities for list
Test: atest NetworkStaticLibTests
Bug: 174123988
Change-Id: Id918227716367264042e6b674ce29c18e2d901e4

junyulai   commited 2021-03-03 21:07:13 +08:00
148bdcb48b
Make Readhead more usable in multithread.
There doesn't seem to be a way to get any code at all
to run in a generic way on the thread that will execute
a test in android JUnit. JUnit can do it, but the android
harness imposes a thread hop.

This is inconvenent with ReadHead, because ReadHead can't
be used in multithread for semantic reasons : it would
make no sense at all. ReadHead enforces this today in a
relatively strong fashion.

But technically, the only guarantee that is needed is that
poll() is executed only on one thread in slabs of time
defined between a read barrier and a write barrier, where
the write barrier of the previous slab happen-before the
read barrier of the next slab. This in generally speaking
a bit difficult to achieve, but the tests run satisfy this
condition by starting the thread after executing the
@Before methods and joining it before executing the @After
methods. So in fact, it's safe to use ReadHead during
the befores and afters, if a bit uncomfortable, as long
as only one thread uses it during the before, one thread
during the test, and one thread during the afters.

This patch relaxes the enforcement on ReadHead to accept
the usage above. If any slab of time contains usage of
poll() on multiple threads, this will instead crash with
ConcurrentModificationException in almost all cases. It's
no longer possible to detect every possible misuse of
poll() under these conditions, but with this code it's
going to be very unlikely at each test run that the code
is incorrect and still doesn't crash, so incorrect use
should still cause at least very severe flakiness.

The main drawback, aside from the very slight performance
penalty, is that some use can be accidentally correct and
this code will now accept it. So it's possible that code
that is only accidentally correct is accepted, and a
seemingly unrelated change later breaks that correctness,
causing seemingly unrelated tests to fail.

Still, this is going to be an improvement in usability
of ReadHead. We'll no longer need to have lazy creation
of it, and it will be possible to check remaining events
after a tests runs.

Test: FrameworksNetTests NetworkStackTests
Change-Id: If87eef1686b235e53cb444a32f9985b4c2a0a901

Chalard Jean   commited 2020-12-21 15:47:09 +09:00
460e78931a
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 PacketFilter utilities for DNS testing
Add packet filters that are useful for filtering / testing DNS queries
and ARP requests.

This change is a prerequisite for tests verifying DNS and validation
metrics.

Test: tests using these utilities
Bug: 160617623
Bug: 160656765
Change-Id: I4216f4ec60d1a427f60fad6eb8017e36b082665f

Remi NGUYEN VAN   commited 2020-08-06 15:24:47 +09:00
2f2a3b467c
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