To support setup test network with both ipv4 and ipv6. Add overloading
function for initTestNetwork to allow specify mutiple addresses.
Also allow to get TestNetworkInterface from this test network, so the
caller can use it to send and write packets.
Test: atest EthernetTetheringTest
Change-Id: Ic7626582c021dee824f95900e4de8efee861a9ea
Parsing ND options as an ByteBuffer slice provides more reliable way to
read raw data from buffer no matter of the option might be malformed,
truncated or options with correct length and value, which doesn't affect
the buffer pointer advances to deal with the remaining data such as
attribute fields even if parsing ND options return null.
Bug: 163492391
Test: atest NetworkStaticLibsTest
Change-Id: Ic348abe6b5d1ceddfde47f19dcaec324927798d1
Keep the consistent style as CollectionUtils.contains for int because
the compiler already does the optimization.
Test: atest NetworkStaticLibTests
Change-Id: Ide49c3761c552e8e184889a2f8d9f1aa8a130d60
The annotation will be used to mark tests cases that are part of MTS
modules used by multiple modules, to indicate that the test case should
only be run if the MTS suite should cover an updated Connectivity
(tethering) module.
This allows tests to verify new behavior in the Connectivity module,
without failing if that module is not updated.
Bug: 196755836
Test: mts-tradefed run mts-network with exclude-annotation in the config
Change-Id: I05d2200c7ab68042e4e48029e045f164c26b8037
As framework-wifi already include NetUtils by
net-utils-framework-wifi-common-srcs, remove this from
net-utils-wifi-service-common-srcs to avoid Duplicated class in Wifi
Apex
Bug: 195965491
Test: build module
Change-Id: Id8b1c76f6120c02c93225f0b25970b217d88c295
Append link-layer address parameter in makeNewNeighMessage, the caller
can assign different link-layer address as netlink attributes, which is
helpful for testing and simulating the case although the neighbor is
still reachable, the link-layer address has changed. If no special link
layer address is assigned, just use the default constant MAC address.
Bug: 162944199
Test: atest NetworkStaticLibsTest NetworkStackTests
Change-Id: I49de035075fa97655358be0089f0fbee293823a0
Move netlink stuff to frameworks/libs/net/common/device, and build the
source files as an individual libraray. NetworkStack module just depends
on the net-utils-device-common-netlink.
Besides, also fix the incorrect format detected by checkstyle_hook script
such as missing java doc and make some public function as private, rename
the variable and etc.
Bug: 192535368
Test: atest NetworkStaticlibTests
Change-Id: I00e7f30be1bc9ebc2e24d7cd53efc403d6ba3daa
assertNoCallback() fails when any callbacks are received.
In some cases, the test is expected to not to receive certain
callback, like available or lost. Depending on the network
environment, network may trigger linkproperties change. It will
fail the test, but these callback does not go against the
intention of the test. It should not fail the test. Thus, add
this method to allow tests to verify no certain callback received.
Bug: 192239030
Test: atest TestableNetworkCallbackTest
Change-Id: I7db720becb23636f85a9ac21192f8185eceb22fe
The constant can now be used from the SDK, and will be inlined at
compile time.
This reverts commit 4c087c18114ec0026b5cdf4824b34477cd8f77c2.
Bug: 184158327
Test: m
Change-Id: Ie577677d237ccfbc73fd3924e6a6d32f9f655851
The new API constant - TRANSPORT_USB didn't in mainline
branch, so the user of TRANSPORT_USB will get build break
when it is built in mainline branch.
Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarily
is a workaround to fix this problem, and it should be removed
once downstream branches are S-based.
(clean cherry-pick)
Bug: 184158327
Test: m
Merged-In: I83560c75761e7008b457a66296364cb4ce24db50
Change-Id: I83560c75761e7008b457a66296364cb4ce24db50
Without a Filterable implementation like the AndroidJUnit4 runner,
DevSdkIgnoreRunner will still run tests annotated with @AppModeFull or
@SdkSuppress. Filterable should be implemented by runners that support
filtering as per the JUnit documentation, so the DevSdkIgnoreRunner did
not support filtering and would run all tests.
Add a Filterable implementation based on the base AndroidJUnit4 runner.
Bug: 192530637
Test: atest CtsNetTestCasesLatestSdk adding annotations to tests
Change-Id: Ica9451e34fb5d98675f754269f44c0354bdde1a4
NetworkFactory needs to be backwards compatible as
it is statically linked by the Wifi module, which
needs to run on both R and S.
To achieve this, maintain 2 separate implementations
called NetworkFactoryImpl (S+) and
NetworkFactoryLegacyImpl (R). NetworkFactory itself
becomes a shim that delegates to one of these
implementations depending on the device's SDK version.
CP of ag/14265947
Ignore-AOSP-First: Merge in internal first to fix
S-on-R test breakages.
Bug: 183902758
Test: ClientModeImplTest
OemWifiNetworkFactoryTest
TelephonyNetworkFactoryTest
UntrustedWifiNetworkFactoryTest
WifiNetworkFactoryTest
Change-Id: I6a08f39ad1633dd7c1582c362c97821e24ce6683
Merged-In: I6a08f39ad1633dd7c1582c362c97821e24ce6683
Add a callback entry for the older notifyLimitReached callback, that is
used on R devices.
Bug: 182962001
Test: atest OffloadControllerTest
Change-Id: Ic3c40eeb72b58ff1514f35be8e030a1dd9ba95d7
The hidden API HexDump causes issues, as coverage tests jarjar its
package even though it is a dependency on a hidden platform class, and
not included in test packages.
Use the HexDump utility in the com.android.net.module.util package
instead (no import is necessary as this is the same package).
Bug: 187935317
Test: atest StructTest
Change-Id: If319a3c20a750c890f8400f1a7104462b41ed556
This change also address left comments at ag/15010113.
Test: m gts && atest \
GtsNetworkStackHostTestCases:NetworkStatsHostTest#testNetworkStatsProvider
Bug: 191327585
Merged-In: I100668cc6d4cecbaff29d027d37d313dd48854f3
Change-Id: I100668cc6d4cecbaff29d027d37d313dd48854f3
(cherry-picked from ag/15061296)
TNM.createTunInterface() takes different parameter from S.
GTS is multi-release, so it should be compatible with S
and before S build. Add sdk version check to support it.
Bug: 186680038
Test: atest GtsNetworkStackHostTestCases:\
com.google.android.gts.networkstack.NetworkStackHostTest#\
testNetworkStack
Original-Change: https://android-review.googlesource.com/1742033
Merged-In: I5a08068db43e507637a53a32c15a5eb453d50c32
Change-Id: I5a08068db43e507637a53a32c15a5eb453d50c32
This reverts commit 886c3f16352f372f8e384c2dafd74c304008af38.
Reason for revert: From result of forrest, it turns out the culprit is not the CL. Hence the revert is not necessary.
See https://buganizer.corp.google.com/issues/191742804#comment10 for more detail.
Change-Id: If8492233c69d7947300f35f764199a7db1bd0045
This reverts commit 6b547a5fce031d25f2640f5da373aac8897634a2.
Reason for revert: DroidMonitor: Potential culprit for Bug 191742804 - verifying through Forrest before revert submission. This is part of the standard investigation process: RESULT: Out of the two CL's pointed at by this bug, this CL appeared to be the cause of the failure; submitting revert.
Change-Id: Ia727b13b11e9b863a702f83f68da12bbff3bcf3f