Test: new unit test + $ runtest franeworks-net
Bug: 32833400
(cherry picked from commit f98182ef5e80ede5de7f2c2a5f40fc92a46c9704)
Change-Id: Ifaf6e778c811c7d865c790a293b1fce3f43cad1c
This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.
This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.
Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.
With this change the test has been observed to pass with 100% success
rate over 50000 invocations.
Test: $ runtest frameworks-net
Bug: 32561414
(cherry picked from commit 99c8294ef0c7a720364abb5884063e0a9d1bb5fe)
Change-Id: If41a24989d5f65aeb439f68741f511b5eb53b18d
This patch fixes flakyness of testRequestBenchmark by adjusting time
limit for callback registration from 100ms to 180ms, and time limits for
onAvailable and onLost triggers from 30ms to 40ms.
With these timeouts the test succeeds 100% over 5000 iterations.
When using 150ms for registration timeout, running the test 5000 times
fails 2 times.
When using 30ms for onLost timeout, running the test 5000 times fails
1 times.
In addition, this patch also cleans testRequestBenchmark and uses the
more stable SystemClock.elapsedRealtime() for duration measurements.
Test: $ runtest frameworks-net
Bug: 32561414
(cherry picked from commit 38be57b438a0c1754091f045317db2049304e16f)
Change-Id: I196ab9ef7f5abe456a783eed65db09279d2ecb8c
Test: IpConnectivityMetricsTest passes. Also manually changed the new
setting and verified the buffer size is as expected after flushing the
buffer.
Bug: 32198637
(cherry picked from commit 05686dbb6b965eb1a54591d2ed2334337886c6ee)
Change-Id: Iefbeac3a688b260fb3f92dfe0bfd9db28e26749d
This patch adds a version field to ipconnectivity.proto and populates it
to 2, which is the logical version number for NYC-MR2.
Test: IpConnectivity{EventBuilder,Metrics}Test pass
Bug: 32127906
(cherry picked from commit d680d4c856f54bea0c60dea74ba4204822391e49)
Change-Id: If8f167c0dc4c1abe0e235e2adfd131168a4ddc52
Guarantees that timeouts are only delivered if a network never
becomes available. Once a network is available the timeout is
canceled.
Bug: 31402633
Test: all timeout related unit tests pass (new one added)
(cherry picked from commit 681fcda5896fd6c94f8a543ef9983c0a0644e87e)
Change-Id: I7cd3086544c881915fc6dbf14b87a24ab0cd8748
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
This was broken by the implementation of IPv6 tethering, which
relies on various private classes which end up calling unmockable
final classes like NetworkInterface.
Making everything public like this is almost certainly not the
best way of fixing this test, but on the other hand there is
value to the test continuing to pass.
Test: runtest frameworks-net # Everything passes.
Test: IPv6 tethering continues to work.
(cherry picked from commit 7e0eeca8ba4063d0d35dda9a8dfcc612e45efb87)
Change-Id: I8a3cf466871c026f4ae0f5cfa73071338cdf5b7e
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
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: I84f9aecfbf9ebe07c6fcfec26acb2c2cfaae2d60
This patch removes testNotWaitingForIdleCausesRaceConditions() from
ConnectivityServiceTest because it is in nature flaky and prevents using
ConnectivityServiceTest as a patch presubmit check. Estimated failure
rate is 1/15 on Nexus 6p.
This patch also simplifies how ConnectivityServiceTest waits for
handlers to become idle by removing IdleableHandlerThread and turning it
into a signle static method.
Test: $ runtest frameworks-net
Bug: 31479480
Change-Id: I2d78709cbb61d5d01cd59cff326469417f73f1ab
This patch adjusts timeouts in ConnectivityServiceTest to fix tests
known to fail spruriously.
Test: ran the following tests 500 times without observing any failure
- testBackgroundNetworks()
- testMultipleLingering()
- testPacketKeepalives()
- testSatisfiedNetworkRequestDoesNotTriggerOnUnavailable()
- testSatisfiedThenLostNetworkRequestDoesNotTriggerOnUnavailable()
Bug: 32561414
Change-Id: I184fe7189aac768a65b927cc42eefaf8b1b3f930
This test validates that when a mobile upstream has been requested
changing the "DUN required" state results in updating the requested
network appropriately.
Test: as follows
- built
- flashed
- booted
- runtest frameworks-test passes
Bug: 32163131
Change-Id: Ia3a1f6493ea348eb75e334344468a980206f618f
Test: new unit test, no functional changes.
Bug: 32198726
(cherry picked from commit 74264329da5c52fbbafc1d20457056fdeabe19dc)
Change-Id: I123de68de9ae353b95edce89eb570cfbb5f8d9a3
* changes:
DO NOT MERGE: Add IP conn metrics to dumpsys and bug reports
DO NOT MERGE: Add missing dependency.
DO NOT MERGE: Show notification for always-on app VPN
DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
DO NOT MERGE: ConnectivityServiceTest: fix testAvoidBadWifiSettings
DO NOT MERGE: Fix ConnectivityServiceTest testRequestBenchmark
DO NOT MERGE: Switch over to new "time.android.com" NTP pool.
DO NOT MERGE: Define API for metering network stats buckets.
DO NOT MERGE: Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.
DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.
DO NOT MERGE: ConnectivityThread: use lazy holder idiom
DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper
DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler
DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
DO NOT MERGE: Add a null check for the OnStartTetheringCallback.
DO NOT MERGE: [CS] Remove timeout event after first available
DO NOT MERGE: ApfTest: tag tests with @SmallTest or @MediumTest
DO NOT MERGE: Unbreak TetherInterfaceStateMachineTest.
DO NOT MERGE: Move the connectivity tests to frameworks/base/tests/net.
DO NOT MERGE: De-guava BroadcastInterceptingContext and move it to testutils.
DO NOT MERGE: Move FakeSettingsProvider to a common location.
DO NOT MERGE: ConnectivityServiceTest: mark flaky test as such
DO NOT MERGE: Add fuzzing tests to ApfFilter RA processing
DO NOT MERGE: Support timeouts for requestNetwork() invocations.
DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is specified for a given network.
This is the same notification as the one shown during legacy lockdown
mode, sans the 'reset' button.
The notification is only shown during times when VPN has not yet
established or has failed, for example during boot or after a crash.
Bug: 29123115
(cherry picked from commit 1a405fe300950d6ceae2166fd074b596d8110dbe)
(cherry picked from commit de7f7d195eec64802b7b6eee819c699f1a7d6951)
Change-Id: I42b4b24e25175bb7628b46a79431d2592644803c
This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.
This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.
Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.
With this change the test has been observed to pass with 100% success
rate over 50000 invocations.
Test: $ runtest frameworks-net
Bug: 32561414
(cherry picked from commit 99c8294ef0c7a720364abb5884063e0a9d1bb5fe)
(cherry picked from commit 53d83d51424a496978d2ff2d86845a2284515712)
Change-Id: I432f90a699dadfef37a5d0a69e25050753340964
This patch fixes flakyness of testRequestBenchmark by adjusting time
limit for callback registration from 100ms to 180ms, and time limits for
onAvailable and onLost triggers from 30ms to 40ms.
With these timeouts the test succeeds 100% over 5000 iterations.
When using 150ms for registration timeout, running the test 5000 times
fails 2 times.
When using 30ms for onLost timeout, running the test 5000 times fails
1 times.
In addition, this patch also cleans testRequestBenchmark and uses the
more stable SystemClock.elapsedRealtime() for duration measurements.
Test: $ runtest frameworks-net
Bug: 32561414
(cherry picked from commit 38be57b438a0c1754091f045317db2049304e16f)
(cherry picked from commit cbf8ff83a8b342e6ebeaa83794dace3c6d0b1488)
Change-Id: I3caf10025f203156a297c0b522f24768a18accc9
Guarantees that timeouts are only delivered if a network never
becomes available. Once a network is available the timeout is
canceled.
Bug: 31402633
Test: all timeout related unit tests pass (new one added)
(cherry picked from commit 681fcda5896fd6c94f8a543ef9983c0a0644e87e)
(cherry picked from commit bf3b1bad15f45033d409669ac20e4b4e597065fd)
Change-Id: I0cf1a2b7d25bc9912e03fca30621809a9071396c
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)
(cherry picked from commit 5d2654124e9e77dbda102a4435595c552cbc8e36)
Change-Id: Id718e8a02f8db96ff8babac3ec54192148f7bbbd
This was broken by the implementation of IPv6 tethering, which
relies on various private classes which end up calling unmockable
final classes like NetworkInterface.
Making everything public like this is almost certainly not the
best way of fixing this test, but on the other hand there is
value to the test continuing to pass.
Test: runtest frameworks-net # Everything passes.
Test: IPv6 tethering continues to work.
(cherry picked from commit 7e0eeca8ba4063d0d35dda9a8dfcc612e45efb87)
(cherry picked from commit 5bce5a16b17498981253d7a2d1a490667cd71798)
Change-Id: I3f399188f77fe3e5249443dcb61018a22c29d857
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: I4c417c2ba0747d2085169e47ae4a99e93c4d8814
Test: as follows
- built (bullhead)
- flashed
- booted
- runtest frameworks-net passes
- vanilla wifi to mobile tethering (no DUN)
- tested with DUN by:
- adding "dun" to the APN type
- adb shell settings put global tether_dun_required 1
- verified the bug exists without this fix
Bug: 32163131
Bug: 34364553
Change-Id: Idf1a9a2c8191c40abed29e1789f62aefb83ed1ce
Test only the ConnectivityManager request and callback registering
and releasing. Testing behaviour triggered by activating these
callbacks will be in a separate change.
Test: runtest frameworks-net
Bug: 32163131
Change-Id: Ibfe66bbe2e61d81e8f13ac3b98e000d0d4534efa
- CallbackInfo becomes a static class so that it can be instantiated
and looked at more easily than before.
- CallbackInfo gains hashCode() because it has equals().
- effectively final field are qualified final
- fixes bug when polling the next callback: poll() on a LinkedBlockingQueue
returns null when timing out, which was not failing the test cleanly.
Test: ConnectivityServiceTest passes
Bug: 32561414
Change-Id: I64d382a35fe83f21bded98e6906c1ec70a8f1085
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
This is the same notification as the one shown during legacy lockdown
mode, sans the 'reset' button.
The notification is only shown during times when VPN has not yet
established or has failed, for example during boot or after a crash.
Bug: 29123115
(cherry picked from commit 1a405fe300950d6ceae2166fd074b596d8110dbe)
Change-Id: I929a05c24df01e21415535a333bb14ac4b790a9d
Test: new unit test + $ runtest franeworks-net
Bug: 32833400
(cherry picked from commit f98182ef5e80ede5de7f2c2a5f40fc92a46c9704)
Change-Id: Ifaf6e778c811c7d865c790a293b1fce3f43cad1c
This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.
This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.
Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.
With this change the test has been observed to pass with 100% success
rate over 50000 invocations.
Test: $ runtest frameworks-net
Bug: 32561414
(cherry picked from commit 99c8294ef0c7a720364abb5884063e0a9d1bb5fe)
Change-Id: If41a24989d5f65aeb439f68741f511b5eb53b18d
This patch fixes flakyness of testRequestBenchmark by adjusting time
limit for callback registration from 100ms to 180ms, and time limits for
onAvailable and onLost triggers from 30ms to 40ms.
With these timeouts the test succeeds 100% over 5000 iterations.
When using 150ms for registration timeout, running the test 5000 times
fails 2 times.
When using 30ms for onLost timeout, running the test 5000 times fails
1 times.
In addition, this patch also cleans testRequestBenchmark and uses the
more stable SystemClock.elapsedRealtime() for duration measurements.
Test: $ runtest frameworks-net
Bug: 32561414
(cherry picked from commit 38be57b438a0c1754091f045317db2049304e16f)
Change-Id: I196ab9ef7f5abe456a783eed65db09279d2ecb8c