Add end-to-end testing for testing NsdManager advertising and
discovering works fine with downstream tethering interfaces.
Bug: 281639507
Test: atest NsdManagerTest
Change-Id: I5a66423f216cfe0c82db5128502c885980ab264b
The testLocalOnlyTethering only verifies whether an IPv6 RA
with a ULA prefix is sent out. If the test interface is killed
after the RA is sent out while the DHCP server is starting,
the error callback with exception is raised. RunDhcp
verification is used to ensure that DHCP server is started.
Bug: 286701571
Test: TH
Change-Id: Iccebcedbba7b2f9cd28bb1cc06af928ff8dfaaca
The first tethering test case may experience tethering restart
with IP conflict handling. Tethering would cache the last
upstreams so that the next enabled tethering avoids
picking up the address that is in conflict with the upstreams.
To protect subsequent tests, turn tethering on and off before
running them.
Bug: 254183718
Test: atest CtsTetheringTest
atest MtsTetheringTestLatestSdk
Change-Id: I03729d3212a03bd9fcfe2c09cf327840f13b250c
Reply ipv4only.arpa AAAA query with Pref64::WKA for applying test
prefix64 to LinkProperties of test network.
See Nat464Xlat#setNat64PrefixFromDns.
Currently, the test prefix64 is applied directly in test network
initialization. In order to increase the NAT64 test coverage,
the integration test starts to reply prefix64 discovery DNS query
for testing the RFC 7050 prefix discovery.
These clat related tests are still expected to pass since this
prefix64 source change:
- testTetherClatIcmp
- testTetherClatUdp
- testTetherClatTcp
Bug: 259888307
Test: atest EthernetTetheringTest
Change-Id: Ic94ce997dd0b1d718a1074850c01ea90298cc1c3
Move all EthernetTetheringTest buildXXXPacket util into TetheringTester
and make them static public.
Bug: 259888307
Test: atest EthernetTetheringTest
Change-Id: Ice5252c1adfdb98dfaf815f48ac4603711317f65
EthernetTetheringTest#testTetherZeroLengthDhcpPacket requires the latest
NetworkStack module, otherwise, the test will fail due to the loss of
the fix. Apply @NetworkStackModuleTest to exclude this testcase from
target test suite CtsTetheringTestLatestSdk.
Bug: 283200648
Test: atest CtsTetheringTestLatestSdk
Change-Id: Iebfb043e2b71427a6feaf90788fe79b6ab6b678d
DHCP packet listener doesn't close socket any more upon receiving a
zero-length DHCP packet with a fix, instead, just ignore the zero-length
packet and continue reading. Also update the integration test logic to
verify the new behavior, i.e. we can send DHCPDISCOVER from a second device
with different mac address to verify the upstream DHCP server doesn't close
the listening socket, and then we will receive the response from server e.g.
DHCPOFFER packet.
Bug: 269692093
Test: atest TetheringIntegrationTests
Change-Id: I183da43ce5a6511714d293318fe6c60ea55999c0
DHCP packet listener closes the listening socket and stops reading
packet upon receiving a zero-length DHCP packet, which will break
the following DHCP handshake. Add an integration test to verify the
current behavior. A follow-up fix will verify if DHCP server will
accept the zero-length DHCP packet and continue reading packet on
that socket.
Bug: 269692093
Test: atest TetheringIntegrationTests
Change-Id: I5990e37cdfad4e8e4337b0bb1a74632286884baf
Other virtual interface ethernet test cases stop ethernet tethering
by deleting the virtual interface. To disable ethernet tethering for
testPhysicalEthernet, call stopTethering explicitly.
Bug: 271380398
Test: atest EtherentTetheringTest
Change-Id: I19a73f63227bab6a60d57d38b17a20a3f3f6c1d4
Somewhat surprisingly, HandlerThread#quitSafely is *not* a synchronous
method, so the tearDown() method still needs to wait for the thread to
join.
Test: TH
Change-Id: I4297ba057b3d4e67c7b462b6995da637f2479d42
"Cts" prefix of test name may be confused in some test profiles
which are non-CTS tests. Ex: TetheringCoverageTests.
Bug: 250552545
Bug: 258637850
Test: atest EthernetTetheringTest
Change-Id: Ieacfa58f8ccc8de87fea2481801844acaf3f99d9
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
isEthernetTetheringSupported() has been not used since
using TetheringManager#isTetheringSupported in aosp/2143272.
Bug: 258637850
Test: EthernetTetheringTest
Change-Id: Ifc560613301393eeadb6df11688944b2dc629c35
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
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
Used to avoid flaky test because upstream changed events
order can't be guaranteed. Once tethering choose non-test
upstream {wifi, ..}, test network wont't be chosen.
Fix flaky tests which are using initTetheringTester():
testIcmpv6Echo
testTetherClatUdp
testTetherUdpV4_VerifyBpf
testTetherUdpV4
testTetherUdpV4Dns
testTetherUdpV6
Moreover, add permission ACCESS_WIFI_STATE to AndroidManifest.xml
to avoid nested runAsShell while using CtsNetUtils to access WIFI.
STACKTRACE:
java.lang.IllegalStateException: adoptShellPermissionIdentity calls must not be nested
at com.android.testutils.TestPermissionUtil.runAsShell(TestPermissionUtil.kt:49)
at com.android.testutils.TestPermissionUtil.runAsShell(TestPermissionUtil.kt:70)
at com.android.testutils.TestPermissionUtil.runAsShell$default(TestPermissionUtil.kt:65)
at com.android.testutils.TestPermissionUtil.runAsShell(Unknown Source:16)
at android.net.cts.util.CtsNetUtils.disconnectFromWifi(CtsNetUtils.java:293)
at android.net.cts.util.CtsNetUtils.disconnectFromWifi(CtsNetUtils.java:255)
at android.net.cts.util.CtsNetUtils.toggleWifi(CtsNetUtils.java:160)
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: I814899ae71f5c302d490a0dd81d7210ac138faa5
For cuttlefish before T, TetheredInterfaceRequester may be responded
to over 200ms. That causes tests to become flaky. Using ethernet
manager to check available tethering interface instead of repeated
increases TetheredInterfaceRequester timeout
AVAILABLE_TETHER_IFACE_REQUEST_TIMEOUT_MS.
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: I9cfab19adf1a54be82040da225c89b6570a36d4c
Revert submission 1387135-st02
Reason for revert: Usage of TYPE_CNAME in a library shared among
modules does not interact well with current module release process
Reverted 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: Ia35cb3e21cd90e036a07018e2d9c1ee662ce86a2
Change upstream address prefix range from "10.0.0.0/8" to
"10.0.0.1/24" for reducing the flaky rate which caused by the
downstream address prefix conflict with upstream address.
Especially, "10.0.0.0/8" is one of downstream address prefix
range candidate. See PrivateAddressCoordinator.
Bug: 243314243
Change-Id: If995f1d20ac52b84757ac3dec198cae1ebb7e272
Test: atest EthernetTetheringTest
Give slack time for waiting UDP stream mode because handling conntrack
event in user space may not in precise time. Used to reduce the flaky
rate.
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: I7aee1a45d9a4d4fecf09739488dcaadeb7e86655
No DHCPACK received in DHCP process. Because previous DISCOVER/OFFER
steps have done, it implies that DHCP server is launched and
client/server can transmit data to each other. Assume that DHCP server
can reply DHCPACK and CF may need more than 100ms.
Extend the timeout from 100ms to 500ms. Monitor if receiving DHCPACK
timeout is found.
Bug: 243314243
Test: atest EthernetTetheringTest
Change-Id: Id8bb0e03ae1e853beb6242a1c35b977ace9ca190
The tracking interface of EthernetTracker(mTetheringInterface) is
stopped to track only when it is removed. There is race condition in
EthernetTetheringTest that the new test start ethernet tethering with
previous test interface name because EthernetTracker still tracking
previous test interface.
Destroy test interface then listen untether callback without calling
stopTethering. If EthernetTracker stop tracking test interface, it would
call onUnavailable callback to stop tethering. So the test can check
whether tethering is stopped to ensure the test interface is not tracked
anymore before test finish.
Bug: 191826409
Bug: 243222655
Test: atest TetheringIntegrationTests
Change-Id: I618983d981cd3a707dcb7723cdbb20ba5bf8bd2e
aosp/2179274 adds fromBase64EncodedString to BpfDump.
This CL updates EthernetTetheringTest to use this function instead of
parseMapKeyValue in EthernetTetheringTest.
Bug: 217624062
Test: atest EthernetTetheringTest
Change-Id: I56b3cd875e16bee6174f0aacd468562ae482cef9
Don't adopt all permission in setup, instead obtain permission when
needed. It helps to avoid unexpected permission dropping in functions.
Bug: 237369591
Bug: 242067530
Test: atest EthernetTetheringTest
Change-Id: I1215278271ca6b48e097d7f2cf160416d5411655