* changes:
Tethering: deprecate CONNECTIVITY_ACTION on U+ device
Test: add tests to testChooseDunUpstreamByAutomaticMode_*
TetheringTest: separate setup func from chooseDunUpstreamTestCommon
TestTetheringEventCallback may use assertEquals(actual, expected)
but assertEquals(expected, actual).
It is confused while test is failed.
For example:
Code:
callback.expectUpstreamChanged(new Network[] {null} /* expected */);
Before:
java.lang.AssertionError: expected:<100> but was:<null>
After:
java.lang.AssertionError: expected:<null> but was:<100>
Bug: 243516306
Test: atest TetheringTest
Change-Id: I6a987e4dd1cccc5e79da7dda55f194291e0c4a60
This test relies on forceGc to free and finalize the TetheringManager
before perform validation checks. In some test suites, if there were
already too many unused objects accumulated in the system before
running the test, it might take more than 5 seconds to free them.
Increase the maximum retry time to 30 seconds to fix the flakiness.
Bug: 263335396
Test: atest TetheringServiceTest#testTetheringManagerLeak
run the flaky test suite on ABTD with CL
Change-Id: I38bee3d43fbeb278993d113ccbe0645aedc5d75d
Respect the upstream interface mtu instead of always setting
mtu 1500.
Using upstream interface mtu is probably not the best solution
for tether offload pmtu but it at least respects the upstream
interface mtu which may be less than 1500.
Test: manual test
1. Connect to carrier Taiwan Star.
2. Enable tethering and check the mtu 1434 in dumpsys.
IPv4 Upstream: proto [inDstMac] iif(iface) src -> nat ->
dst [outDstMac] pmtu age
udp [02:10:45:32:ef:35] 54(54) 192.168.72.125:39034
-> 15(rmnet1) 100.83.189.11:39034
-> 142.251.43.14:443 [00:00:00:00:00:00] 1434 69657ms
IPv4 Downstream: proto [inDstMac] iif(iface) src -> nat
-> dst [outDstMac] pmtu age
udp [00:00:00:00:00:00] 15(rmnet1) 142.251.43.14:443
-> 54(54) 100.83.189.11:39034
-> 192.168.72.125:39034 [9a:8a:4d:ec:a4:7c] 1434 69633ms
Bug: 262860312
Test: atest BpfCoordinatorTest
Change-Id: Ic6dcb95ed76d5306053e4645b6baebc67ff082cf
Prepare to share setup function to more dun network tests.
No operation is changed.
Bug: 257408654
Test: TetheringTest
Change-Id: I29f08d8bc3cf83aa9d03f5d2819a1c67466b7bcc
The legacy upstream selection flow is never called after T. Stop the
related test cases after T also.
Bug: 257408654
Test: atest TetheringTests
Change-Id: I62692bb9a49dde432d31bece41b4cff442a327d1
Those static method and constants are better to fit in
NetlinkUitls. Replace the usage.
Test: m
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I81e27b8264e39764a44a4ba87344e9ac940d920a
This change is part of aosp/2305844 to update
framework-configinfrastructure dependency.
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.
Test: m
bug: 253019048
Change-Id: Iba194c664c1c701e396e7a2a036bd03772644db8
Merged-In: Ic5323c10b7c899fbf9af41444915359f23db17b5
If we run an iterations test, TCP connections opened by previous tests
won't be closed immediately. They will stay in the TIME_WAIT state for
120 seconds before closed. Netfilter socket listens to both
NF_NETLINK_CONNTRACK_NEW and NF_NETLINK_CONNTRACK_DESTROY groups.
There is a tiny time gap between socket creation and sending dump
request to kernel. If an old TCP connection happened to be closed in
this time gap, listening socket would see a DESTROY message before
seeing the NEW messages triggered by dump request.
The current test only parsing the first contrack message in the read
buffer, so it will only find the DESTROY message and ignore all of the
following NEW messages. It does a netfilter socket dump, but does not
check whether the dump produces reasonable output. Now that we have
the ability to parse conntrack messages, do more in-depth checking.
Bug: 254608655
Test: atest ConntrackSocketTest --iteration 500
Change-Id: Icf95adb9d9390d598e9c6bdb4e245c5fce764e3e
This is a preparation for breaking down EthernetTetheringTest into
CTS and MTS tests.
Changes:
1. Separate common methods from EthernetTetheringTest
to EthernetTetheringTestBase.
Before:
EthernetTetheringTest
After:
[base class] [derived class]
EthernetTetheringTestBase +--+ EthernetTetheringTest
2. No test operation is changed.
Bug: 250552545
Bug: 258637850
Test atest EthernetTetheringTest
Change-Id: I36d205bf6f2a8145d5ac63c620af7528765b22ab
This is a preparation for breaking down EthernetTetheringTest into
CTS and MTS tests.
Changes:
1. Separate common variables from EthernetTetheringTest
to EthernetTetheringTestBase.
Before:
EthernetTetheringTest
After:
[base class] [derived class]
EthernetTetheringTestBase +--+ EthernetTetheringTest
2. Separate EthernetTetheringTest from aosp/2319857
Bug: 250552545
Bug: 258637850
Test atest EthernetTetheringTest
Change-Id: I9bccc558dc8b955055a2927a1a600afd399b264f
This is a preparation for breaking down EthernetTetheringTest into
CTS and MTS tests.
EthernetTetheringTest is going to separate test base class and
derived class. In order to encapsulate base class better, decouple
the following tests which access member variables directly.
- testStaticIpv4
- testLocalOnlyTethering
- testPhysicalEthernet
- testVirtualEthernet
- testVirtualEthernetAlreadyExists
Above tests change to use local veriables instead of class member
variables: mDownstreamReader, mDownstreamIface,
mTetheringEventCallback, mTetheredInterfaceRequester.
This can help to decouple the tests with class member variables and
these class member variables can be private in the
base class EthernetTetheringTestBase since the following commit.
Bug: 250552545
Bug: 258637850
Test atest EthernetTetheringTest
Change-Id: Ifd855571337b34c1dfee5cb2791369de754bc94d
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.
Test: m
bug: 253019048
Change-Id: I29f993342e1baf4e75b30c8d99de10bc087a582b
isEthernetTetheringSupported() has been not used since
using TetheringManager#isTetheringSupported in aosp/2143272.
Bug: 258637850
Test: EthernetTetheringTest
Change-Id: Ifc560613301393eeadb6df11688944b2dc629c35
Simply the upstream selection since U+ device for tethering refactor.
Changes:
1. Support automatic mode only on U+ device.
2. Add two tethering tests to make sure that the resource config can't
control automatic mode anymore. Expect that always automatic mode
on U+ device. Also limit some existing tethering tests for R, S,
or T.
Changes of TetheringTest:
- testAutomaticUpstreamSelectionWithConfigDisabled (U+) [new]
- testLegacyUpstreamSelection (T-)
- testChooseDunUpstreamByLegacyMode (T-)
- testChooseDunUpstreamByAutomaticModeWithConfigDisabled (U+) [new]
3. Add two tethering configuration tests to make sure that automatic
mode is always enabled no mater what the resource config or flag
are on U+ device. Also limit some existing tethering tests for R,
S, or T.
Changes of TetheringConfiguration:
- testChooseUpstreamAutomatically (T-)
- testChooseUpstreamAutomaticallyAfterT (U+) [new]
- testChooseUpstreamAutomatically_FlagOverride (R)
- testChooseUpstreamAutomatically_FlagOverrideOnSAndT (S, T)
(Renamed from testChooseUpstreamAutomatically_FlagOverrideAfterR)
- testChooseUpstreamAutomatically_FlagOverrideAfterT (U+) [new]
Bug: 257941865
Bug: 257408654
Test: atest TetheringTest
Change-Id: I7ace317a1529177a84557741dc07d732b7f8cf89
This is no-op change. Tethering shouldn't use connectivity namespace
because it already be used for NetworkStack module. The new feature
should check isTetheringFeatureEnabled instead.
Bug: 238274852
Test: atest TetheringTests
Change-Id: I009f654d0bf8df7051b822e666e3206dd70a5523
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I7625fa386afe93823b97cb2ecb8fd09a5856c05b
Needed because default Ipv6ForwardingRule#toString doesn't dump
actual data. It is hard to know why two rule comparison failed
in the test failure.
Bug: 250552545
Test: atest BpfCoordinatorTest
Change-Id: Iaf29c888238573c7c9a0a4e0bd65fbe468084e51
Ignore stopping monitoring if the monitor has never started
for a given IpServer.
Also fix the related bug in
BpfCoordinator#testStartStopConntrackMonitoring.
Bug: 250552545
Test: atest BpfCoordinatorTest
Change-Id: I7ac71f0ed52bf52244aadaa3c90ca8df239873e4
Only test testTetherClatTcp on S+ device because R device test
is blocked on b/234727688.
Bug: 234727688
Test: atest EthernetTetheringTest
Change-Id: I65a4a8c4fe13b8320b036380b9038af094ac95a5
Reason for revert: November mainline trains has been branched,
re-submit CLs and request API review.
Re-submitted Changes:
Ib5616c65c:[ST02.2] Use the getters of DnsHeader
I5e58f99b0:[ST02.1] Add TYPE_CNAME constant to DnsResolver
I0c1547cbc:[ST02] Add methods for synthesizing DNS packets
Change-Id: Ifb727e464d3523bd8dee0f2d919a8fb4a9d207c5