Commit Graph

559 Commits

Author SHA1 Message Date
Lorenzo Colitti
d7a02820ac Merge "Dup fds to stop finalizers from invalidating them." 2017-03-16 03:27:14 +00:00
Lorenzo Colitti
a7ec8300d9 Dup fds to stop finalizers from invalidating them.
The hostside VPN tests were failing because finalizers were
closing the ParcelFileDescriptors that we use to get socekt fds.
The close operations were causing the fds to be marked as invalid
(i.e., -1), causing the tests' system calls on them to fail with
EBADF.

Fix this by dup(2)ing the fds and closing the original objects.

Also, add some asserts to debug this sort of failure.

Fix: 35927643
Test: HostsideVpnTests passed 20/20 times on bullhead
Change-Id: If88530b5bd32622bd4726cd6f0907f731209bb43
2017-03-16 08:25:55 +09:00
Peter Qiu
154dea6b60 wifi: update callsite for Passpoint configuration management APIs
The APIs are updated to not return a boolean status based on
the API Councils comment.  So update the callsite accordingly.

Bug: 35858311
Test: make -j32
Change-Id: Ie9106ecddb2b15178ad37ec6f014d5cc7ce77c43
Merged-In: Ie9106ecddb2b15178ad37ec6f014d5cc7ce77c43
2017-03-13 10:35:44 -07:00
Etan Cohen
9602110a36 [AWARE] Update network creation tests open/encrypted API
Updated/add CTS tests to validate createNetworkSpecifierXxx
API for open and passphrase modules. As these are (still)
single-ended CTS tests - they validate failure.

Bug: 26564544
Test: CTS passing
Change-Id: I07b76bee5a9b73780d341ac8511a2738ded751ca
2017-03-08 09:08:00 -08:00
Etan Cohen
12be803cce [AWARE] CTS for Aware data-path creation
Test Aware data-path creation API flow - failure.

Note: testing limited to failure since single device
testing doesn't have a peer

Bug: 30556108
Test: CTS tests pass
Change-Id: Ie15ad57d7331b21fbb6706091691bd5f87e1264e
2017-03-07 09:41:04 -08:00
Etan Cohen
ab5186e4f6 [AWARE] CTS for failure mode of send message API
Test that sending a message with invalid peer handle (null)
fails as expected.

Note: limited testing
- Single device testing doesn't have a peer
- Cannot create an invalid peer handle since opaque object

Bug: 30556108
Test: CTS tests pass
Change-Id: I72f4b67ea3c3dfc00aa48f6601d064b406dabde7
2017-03-07 09:33:00 -08:00
Etan Cohen
a9f33d578d [AWARE] CTS tests for publish/subscribe discovery
Validate the SUCCESS case of publish and subscribe
discovery sessions.

Bug: 30556108
Test: CTS tests pass
Change-Id: Ib88606cdf662560258890e2f274c85c3a8818206
2017-03-07 09:32:56 -08:00
Etan Cohen
b9af841386 Merge "[CM] CTS tests for requestNetwork APIs" 2017-03-07 16:40:27 +00:00
Etan Cohen
87b18c3df1 [CM] CTS tests for requestNetwork APIs
Add CTS tests for:
- requestNetwork API: test onAvailable
- requestNetwork with timeout API: test onUnavailable (failure)

Bug: 31399536
Test: CTS tests passing
Change-Id: I3565ef375ec90f90b2c76aabee14bf993251eeef
2017-03-06 20:45:13 -08:00
Etan Cohen
831196440e Merge changes I8c2d29be,Ibbc58c3e
* changes:
  [AWARE] CTS for attaching to session + MAC address
  [AWARE] Initial CTS: availability API + broadcast
2017-03-07 04:37:19 +00:00
Etan Cohen
08a2758524 [AWARE] CTS for attaching to session + MAC address
Add CTS to verify initial session attach:
- Basic attach
- Attach with identity callback: use to verify MAC
  address change on subsequent attach.

Bug: 30556108
Test: CTS tests pass/fail per expectations
Change-Id: I8c2d29be81bef600a2c9eac99868326473d72b6e
2017-03-06 13:45:49 -08:00
Etan Cohen
5dc4e9b091 [AWARE] Initial CTS: availability API + broadcast
Initial CTS tests for Wi-Fi Aware:
- Add CTS test class for Wi-Fi Aware
- Setup/initialize
- Test the availablity API + broadcast

Bug: 30556108
Test: builds, CTS runs (test fails as expected)
Change-Id: Ibbc58c3ed7a9ad7312864d038fd34c7202222e82
2017-03-06 13:44:50 -08:00
Peter Qiu
24a0a8e643 wifi: add CTS tests for Passpoint parsing APIs
Added a test for PPS MO (PerProviderSubscription Management Object)
tree parsing API and a test for Release 1 installation file
parsing API.

