Commit Graph

2860 Commits

Author SHA1 Message Date
Benedict Wong
64e64ff454 Add IPsec Tunnel mode data tests
This change adds single-direction tests for the IPsec Tunnel Mode API.
In the outbound direction, TUNs are used to capture outgoing packets,
and values are inspected. In the inbound direction, packets are built
manually, using the PacketUtils framework. Additional testing for
end-to-end integration tests will follow in aosp/941021 using packet
reflection via the TUN.

Bug: 72950854
Test: This; passing
Change-Id: Ic4181fc857fa880db5553314efa914f870dbe87c
2019-05-09 11:25:15 -07:00
Benedict Wong
75fb3d002e Add utilities to generate packets
This change adds utility methods to generate packets incrementally. It
supports UDP, ESP, IPv4, IPv6 packet generation.

For ESP, it exclusively does AES-CBC, HMAC-SHA256.

Bug: 72950854
Test: This
Change-Id: Icffeed2ebb2005d79faf04f48fd5126d1d6fb175
2019-05-09 11:25:06 -07:00
Benedict Wong
65845a7e50 Add TunUtils as utility to reflect packets
This patch adds a TunUtils class, allowing for packet capture over a TUN
interface, inspection of some basic header fields, and reflection of
packets with flipped src/dst headers.

Bug: 72950854
Test: Ran, passing
Change-Id: I9fdba4a905886c7a4820d86ef52c0cc1843215b2
2019-05-07 19:24:17 -07:00
Benedict Wong
437eb03a33 Check for IPSEC_TUNNELS feature before running CTS tests
If tunnel feature does is not present, skip tests.

Bug: 117183273
Test: This
Change-Id: I62fcc2cbca8bf3d2b70da5646303a7059a0df663
2019-05-07 19:24:14 -07:00
Varun Anand
1806a7da53 Merge "CTS tests related to VPN meteredness." 2019-04-15 13:45:57 +00:00
Treehugger Robot
e445f54934 Merge "Minor changes for DnsResolverTest" 2019-04-12 17:24:36 +00:00
Luke Huang
f1dc4d4380 Minor changes for DnsResolverTest
Done for code-style nits from aosp/940128.

Bug: 129395490
Test: atest DnsResolverTest
Change-Id: Ia4db272cc1a4687b3749116375bac0efb37420d8
2019-04-12 10:34:14 +08:00
Luke Huang
ea5e4a5409 Merge "DnsResolver cts changes to match API council requests" 2019-04-12 00:45:18 +00:00
Lorenzo Colitti
75c73cda26 Merge "Add instant and ABI XML tags for hostside networking tests." 2019-04-11 23:52:10 +00:00
Varun Anand
d1008aa730 CTS tests related to VPN meteredness.
Tests cover scenarios related to whether VPN has explicitly declared its
underlying networks plus whether it is an always metered VPN.

For each of these scenarios, we ensure VPN meteredness based on its
capabilities and ConnectivityManager#isActiveNetworkMetered matches.

Bug: 123727651
Test: atest HostsideVpnTests
Change-Id: I3030e5468a55bbc32be2a753f098dcf7f0256af8
2019-04-11 14:32:21 -07:00
Lorenzo Colitti
ad17ee9e92 Add instant and ABI XML tags for hostside networking tests.
These are not multi-ABI because the behaviour does not depend on
the ABI of the app. Some of the APIs are ultimately backed by JNI
code in the system server, but that only depends on the system
server's ABI, not the app's.

Enable instant mode because these applications are subject to the
same network restrictions as other apps.

