When running the device-site tests, it's necessary to share state
between a second app and the main test app. Currently that's achieved
through a shared preference file that is accessed by both apps (since
they use a shared id), but this approach will not work on power save
mode tests (because the test app will be in foreground and the
background restrictions won't be applied in the second app).
This change refactors the data sharing mechanism by:
- Using an ordered broadcast that is sent from the test app to the
secondary app.
- Checking for the network status in the secondary app.
- Moving the test logic to the client-side tests.
BUG: 27127112
Change-Id: I44987701b908b329fdf40e3a7a97e9f30cfadecb
Previously NMPS was broadcasting an intent every time
add|removeRestrictBackgroundWhitelistedUid() was called, but that
behavior has been changed to just broadcast an intent when there is a
change.
BUG: 26685616
Change-Id: I4eb7a4fda864a28ea23b661d1a88e18bfb80533d
The current approach assumes that if the active network is null it is
blocked for background access, but that's not the case.
BUG: 26685616
Change-Id: Ic6990037a2bc503c14512d7303ec71eb178f784b
Initially HostsideNetworkTests.java was used to just launch VpnTest, but
it became more complex with the inclusion of ConnectivityManagerTest,
which required hostside logic.
By splitting these tests not only the VPN tests will run faster (since it
doesn't need the setup/clean from ConnectivityManager), but the
ConnectivityManager tests will be cleaner (since it can have more logic
on setup and teardown).
BUG: 26685616
Change-Id: Ie29c4a3e83956b217d90b84c9b4541690cde0344
This is a no-op change that will make it easier to split the
HostsideNetworkTestCase.java logic into multiple files.
In this change, HostsideNetworkTests.java was renamed to
HostsideNetworkTestCase.java and copied as-is to
HostsideRestrictBackgroundNetworkTests.java; the next change will split
the logic in between these class so they can be properly git-diffed.
In fact, the only difference between then is the class declarations:
diff HostsideNetworkTestCase.java HostsideRestrictBackgroundNetworkTests.java
39c39
< abstract class HostsideNetworkTestCase extends DeviceTestCase implements IAbiReceiver,
---
> public class HostsideRestrictBackgroundNetworkTests extends DeviceTestCase implements IAbiReceiver,
BUG: 26685616
Change-Id: I87dadec528eaeff776d55d3382f356066496429a
These tests require a second app (besides the test app) that defines a
service; the host-side test then launches the service whose only purpose
is to define a broadcast receiver, which in turn will count the number
of intents received in a shared preferences file. Then the test app will
read the shared preferences and assert the proper number of intents have
been received.
BUG: 26451391
Change-Id: I4c5d5e57c09a0bd57a7f6581820cc9115318dd47
am: fc9df7044f
* commit 'fc9df7044f0aa6c860fc0e11f510b1aa10fd8b24':
AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser
am: 5982f2bc9a
* commit '5982f2bc9aa50360ebde52a721da71c6f72af526':
AbstractVerifierTest: adapt tests to reflect that tabs are preserved by the DN parser
Recently in
53f06c0d1d
I changed the tests to reflect the fact that tabs and newlines were
discarded.
I must have made some mistake verifying the change, as tabs seem preserved.
Changing the assertion for tabs.
Bug: 26517725
Change-Id: I514a3d670019e3e2911e2c69b434d0f577ff9b7a
Although the main purpose of these change is to test the new public
API (ConnectivityManager.getRestrictBackgroundStatus()), it also
indirectly tests the new private API on
INetworkPolicyManager (addRestrictBackgroundWhitelistedUid(),
removeRestrictBackgroundWhitelistedUid(), and
getRestrictBackgroundWhitelistedUids()), since they're used on each test
to setup the device state.
This change also modified how the device-side tests are run: the
runDeviceTests() had a className parameter that was not used, and this
CL not only uses it but also introduces a methodName as well. The
reasoning for this change is that the host-side tests must interact with
the device-side tests many times during each test; in fact, the "real"
test is done at the host side, while the device-side test is just used
to assert the expected result of getRestrictBackgroundStatus()).
BUG: 26451391
Change-Id: I7114e350f3b247d2f05b0c280a09cad383c61f9a
In a DN like "cn=\na" the "\n" now gets trimmed, which makes sense.
Changing tests to reflect the change.
Bug: 26517725
Change-Id: I641687dd864524d66b925f555000edd44c970962
Tests are failing with "Address in use". It does not repeat when the
test is run locally.
It is unclear why this has started happening: all tests should be
closing their respective sockets. This change will either prevent
conflicts between tests or help debug if they continue to fail.
Bug: 26140463
Change-Id: I72172b70e00936a6cca9d35c7977fe191621b0cc
am: 78df332ef1
* commit '78df332ef1a6be3cda40b776a6321425fa829ddb': (32 commits)
cts: get video size from CamcorderProfile -- DO NOT MERGE
BUG: 23792027 adding android.hardware.cts.helpers.sensorverification.EventOrderingVerificationTest#testSameTimestamp to knownfailure
cts: get video size from CamcorderProfile -- DO NOT MERGE
cts: get video size from CamcorderProfile -- DO NOT MERGE
BUG: 23954202 fixed minimum memory to be 1099
DO NOT MERGE ANYWHERE: fix breakage
DO NOT MERGE: fix breakage
rename android_security_cts_AudioflingerBinderTest.cpp to android_security_cts_AudioFlingerBinderTest.cpp
Test if libstagefright dies in onInputBufferFilled on currupted file
Should return true if the specified file doesn't exist
DO NOT MERGE - Revert "Revert "Fix AudioTrackTest.testGetTimestamp""
DO NOT MERGE ANYWHERE:revert and resubmit on lmp-dev
DO NOT MERGE ANYWHERE:revert and resubmit to lmp-* branches
Fix build error in ExtractDecodeEditEncodeMuxTest.
Fixed android.uirendering package in CTS-5.0_R3
TV: add multiple tracks tests to CtsVerifier
TV: Add parental control tests to CtsVerifier
TV: add a test for overlay view from TV input to CtsVerifier
Add TV app tests to CtsVerifier
DO NOT MERGE - Add security test for IEffect binder command
...
DistinguishedNameParser was moved to frameworks/base in
46972b2d825a2368706e7d2210559ca18fc2b332
Testing its behaviour through AbstractVerifier.
DistinguishedNameParserTest adapted from
f7ce6a3b235a9aaf884d3b96e50d6b249dd770e0
Bug: 25882613
Change-Id: Idf901503d96df8b160d84f4f88dbf79359f0e035