Bug: 35756298
Test: run the newly added PpsMoParserTest and ConfigParserTest

Change-Id: I6da40bef9609830afb80d8562e5bfb051920b541
2017-02-28 13:43:45 -08:00
Peter Qiu
485adf65b6 WifiManagerTest: add tests for verifying Passpoint configuration management APIs
Bug: 35756298
Test: run WifiManagerTest
Change-Id: I3d106ca9dd4ea74de91c6553eb285534a7856363
2017-02-27 13:57:55 -08:00
Bjoern Johansson
e711648651 Merge "resolve merge conflicts of dfc0ec200f to nougat-mr1-cts-dev" into nougat-mr1-cts-dev
am: 4acb742c40

Change-Id: I06e42332244bdec51588491d73a0f78950e546a8
2017-02-21 19:12:57 +00:00
Bjoern Johansson
959d02c19b resolve merge conflicts of dfc0ec200f to nougat-mr1-cts-dev
Change-Id: Ie0b71a29966154a8590b3e4749f7713acaab0325
2017-02-14 18:24:01 -08:00
Tina Zhou
dfc0ec200f Merge "Don't require WiFi in CtsHostsideNetworkTests" into nougat-cts-dev 2017-02-15 00:48:44 +00:00
bohu
5e6a02e4a3 CTS: skip wifi related net test if no such feature am: 2fa6e7ce43
am: 40f71feca4

Change-Id: I4bbff2b7826bc627618c425243493c09feab3c96
2017-02-03 17:31:52 +00:00
bohu
40f71feca4 CTS: skip wifi related net test if no such feature
am: 2fa6e7ce43

Change-Id: If1a8a0143687113dcde6173dcad05ed14597f5a8
2017-02-03 17:29:09 +00:00
Chris Manton
81d5870154 Include Wear device idle settings
am: 1ac3a1f3fc

Change-Id: Iea4eb54b1baa1df7a7eb680bd51db8bbdb237ce4
2017-02-03 00:00:35 +00:00
Marco Nelissen
d26b43b4d5 Merge "Merge remote-tracking branch 'aosp/nougat-mr1-cts-dev' into master" 2017-02-02 03:18:14 +00:00
Chris Manton
1ac3a1f3fc Include Wear device idle settings
Certain tests interacting with device idle
must set correctly both the normal and wear
device idle setting space.

Bug: 32183373

Test: Run on wear device and Nexus6P
run cts --skip-device-info -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testDozeModeMetered_enabledButWhitelistedOnNotificationAction
run cts --skip-device-info -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testDozeModeNonMetered_enabledButWhitelistedOnNotificationAction

Change-Id: I6a53d29021a7d4a257b102a4d3bd5d2cc845c16f
2017-01-30 12:26:09 -08:00
Treehugger Robot
1663359290 Merge "Add CTS test for client certificate chains" 2017-01-30 18:08:27 +00:00
Marco Nelissen
8653b32a48 Merge remote-tracking branch 'aosp/nougat-mr1-cts-dev' into master
Test: built
Merged-In: I0e9438d5fdb01c94077aa22cdf402dee8bf5ec97
Change-Id: Idbd20b12eec0440369b37316f9ab2c84978f7725
2017-01-27 23:14:25 +00:00
Paul Stewart
9f295aaa43 Add CTS test for client certificate chains
Add tests to excercise new WifiEnterpriseConfig methods, including
setClientKeyEntryWithCertificateChain, and the new getters related
to it.

Bug: 34688653
Test: This is a test
Change-Id: I183166f5864c5ec77eb8590e2e0f521bbc7a39e7
2017-01-27 11:48:29 -08:00
Roshan Pius
446ca6fd2a WifiManagerTest: |disableOthers| flag change
Change the CTS test to reflect the change in behaviour of the
|disableOthers| flag in WifiManager.enableNetwork(). This will now just
be used as an indication to trigger connection to the specified network
instead of disabling all other configured networks.

Bug: 34765254
Test: Compiles
Change-Id: I97a5a84bb861e289d966552cea7f36d7dd4fd090
2017-01-27 18:54:55 +00:00
Treehugger Robot
a17d71f60a Merge "Replace strlen("foo") with sizeof("foo") - 1." 2017-01-26 21:49:09 +00:00
George Burgess IV
32599fd50c Replace strlen("foo") with sizeof("foo") - 1.
We have an upcoming change to Bionic that no longer allows us to treat
strlen("foo") as a constant expression, which causes this bit of code to
no longer compile. So, we need to either use __builtin_strlen("foo") or
sizeof("foo") - 1 instead. (Note that the *optimizer* can still turn it
into a constant, but optimization happens after we figure out if
something is actually a constant expression or not.)

sizeof("foo") is used elsewhere in this file, so I just went with that.