Fix: 123364589
Test: atest CtsHostsideNetworkTests
Test: cts-tradefed run commandAndExit cts --enable-parameterized-modules --module-parameter instant_app -m CtsHostsideNetworkTests
Change-Id: Ib3c4cd365ffe95889d51a236f035ea84516f0abd
2019-04-11 20:43:59 +09:00
Luke Huang
4b1fab0dd0 DnsResolver cts changes to match API council requests
Bug: 129261432
Test: atest DnsResolverTest
Change-Id: I803f10218a01614ba7fb26597971853e602273c6
2019-04-10 15:39:21 +08:00
Adam Vartanian
5227dbe606 Add test for SslError.getCertificate()
Bug: 129200144
Test: cts -m CtsNetTestCases -t android.net.http.cts
Change-Id: I1b23746865a4bffc90847b30384defd2c7d49879
2019-04-09 15:46:20 +01:00
Android Merger
8f755d309d Merge "[automerger skipped] Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev am: f9b246a320 -s ours am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3852fd92f5 is in history" 2019-04-09 03:22:03 +00:00
Lorenzo Colitti
df64089298 [automerger skipped] Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev
am: f9b246a320 -s ours
am skip reason: change_id Iee8bfe418bf6003e5c78df77d75f6f9745249267 with SHA1 3852fd92f5 is in history

Change-Id: I16d2ba7d301964e1beaf261c1b769a05be4a0187
2019-04-08 20:21:53 -07:00
Android Merger
f9b246a320 Merge "Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev am: d93f6d545c" into pie-cts-dev 2019-04-09 02:38:32 +00:00
Lorenzo Colitti
aaac541459 Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev
am: d93f6d545c

Change-Id: Ie4a894d0d07dd2f26ef63efbb83a4531110f84aa
2019-04-08 19:38:21 -07:00
Android Merger
d93f6d545c Merge "Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev am: b6d3940f89" into oreo-mr1-cts-dev 2019-04-09 00:52:27 +00:00
Lorenzo Colitti
926ebf2d47 Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev
am: b6d3940f89

Change-Id: Iacbf91536898e4b0d8942581593ab87eae0af323
2019-04-08 17:52:15 -07:00
Android Merger
b6d3940f89 Merge "Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev am: 50491fb1cc" into oreo-cts-dev 2019-04-09 00:06:54 +00:00
Lorenzo Colitti
454f3193a3 Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev
am: 50491fb1cc

Change-Id: Ie5459302cb2aa040ed44747f189434091e1c4786
2019-04-08 17:06:38 -07:00
Android Merger
50491fb1cc Merge "Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev am: 3b416dd354" into nougat-mr1-cts-dev 2019-04-08 23:32:07 +00:00
Lorenzo Colitti
fe13c7233d Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev
am: 3b416dd354

Change-Id: I03a2f6f3631c25868d504892c5b885477dcfeb01
2019-04-08 16:31:57 -07:00
Treehugger Robot
3b416dd354 Merge "Fix expected reverse lookup of Google DNS IP addresses" into nougat-cts-dev 2019-04-08 22:33:39 +00:00
Android Merger
40ac51693b Merge "[automerger skipped] Merge "DO NOT MERGE:CDD Annotation for 7.4.7/C-2-1" into pie-cts-dev am: 9709b60914 -s ours am skip reason: subject contains skip directive" 2019-04-08 20:19:05 +00:00
saurav subedi
273d9c4cbf [automerger skipped] Merge "DO NOT MERGE:CDD Annotation for 7.4.7/C-2-1" into pie-cts-dev
am: 9709b60914 -s ours
am skip reason: subject contains skip directive

Change-Id: Ic4a66d08a162dc0685b0ad5dd08d63be9705a39d
2019-04-08 13:18:53 -07:00
Treehugger Robot
9709b60914 Merge "DO NOT MERGE:CDD Annotation for 7.4.7/C-2-1" into pie-cts-dev 2019-04-08 19:40:27 +00:00
Lorenzo Colitti
3a984ca812 Fix expected reverse lookup of Google DNS IP addresses
DnsTest.testDnsWorks expects that reverse lookup for the Google
public DNS servers will return something with google.com in the
name. This no longer works because the reverse DNS entries have
changed to dns.google.

