History log of /frameworks/base/tests/net/java/android/net/apf/ApfTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4dd7c58fc8fcc5a2c50de5e8eff05ddc5c3b0b8b 13-Jun-2017 Ahmed ElArabawy <arabawy@google.com> Add Configuration to APF Policy

in b/37702435 battery was drained due to reception of
Ethernet frames with Eth-type < 0x600 (non ehternet II frames)

This change adds an XML file to drop/allow these frames
Dropping helps tp avoid acquiring a wakelock for the
reception of these packets, while allowing them may be needed
for some protocols
The Change allow the OEM to override the system settings

Bug: 37702435
Test: runtest frameworks-net
Merged-In: Idb6c215896ef230a8136ff4ecefc90ccdc5c1c6d

Change-Id: Idb6c215896ef230a8136ff4ecefc90ccdc5c1c6d
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
967dec794b1974574d95c9d2dea0a0133fa19717 24-May-2017 Joel Scherpelz <jscherpelz@google.com> Ignore flow label when comparing RAs in APF

This change modifies the RA filter generation code to ignore bytes 1-3
of the IPv6 header. It also updates testApfFilterRa such that it fails
without the updates to ApfFilter.

Test: as follows
- built
- flashed
- booted
- sent RAs from OS X with differing flow labels and observed
that they were filtered
- ApfTest passes
Bug: 31166495

(cherry picked from commit 7006bd4fe5eba4b6fad43dd28d9cad2d26ce140a)

Change-Id: I32153238193ac13a0e59be1875d983a0567c41c7
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
495a17b332e57ea4c0162a4ae63d820b947e3719 12-Jan-2017 Hugo Benichi <hugobenichi@google.com> Move byte logics from ApfFilter into BitsUtil

This patch extracts into BitUtils byte manipulation helper methods
and unsigned type manipulation helper methods from ApfFilter into
an independent and reusable structure.

Test: $ runtest frameworks-net
Change-Id: I0f33af10457a63dbde5983f14353a79b8cd877d9
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
4456f33a958a7f09e608399da83c4d12b2e7d191 19-Dec-2016 Hugo Benichi <hugobenichi@google.com> ApfTest: fix flaky testApfFilterRa.

testApfFilterRa is failing with probabiliy 1/10 ~ 1/15 on the following
assert: assertDrop(program, packet, lifetime/6), for lifetime values
that are multiple of 6, where 6 is the hardcoded fraction of RA lifetime
to filter in ApfFilter.java.

When the lifetime is not a multiple of 6, the remainder of 1 to 5
seconds gives enough margin so that when the APF program is simulated
the faked lifetime of the program is less than lifetime/6 away and the
packet is dropped.

However for lifetimes which are exact multiples of 6, this margin is
always 0s and that result in nondeterminism in the result. This is
consistent with the obervation that the only failed assert was for a
lifetime of 300s, the only multiple of 6.

This can be observed by detecting the age limit at which the filter
stops dropping packet oscillating between lifetime/6 and lifetime/6 + 1
for lifetimes which are multiple of 6.

This patch fixes the flakyness by freezing the flow of time in tests so
that the expected filter age threshold is consistent and stable.

Test: no failure observed in 1000 runs.
Bug: 32561414
Change-Id: I5251d047039f34b82ce8a5d20ae46563e1e0cce8
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
cfcc1cb7bf9caae440bf7c2c93efb43c9f90aa73 04-Nov-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE: frameworks-test: adding missing @SmallTest

This activates all frameworks-test tests in runs of the continuous
platform tests.

Test: $ runtest frameworks-net passes (expect Tether
Bug: 32561414
(cherry picked from commit fa8a6f6220d1a0027ba7969c2d3f72690ddc6495)

Change-Id: I7b0706a7e3368f971d508388e8ad4afc5de9d646
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
02428988ad90a2bd294b9ce752c2fced5b649519 02-Dec-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE: APF: also drop any ICMPv6 RSs

Test: new unit test + $ runtest franeworks-net
Bug: 32833400

(cherry picked from commit f98182ef5e80ede5de7f2c2a5f40fc92a46c9704)

Change-Id: Ifaf6e778c811c7d865c790a293b1fce3f43cad1c
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
5d2654124e9e77dbda102a4435595c552cbc8e36 02-Nov-2016 Hugo Benichi <hugobenichi@google.com> DO NOT MERGE: ApfTest: tag tests with @SmallTest or @MediumTest

Test methods not tagged with @{Small,Medium,Large}Test will not appear
in the Android Platform Continuous Testing dashboard.

Test methods tagged with @LargeTest will not be run in the Android
Platform Continuous Testing dashboard.

Test: ApfTest passes ($runtest frameworks-net)
Bug: 31479480

(cherry picked from commit 4195c28347cc100954f83c3c92b4dde4673f8608)

Change-Id: Ia215fc8e2ccc61f6223c24fdf390e1e759de302f
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java
7ceef950a02b22bdf90609bdab8119b4bcd88edf 27-Oct-2016 Lorenzo Colitti <lorenzo@google.com> DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net.

This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner' # PASS

(cherry picked from commit ecc986d430f4b8158f177ed97d2edb741f11ff71)

Change-Id: I993eeaa5dec001c39389023f355f506129b356e7
/frameworks/base/tests/net/java/android/net/apf/ApfTest.java