summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-04-30Merge changes I9d38c696,I8da6a8f4 into rvc-devRemi NGUYEN VAN
* changes: Fix IpReachabilityMonitorTest flakes/Q failures Add tests for IpReachabilityMonitor
2020-04-30Address comments on NetworkStack AIDL v6 am: 812baf3e3a am: 692fe8d8a9Remi NGUYEN VAN
Change-Id: I9534ff60b8dac654d0ef66cc1c39ecc559b0af62
2020-04-30Fix IpReachabilityMonitorTest flakes/Q failuresRemi NGUYEN VAN
IpReachabilityMonitor was failing on Q because of: - Usage of HexEncoding.encodeToString(byte[], boolean) that did not exist in Q - Flakes/failures caused by missing permissions when calling IpConnectivityLog - Flakes caused by mocking FileDescriptor#valid() while it could be accessed from another thread Bug: 152723363 Test: atest IpReachabilityMonitorTest --rerun-until-failure 500 Merged-In: I9d38c696bf1b3b63be3b9df3161168ee291e7beb Change-Id: I9d38c696bf1b3b63be3b9df3161168ee291e7beb (cherry picked from commit 162c7ee3601b49f55b7a72597067bc93836dbb96)
2020-04-30Add test configuration values for probe URLsRemi NGUYEN VAN
The test configuration values override RROs that may have been set by OEMs, which is necessary to be able to rely on them in CTS tests. Test: atest NetworkStackTests Bug: 152280218 Merged-In: I8171fd6360a6e504f3abaea3d7de4fa308bbb35b Change-Id: I8171fd6360a6e504f3abaea3d7de4fa308bbb35b
2020-04-30Address comments on NetworkStack AIDL v6 am: 812baf3e3aRemi NGUYEN VAN
Change-Id: I96eb90ecb062d050d974a58c0a5c0605fe6615c4
2020-04-30Fix the potential double transition in DhcpState#enterXiao Ma
The double transition problem might happen when interface is gone by accident after starting DhcpClient. The StateMachine doesn’t allow to call transitionTo() in enter(). Use deferMessage() instead to avoid this crash. Bug: 145182281 Test: manual Merged-In: I03c4161a01861b47cf878945f7f5cc77c821cd57 Change-Id: I03c4161a01861b47cf878945f7f5cc77c821cd57
2020-04-28Address comments on NetworkStack AIDL v6Remi NGUYEN VAN
Address issues found during AIDL review: - Rename clientAddr to singleClientAddr - Do not use a ParcelableBundle for notifyNetworkTested or notifyDataStallSuspected; instead use AIDL parcelables for stronger backwards compatibility guarantees. As part of moving notifyNetworkTested to using a parcelable the test result int is split into two: the actual evaluation result, and the probesSucceeded int. It used to contain both as a bit mask, which does not make sense if probesAttempted is in a separate int itself. Test: atest NetworkMonitorTest ConnectivityServiceTest ConnectivityServiceIntegrationTest, manual Bug: 153500847 Merged-In: I4aac6ff7432472f8a9345fb5785c6314ec8946e4 Change-Id: I4aac6ff7432472f8a9345fb5785c6314ec8946e4
2020-04-28Merge "Remove Preconditions usage from moduleutils and IpClient" into ↵Mark Chien
rvc-dev am: 90b9ebe5f6 am: 1845c21201 Change-Id: I2ae672e12827f1acc23bb0edee5f51a7362b49df
2020-04-28Merge "Remove Preconditions usage from moduleutils and IpClient" into ↵Mark Chien
rvc-dev am: 90b9ebe5f6 Change-Id: I77b60ec479420d45fd4fc4a37130e4e95bad1d6d
2020-04-28Merge "Remove Preconditions usage from moduleutils and IpClient" into rvc-devMark Chien
2020-04-28Merge "Add a ShimUtils.isAtLeastR() and use it in tests." into rvc-dev am: ↵Lorenzo Colitti
7dd51c6650 am: c041bf134c Change-Id: I3fbfaef9eb2feb4a502927601be576059b4cdd42
2020-04-28Don't crash or wtf if the interface doesn't exist. am: 1725a2cd92 am: 3a9c1bafbdLorenzo Colitti
Change-Id: I104a77fc2ece1f94ee8500e902492e1483878f12
2020-04-28Merge "Add a ShimUtils.isAtLeastR() and use it in tests." into rvc-dev am: ↵Lorenzo Colitti
7dd51c6650 Change-Id: Ibb9e6eeabeaca06b139e9a3e5038204fd456389f
2020-04-28Don't crash or wtf if the interface doesn't exist. am: 1725a2cd92Lorenzo Colitti
Change-Id: Ib2f6817a6f674844a279044179c7b89993b13408
2020-04-28Merge "Add a ShimUtils.isAtLeastR() and use it in tests." into rvc-devLorenzo Colitti
2020-04-27Don't crash or wtf if the interface doesn't exist.Lorenzo Colitti
This prevents the code from issuing a Log.wtf due to calling transitionTo in ClearingIpAddressesState#enter if the interface does not exist when IpClient starts provisioning is called. This prevents IpClientIntegrationTest from crashing on eng builds due to the Log.wtf being unhandled. Bug: 155005801 Bug: 152723363 Test: atest NetworkStackNextIntegrationTests:IpClientIntegrationTest#testRestoreInitialInterfaceMtu_NotFoundInterfaceWhenStartingProvisioning Original-Change: http://aosp/1290575 Merged-In: I4f34343816202c996f9227b72d453ea4a464f4b8 Change-Id: I4f34343816202c996f9227b72d453ea4a464f4b8
2020-04-27Add a ShimUtils.isAtLeastR() and use it in tests.Treehugger Robot
Bug: 152723363 Test: atest NetworkStackTests NetworkStackIntegrationTests Test: atest NetworkStackNextTests NetworkStackNextIntegrationTests Original-Change: http://aosp/1295494 Merged-In: I88c33a48a627008f5ad7f880bd09c568866b1c5b Change-Id: I88c33a48a627008f5ad7f880bd09c568866b1c5b
2020-04-27Remove Preconditions usage from moduleutils and IpClientMark Chien
moduleutils is a shared utility to be used by multiple network modules. Stop depending on a framework private class usage. Then all of its users can stop depending on the statically linked and jarjared private framework class. Bug: 148636687 Test: atest TetheringTests NetworkStackNextTests Merged-In: I693d0318fa4f1afbc220aa7c43e614ab5714a984 Change-Id: I693d0318fa4f1afbc220aa7c43e614ab5714a984
2020-04-26Merge "Speed up the DHCP roaming tests." into rvc-dev am: f764224971 am: ↵Lorenzo Colitti
d7a52dd881 Change-Id: I8021ae307f699da29f9fe6ce22be0a383759b84a
2020-04-26Deflake testRaRdnss. am: 60422b52f8 am: 8129d8f145Lorenzo Colitti
Change-Id: I860bd4893b16d8a3dbfc3fdd41e7f58ea393d7b0
2020-04-26Merge "Speed up the DHCP roaming tests." into rvc-dev am: f764224971Lorenzo Colitti
Change-Id: I206eacdd356eae8294ce6775e3e385c0d524084a
2020-04-26Deflake testRaRdnss. am: 60422b52f8Lorenzo Colitti
Change-Id: I0dc62bda526e72c23e53f15f2547030933a07fc3
2020-04-26Merge "Speed up the DHCP roaming tests." into rvc-devLorenzo Colitti
2020-04-26Speed up the DHCP roaming tests.Lorenzo Colitti
The DHCP roaming tests all call doDhcpRoamingTest. This method appears to want to have the IpMemoryStore return null, but instead just causes DhcpClient's IpMemoryStore query to time out. Fix this by actually calling the onNetworkAttributesRetrieved callback with null. Before: real 0m43.728s After: real 0m38.660s Bug: 152723363 Test: atest NetworkStackNextIntegrationTests Original-Change: http://aosp/1295489 Merged-In: I6fc93f82fda6891b3973d04e30cdfce6563077a1 Change-Id: I6fc93f82fda6891b3973d04e30cdfce6563077a1
2020-04-26Deflake testRaRdnss.Lorenzo Colitti
This test is flaky because sometimes provisioning succeeds as soon as the link-local and stable address appear. This causes future expectations on LinkProperties update callbacks to get confused because they see the addition of the privacy address instead of the change they are expecting. Ensure that if provisioning completes with two addresses we explicitly wait for and consume the update that contains the privacy address. Bug: 152723363 Test: atest NetworkStackIntegrationTests:IpClientIntegrationTest#testRestoreInitialInterfaceMtu_WithException --iterations 100 Original-Change: http://aosp/1295487 Merged-In: Ibdd16ce0285db20bd700bf4e78762b922b4661d4 Change-Id: Ibdd16ce0285db20bd700bf4e78762b922b4661d4
2020-04-26Speed up IpClientIntegrationTest. am: 23013b08ca am: 966fef81e7Lorenzo Colitti
Change-Id: I18b6ef2585bdc6f11a5610c7581f7fd532555491
2020-04-26Speed up IpClientIntegrationTest. am: 23013b08caLorenzo Colitti
Change-Id: I6d7fd8f10a55e7911997575d4e7f26fa91bf4c1f
2020-04-25Deflake and fix testIpClientClearingIpAddressState. am: 2ed62241f6 am: ↵Maciej Żenczykowski
96ae81c659 Change-Id: I575055576165e4e1d366799c6ca76ec65c8ec8cf
2020-04-25Deflake and fix testIpClientClearingIpAddressState. am: 2ed62241f6Maciej Żenczykowski
Change-Id: I466b39ce2500ab3792c553c717cf3e404cbbc1ea
2020-04-25Speed up IpClientIntegrationTest.Lorenzo Colitti
1. Ensure the IpMemoryStore always immediately answers questions from the DHCP client. Otherwise, starting the DHCP client takes two seconds as the query to the IpMemoryStore times out. This does not affect tests that use the IpMemoryStore because unlike when(), doAnswer() can be called multiple times. 2. Disable IPv6 provisioning delays before every test, instead of requiring every test to do it individually. 3. Disable DAD as well as setting router solicitation delay to 0. This results in the IP stack essentially immediately after IpClient is told to start. This speeds up the test by about 2x. Before: $ time atest -ti NetworkStackIntegrationTests:IpClientIntegrationTest ... real 1m21.375s After: $ time atest -ti NetworkStackIntegrationTests:IpClientIntegrationTest ... real 0m41.642s Bug: 152723363 Test: test-only change Original-Change: http://aosp/1295486 Merged-In: I32f24ed03fde6fe7e0d0531fa2a289b7f4f88745 Change-Id: I32f24ed03fde6fe7e0d0531fa2a289b7f4f88745
2020-04-25Deflake and fix testIpClientClearingIpAddressState.Maciej Żenczykowski
This test is flaky (at least when run on device) because often IpClient is started before it has heard about the IP address that the test adds to the interface. Then, when provisioning is started, it succeeds immediately because due to historical reasons the presence of an IPv4 address is sufficient to declare a network provisioned. Attempt to configure the address in a way that will avoid this sort of race. Because IpClient does not expose information about its inner state, or send any callbacks while it's stopped, do this by tapping in to the same observer registry that the test IpClient instance uses, and adding two addresses on the assumption that when the second one is observed, all observers, including IpClient, will have seen the first one be added. Also, the test was not very realistic. It configured an IPv4 address, and then ran DHCP, and expected that the IPv4 address would be cleared by ClearingIpAddressesState. But DHCP clears the address as well, because netd only supports configuring one IPv4 address per interface, so the test is not very useful. Use IPv6 instead. Bug: 139314310 Bug: 152723363 Test: atest NetworkStackIntegrationTests:IpClientIntegrationTest#testIpClientClearingIpAddressState --iterations 100 Merged-In: Ibf2fa0260df313c604ec0be3d04f49319f02d60e Change-Id: Ibf2fa0260df313c604ec0be3d04f49319f02d60e
2020-04-25Skip tests if the shims are too old for them to pass. am: 5ce2db965e am: ↵Lorenzo Colitti
f4d040af2b Change-Id: I7559d004ba5380533f297bfb0c9758d870f88d08
2020-04-25Add a VERSION constant to the NetworkStack shims. am: 0c36412a41 am: ca8f723884Lorenzo Colitti
Change-Id: I0a9614cd92064e323c49872ad8250c7e6938830f
2020-04-25Skip tests if the shims are too old for them to pass. am: 5ce2db965eLorenzo Colitti
Change-Id: I90047764e8ef0473492349f447da6d2ca8495594
2020-04-25Add a VERSION constant to the NetworkStack shims. am: 0c36412a41Lorenzo Colitti
Change-Id: I505df43551a38d872d6ea032e1f3ae50a4cb6b2f
2020-04-25Skip tests if the shims are too old for them to pass.Lorenzo Colitti
Two tests in IpClientIntegrationTest depend on methods that require R. These tests are already ignored on Q devices. However, when running NetworkStackIntegrationTests (as opposed to NetworkStackNextIntegrationtests), the tests fail because they compile against the Q shims, and the code behaves the same way as it does on Q. Skip these tests by checking the version of the shims. Bug: 152723363 Test: atest NetworkStackIntegrationTests has two fewer failures Merged-In: I388bd58e79cd4310ad286bcc5688e96b16787be0 Change-Id: I388bd58e79cd4310ad286bcc5688e96b16787be0
2020-04-25Add a VERSION constant to the NetworkStack shims.Lorenzo Colitti
This is useful for tests, in particular to ensure that tests do not fail when compiled against a version of the shims that does not support the functionality they are testing. Test: m Bug: 152723363 Merged-In: I44fa537d792ccc205e54e3be460a90994a47c52e Change-Id: I44fa537d792ccc205e54e3be460a90994a47c52e
2020-04-24Merge "Address comments on ag/11204387." into rvc-dev am: 1b4d196a03 am: ↵TreeHugger Robot
3f36cda253 Change-Id: I5565c9e814751470917f59bd768ca34e2cdda536
2020-04-24Merge "Address comments on ag/11204387." into rvc-dev am: 1b4d196a03TreeHugger Robot
Change-Id: I69832df77ac985f3d4ed797a03ccd506f9255008
2020-04-24Merge "Address comments on ag/11204387." into rvc-devTreeHugger Robot
2020-04-24Improve testable utils. am: 36987092a2 am: 9feb7a75f1Chalard Jean
Change-Id: Iaaa35e3cce2104c3c03216f020ecbab8bac3abd4
2020-04-24Improve testable utils. am: 36987092a2Chalard Jean
Change-Id: Ia19f81d1d12bdf1f03728ce3005e68ba985ae314
2020-04-24Improve testable utils.Chalard Jean
Test: m gts && gts-tradefed run gts --module GtsNetworkStackHostTestCases Bug: 150643374 Change-Id: Ib1c4d8814d3199b512a552ea4c92fedad42594a0
2020-04-23[automerger skipped] Merge "Import translations. DO NOT MERGE" into rvc-dev ↵TreeHugger Robot
am: 52deef8902 -s ours am: 804f1f332b -s ours am skip reason: subject contains skip directive Change-Id: I32ccb514a65ed5b387681d995885f1714355ae84
2020-04-23[automerger skipped] Merge "Import translations. DO NOT MERGE" into ↵TreeHugger Robot
rvc-d1-dev am: 3a7bd0fee6 -s ours am skip reason: subject contains skip directive Change-Id: I9cd6bcabf91d6d6d6ff0e8fab7e4bc62d6da7041
2020-04-23[automerger skipped] Merge "Import translations. DO NOT MERGE" into rvc-dev ↵TreeHugger Robot
am: 52deef8902 -s ours am skip reason: subject contains skip directive Change-Id: I63ccc319a85fac8ecf4dbd873ee94d385e11854a
2020-04-23Merge "Import translations. DO NOT MERGE" into rvc-devTreeHugger Robot
2020-04-23Merge "Import translations. DO NOT MERGE" into rvc-d1-devTreeHugger Robot
2020-04-24Address comments on ag/11204387.Lorenzo Colitti
Add comments and slightly increase test coverage. Bug: 153694684 Test: new test coverage in IpClientIntegrationTest Change-Id: I160a0801449cbe9e66976eaacdd3a914adc3d341
2020-04-23Merge "Ensure that the NAT64 prefix is removed when its lifetime expires." ↵Lorenzo Colitti
into rvc-dev am: 00b170459f am: 416bfb1bd0 Change-Id: I8cd90fe1fca292227f9a2624a1ef0594953d0816