Bug: 129452237
Test: atest android.net.cts.DnsTest.testDnsWorks
Change-Id: Iee8bfe418bf6003e5c78df77d75f6f9745249267
Merged-In: Iee8bfe418bf6003e5c78df77d75f6f9745249267
(cherry picked from commit 3852fd92f5)
2019-04-08 00:21:48 +00:00
saurav subedi
d11be5bbeb DO NOT MERGE:CDD Annotation for 7.4.7/C-2-1
Devices that don't provide data saver mode must return
RESTRICT_BACKGROUND_STATUS_DISABLED for the
ConnectivityManager#getRestrictBackgroundStatus()

Bug:130032710
Test: make cts
Change-Id: I81b52c9d26afcf51a7e416d20589c9c7cfb878f6
2019-04-05 20:23:53 +00:00
Treehugger Robot
3604dbe2de Merge "Add FrameworksNetCommonTests to CTS" 2019-04-04 12:29:44 +00:00
Mark Chien
e8fb173b7d Merge "[KA09] add cts test for tcp keepalive offload" 2019-04-03 09:36:52 +00:00
Remi NGUYEN VAN
16fc55e30d Add FrameworksNetCommonTests to CTS
The common tests include tests that must be both in CTS and unit tests.

Bug: 129199908
Test: atest CtsNetTestCases, IpPrefixCommonTest is run and passes.
Change-Id: Id16f40247cca9a6c5bba573006b84547727f1bab
2019-04-03 18:06:33 +09:00
markchien
5dc1681823 [KA09] add cts test for tcp keepalive offload
Add a test case to make sure tcp keepalive offload starts
correctly.

Bug: 114151147
Test: atest ConnectivityManagerTest#testCreateTcpKeepalive
Change-Id: Iaf1c2fab755f3df8e866b4988f64c25906e1737a
2019-04-03 13:50:39 +08:00
Junyu Lai
553872fc04 Merge "Fix tests in TrafficStatsTest that are affected by adb over network" 2019-04-02 02:00:25 +00:00
Lorenzo Colitti
718025ed2c Merge "Add test coverage for ICMP echo constants." 2019-04-01 15:08:44 +00:00
junyulai
c1419d913d Fix tests in TrafficStatsTest that are affected by adb over network
If the adb TCP port is opened, this test may be run by adb over
network. Huge amount of data traffic might go through the
network and accounted into total packets stats. The upper bound
check would be meaningless.

Bug: 126320702
Test: atest android.net.cts.TrafficStatsTest 10 trials for both cases

Change-Id: Iaee455826dc01741c6a3a9f5f8096361c69a1e7c
2019-04-01 11:12:16 +08:00
Android Merger
baed35fda0 Merge "Merge "[automerger skipped] Merge "RESTRICT AUTOMERGE: Port "Exempt adb socket for hostside VpnTest" to Cts 8.1" into oreo-mr1-cts-dev am: af988f0d74 -s ours am: 8e3bef2416 -s ours am skip reason: subject contains skip directive" 2019-03-29 22:06:24 +00:00
Brio Automation
1696a4377d Merge "[automerger skipped] Merge "RESTRICT AUTOMERGE: Port "Exempt adb socket for hostside VpnTest" to Cts 8.1" into oreo-mr1-cts-dev am: af988f0d74 -s ours
am: 8e3bef2416 -s ours
am skip reason: subject contains skip directive

Change-Id: Ifce3b82c92d75daccfe655a0ff70ef3f121766d5
2019-03-29 15:06:03 -07:00
Android Merger
8e3bef2416 Merge "[automerger skipped] Merge "RESTRICT AUTOMERGE: Port "Exempt adb socket for hostside VpnTest" to Cts 8.1" into oreo-mr1-cts-dev am: af988f0d74 -s ours am skip reason: subject contains skip directive" into pie-cts-dev 2019-03-29 21:55:49 +00:00
Brio Automation
8d7997ef50 [automerger skipped] Merge "RESTRICT AUTOMERGE: Port "Exempt adb socket for hostside VpnTest" to Cts 8.1" into oreo-mr1-cts-dev
am: af988f0d74 -s ours
am skip reason: subject contains skip directive