Bug: 32073964
Test: Now builds.
Change-Id: I2797ee75fd114e237de8e97c50549763c88f73f4
2017-01-25 19:20:09 +00:00
Paul Duffin
d872302cdb Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Merged-In: I0f34fe97154240e8f8eef6816df1c794da60351e
Change-Id: I7e3b028321c42b7427d79365eb3f51ddf896f930
2017-01-20 11:38:45 +00:00
bohu
2fa6e7ce43 CTS: skip wifi related net test if no such feature
When a device does not have wifi feature,
we should skip wifi related net tests.

BUG: 31806034
Change-Id: I9867342c47499efc855a50a67a04177fa94e83e5
2017-01-19 14:07:58 -08:00
Glen Kuhne
1b93dea624 CTS: WifiManager.addNetwork with HttpProxy
Added CTS tests verifying, that adding a WifiConfiguration containing an
httpProxy will:
-Succeed if caller is DeviceOwner
-Fail if caller is not DeviceOwner

Test: Added two CTS tests
Bug: 14669153
Change-Id: I2c81492dba5052117a03a2aa7b3cc8ffb5d52d5f
Merged-In: I2c81492dba5052117a03a2aa7b3cc8ffb5d52d5f
2017-01-17 15:33:48 -08:00
Neil Fuller
a3577f20f2 Add test for LocalSockets created from a FileDescriptor
Adding a test to catch future regressions with this code
path.

Bug: 34095140
Test: vogar --mode app_process tests/tests/net/src/android/net/cts/LocalSocketTest.java
Change-Id: I648ed87d4b9e7fa25787c150f08351c6faf55496
2017-01-06 14:16:22 +00:00
Neil Fuller
d9e98a6688 Add more assertions related to LocalServerSocket.accept()
The isConnected() / isBound() behavior is new, the behavior
when bind() / connect() is called is not. See related
frameworks/base changes.

Test: Tests run under vogar.
Bug: https://code.google.com/p/android/issues/detail?id=35942
Change-Id: I8577212270f3b3e76ea015914eebddc0fe4a6afa
2017-01-04 10:40:36 +00:00
Bjoern Johansson
68ec71d954 Don't require WiFi in CtsHostsideNetworkTests
WiFi is not a CDD requirement so these tests should not fail when the
device under test does not have WiFi. The behavior is changed so that if
there is WiFi then both metered and unmetered tests will run. If there
is no WiFi and the current connection is metered then only metered tests
will run. If there is no WiFi and the current connection is not metered
then only unmetered tests will run.

Test: Successfully ran CTS test on both emulator and shamu.

BUG: 31648368
Change-Id: Ic643d2490e0a7e69b57a44599f1a4c57c67da873
2016-12-12 19:34:04 +00:00
Paul Stewart
26fc3c1dd7 Merge "CtsNetTests: Add a test for b/25624963"
am: 9ec7e2127c

Change-Id: I8d9b6e56051b31e9c410b8b7009398df9b4fcaf1
2016-10-19 21:49:30 +00:00
Paul Stewart
22b355560e CtsNetTests: Add a test for b/25624963
Ensure that password is not output in toString() for an enterprise
credential.

Bug: 25624963
Test: Run this CTS test: run cts --module CtsNetTestCases --test android.net.wifi.cts.WifiEnterpriseConfigTest#testEnterpriseConfigDoesNotPrintPassword
Change-Id: I84a62ae5d37aa7d397203f41362dadb8ceba1e62
2016-10-19 10:46:09 -07:00
Nicolas Boichat
983fbfccec PacketReflector: Ignore IPv6 flow labels in ICMPv6 test am: 36c0f02d94 am: 516b0616e9 am: fac99e31ce
am: 171491fa35

Change-Id: I66ef990f1d3e84590409a546f0b5eff307c32bba
2016-10-17 17:23:12 +00:00
Nicolas Boichat
171491fa35 PacketReflector: Ignore IPv6 flow labels in ICMPv6 test am: 36c0f02d94 am: 516b0616e9
am: fac99e31ce

Change-Id: Ib46e30a62620b942afc54d92b1da62412308095a
2016-10-17 17:10:49 +00:00
Nicolas Boichat
516b0616e9 PacketReflector: Ignore IPv6 flow labels in ICMPv6 test
am: 36c0f02d94