Change-Id: I572f99c9dadc432b15c21da7658fe4d2cc5596b2
2019-03-29 14:55:40 -07:00
Lorenzo Colitti
950e10572b Add test coverage for ICMP echo constants.
Bug: 129251251
Test: atest android.net.ipv6.cts.PingTest com.android.cts.net.HostsideVpnTests
Change-Id: Icca18e0870588ca250225ce79cf30dbd8c361e84
2019-03-30 02:11:46 +09:00
Lorenzo Colitti
3592095637 Merge "Add more test for async DNS api" 2019-03-29 14:46:11 +00:00
Luke Huang
8fd0506401 Add more test for async DNS api
Bug: 129395490
Test: atest DnsResolverTest
Change-Id: I4d2cdc2be577846c08dfe994da60965f983acb97
2019-03-29 17:09:57 +08:00
Luke Huang
92f1edd2f0 Improve cancellation test for async DNS API
After having a lock between callback and cancellationsignal,
errno with EBADF should not happen.

Bug: 129317069
Test: atest DnsResolverTest
Change-Id: I08e800b078d40345eb3f46da1323db251c8dcd47
2019-03-28 21:06:30 +08:00
Lorenzo Colitti
38ca09669a Merge "Fix expected reverse lookup of Google DNS IP addresses" 2019-03-28 09:49:22 +00:00
Lorenzo Colitti
3852fd92f5 Fix expected reverse lookup of Google DNS IP addresses
DnsTest.testDnsWorks expects that reverse lookup for the Google
public DNS servers will return something with google.com in the
name. This no longer works because the reverse DNS entries have
changed to dns.google.

Bug: 129452237
Test: atest android.net.cts.DnsTest.testDnsWorks
Change-Id: Iee8bfe418bf6003e5c78df77d75f6f9745249267
2019-03-28 17:41:13 +09:00
Luke Huang
acadb939b5 Improve test and fix doulbe-close fd problem for async DNS API cts
1. Change test cases for enlarging buffer size of FrameworkListener.
2. Remove test procedure which caused doulbe-close fd.

Bug: 129317069
Bug: 126307309
Test: atest CtsNativeNetDnsTestCases MultinetworkApiTest
Change-Id: I8d871cebca6fa7e298a874ba430ec0aaa05c0eed
2019-03-26 20:33:43 +08:00
Brio Automation
b84038696c RESTRICT AUTOMERGE: Port "Exempt adb socket for hostside VpnTest" to Cts 8.1
https://android-review.googlesource.com/c/platform/cts/+/833600

Change-Id: Id6f986aacc3cadf713ebbc8305ca535b861390fc
Bug: 119382723
2019-03-26 00:31:14 +00:00
Treehugger Robot
d01197426b Merge "Enable instant and ABI XML tags for native networking tests." 2019-03-25 06:31:59 +00:00
Lorenzo Colitti
f011d5f95b Enable instant and ABI XML tags for native networking tests.
These tests include native code so mark them as multi_abi. They
also pass in instant mode so mark them instant_app.

Fix: 123367032
Fix: 123367595
Test: atest CtsNativeNetDnsTestCases CtsNativeNetTestCases
Test: cts-tradefed run commandAndExit cts --enable-parameterized-modules --module-parameter instant_app -m CtsNativeNetDnsTestCases
Test: cts-tradefed run commandAndExit cts --enable-parameterized-modules --module-parameter instant_app -m CtsNativeNetTestCases
Change-Id: Id66705ecb012a07aa34318f41afb1840dd25b9e3
2019-03-25 13:41:38 +09:00