Change-Id: Icc98803ea5d4f52cefb43b40d2dcfbd76de1b464
2016-10-17 05:15:47 +00:00
peter_li
24c9b794f6 [CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for CtsHostsideNetworkTests test case. am: 2ecad8d87d am: ca83ca8472
am: 9e20cad5eb

Change-Id: Ib41d8d3c39c5eaf256541883ec9462af544ed605
2016-10-13 16:03:54 +00:00
peter_li
dc396795cc [CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for CtsHostsideNetworkTests test case. am: 2ecad8d87d am: ca83ca8472
am: 254dfe5017

Change-Id: I5955ae432dfe4fd5f751bcf79d307b556e38ac37
2016-10-13 16:03:47 +00:00
peter_li
9e20cad5eb [CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for CtsHostsideNetworkTests test case. am: 2ecad8d87d
am: ca83ca8472

Change-Id: I4a497994d5e6c9f8de979ac9bcf05b6be4ce846c
2016-10-13 15:56:56 +00:00
peter_li
254dfe5017 [CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for CtsHostsideNetworkTests test case. am: 2ecad8d87d
am: ca83ca8472

Change-Id: Id254c85d140dd854e095e47c1465b73426053fc5
2016-10-13 15:56:52 +00:00
peter_li
ca83ca8472 [CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for CtsHostsideNetworkTests test case.
am: 2ecad8d87d

Change-Id: If9c72d61d403b37ecd398179d5d3b447d252d7dc
2016-10-13 15:49:16 +00:00
Tina Zhou
e7c890f1e5 Merge "[CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for “CtsHostsideNetworkTests” test case." into nougat-cts-dev 2016-10-13 15:39:50 +00:00
peter_li
2ecad8d87d [CTS]It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for “CtsHostsideNetworkTests” test case.
Symptom: It should be more reasonable to control battery saver function from setting DB instead of plugging/unplugging charger for “CtsHostsideNetworkTests” test case.
Root Cause: The test function “setBatterySaverMode” of “CtsHostsideNetworkTests” use command to set setting DB when trying to turn on battery saver. But while trying to turn off battery saver, it only use charger plug-in event. It should be more reasonable to turn off battery saver through similar DB setting as this function did at turning on.
Solution: To control battery saver function from setting DB.
Project:
Note:
Test done by RD:
Futher testing need Q team's support:

Bug: 31897608

Change-Id: Id70ba458e85f98393d7652bb4e79bd182172c60f
2016-10-13 07:36:53 +00:00
Amith Yamasani
926802bcaa Test to ensure a toast doesn't affect app standby am: 87c10012b4
am: a79fdc6a3e

Change-Id: Ifc27411d8075cd7174037707f80f4be36e2581a6
2016-09-22 01:33:49 +00:00
Amith Yamasani
87c10012b4 Test to ensure a toast doesn't affect app standby
Put an app in standby, make it show a toast and ensure
that it doesn't come out of standby. This is to test
for a bug fix for the same behavior.

Bug: 31544592
Test: cts-tradefed run commandAndExit cts -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testAppIdle_toast
Change-Id: I796ecde8e346c308a27969d873e3ce384414fee3
2016-09-21 12:46:52 -07:00
Dan Willemsen
4a0758045c DO NOT MERGE ANYWHERE Actually fix cts in nyc-dev-plus-aosp
I did this manually first, but came up with a much better way that
produced a slightly better result (verified the diffs against the next
branch). Sequence of commands:

 # Checkout the last good commit (right before the first bad merge)
 git checkout aa76e8b6fc8515bfc65d4b75456b74c26ee32f1e^
 # Reset the HEAD pointer to the last bad merge, but not the worktree
 git reset 3c197891b50d9ac5e5016f55551b6dff82f62f33
 # Update the index
 git add -A
 # Apply all the changes that mattered between the above to commits
 git cherry-pick -n 29cb19b774b6e0cb73851feb6877da5e42bba78e
 git cherry-pick -n 0e9d107fcfbd3421b7988a4252a9965896019aba
 git cherry-pick -n f19496887beb974c3bc9df9a57f6214a696417b1
 git cherry-pick -n 939e2b253b798386ce53954626fd8044ecb18db6
 git cherry-pick -n 02f07b5d5994b8345ebc86546e5f66524ac04dac
 # Commit the changes
 git commit
 # Rebase the diffs on top of the latest nyc-dev-plus-aosp, since some
 # changes have been manually applied, there will be a few merge
 # conflicts
 git rebase goog/nyc-dev-plus-aosp

All the SHA-1s above were discovered using a combination of this command
to find the changes actually submitted into nyc-dev-plus-aosp itself:

  git log --oneline --first-parent goog/nyc-dev-plus-aosp

and then to find the original commits (that weren't marked as DO NOT
MERGE ANYWHERE):

  git log --oneline --no-merges --stat aa76e8b..goog/nyc-dev-plus-aosp

Change-Id: Iec12619678cb8d011d2c6df26a34ce26e042b854
2016-09-20 05:56:27 +00:00
Amith Yamasani
6a24e5df31 Tests for idle parole when charging am: 2855028c8e
am: 22fcfb341a

Change-Id: Ie0dbb02f9c06aa2dfd358847aa624f07c1cff28f
2016-09-20 02:23:18 +00:00