buildCts.py was the central script that generated all the
test package XMLs each time CTS was built. This had a
couple problems:
1. All the XML files for ~40 packages needed to be made
every time CTS was made. Even if those packages were
not touched at all.
2. Couldn't shard the XML generation process across the
available cores on a machine. A pool was added to the
python script, but it was set to a fixed number.
This change moves the test XML generation into a
smaller Java program called "cts-java-scanner" and
the doclet it relies upon to scan the Java files
into "cts-java-scanner-doclet.jar". The output of
the scanner like "cts-native-scanner" for native EXEs
is piped to the existing cts-xml-generator to
produce the test XMLs.
New CTS specific rules replace the standard
BUILD_PACKAGE and BUILD_HOST_JAVA_LIBRARY. They just
add extra rules for the package XML. The BUILD_CTS_PACKAGE
rule also adds a rule for copying the "package.apk"
to something more like "CtsFooTestCases.apk" to the
test case out directory. All the apks, exes, and xmls
are now thrown into a "cts-testcases" directory, before
they are copied to the final CTS distribution.
This change should prevent rebuilding the XMLs
unnecessarily and make rebuilding CTS quicker while
writing tests.
There are still the libcore tests that are always rebuilt,
but they can be adapted to fit into this model someday...
Change-Id: I52a916aa37fd679057e2709bb0ccec694c9fca01
Move the ListeningPortsTest from android.net.cts to android.security.cts,
to better indicate that this is a security related test.
Start triggering test failures when a process is bound to the loopback
interface. In those cases, it's always better to use a UNIX domain
socket instead of a locally bound IP socket. UNIX domain sockets
can be protected with unix filesystem permissions, or
getsockopt(SO_PEERCRED) can be used to indicate who is on the
other end of the socket.
Drastically fix the documentation to explain why this test is present.
Modify the IP addresses and port numbers to be more human readable.
Change-Id: Id83aadd1455279a1a2d3fb4fb1915af558355aca
In /proc/net/udp6 and /proc/net/tcp6, the addresses stored
in that file are in network byte order. As a result, the IPv6
loopback address, ::1, is stored as
00000000000000000000000001000000 NOT
00000000000000000000000000000001
Bug: 5473686
Change-Id: I73098d52c981c48d82423c8ce99b6b20d11a5568
* commit 'e54f4889f65df9955e22a8adbbb8c1527220103e':
Data call establish time is related to network condition which can’t be controlled by the device. Extend the time limitation to 30 seconds to cover most of the cases.
* commit 'bb1ababef8fd8f0ba3e671b426ccc0d26f115ff7':
Data call establish time is related to network condition which can’t be controlled by the device. Extend the time limitation to 30 seconds to cover most of the cases.
- Add UID of listener to error message.
- Convert hex port number to decimal for easier reading by humans.
Change-Id: I0b8edcf14ebd0c039b936055a265f4706558f9fe
Bug 5178134
Some network types can throw SecurityExceptions and depend on the
build configuration. Don't fail the test if those throw exceptions.
Change-Id: I5365f85280a348ef1777d05ce50b2dff17a1312f
Bug 4554251
This test launches multiple downloads at once to check that the
device can open up multiple sockets without OOMing. One test
tries to use wifi if available and the other tries to use
mobile by disconnecting wifi.
The CtsTestServer was modified to handle responses in separate
threads to test concurrent downloads.
Change-Id: Ifa1a11f409c69c1ae3ce621bf0542e0be56b50e0
Update the test to support a new enum value.
Once the SignatureTest is fixed to check enums there
shouldn't be any need for these enum checking tests.
Change-Id: I85d75e86453c37a35f8be9e15d99dd47c690f6ea
Bug 4322307
Fixed some other assertions that didn't check for
either CONNECTING or CONNECTED. Cleaned up some
code and removed some extraneous checks.
Original description:
"Fix cts tests for Wi-Fi only devices.
For Wi-Fi only device,
startUsingNetworkFeature() returns Phone.APN_TYPE_NOT_AVAILABLE
stopUsingNetworkFeature() return 1;
In NetworkInfoTest:
cm.getAllNetworkInfo() returns an array of NetworkInfo.
But the index is not based on network type."
Change-Id: I0b5e3d0cfe5fac18bca0a5ca2ce4cc73bc4dfa16
Do not listen to supplicant state change for wifi disable action,
instead depend on wifi state changed action
Bug: 4242273
Change-Id: Ie53ff42d5e51bbc9f28d93a435fa3315611d342e
For Wi-Fi only device,
startUsingNetworkFeature() returns Phone.APN_TYPE_NOT_AVAILABLE
stopUsingNetworkFeature() return 1;
In NetworkInfoTest:
cm.getAllNetworkInfo() returns an array of NetworkInfo.
But the index is not based on network type.
bug#: 3513630
Change-Id: Ied0684a9fe2152dae242d779efe3dffd6c9c0609
The test may be flaky because it depends on a live server.
Switch to a different server that may be more reliable.
Bug: 3188260
Change-Id: Ibba872489650914db8ddd9a117529556787f66ec
Device can still have a valid networkId even after disconnection
if it was associated with AP, getWifiState is a better check to
get valid state.
Change-Id: I31a8ca38f304fbf639e1f3111be4b5ed406e3b3c
Bug 3189208
Removing this test due to potential problems with GB. This will need to
be brought back and investigated.
Change-Id: Ifeafdf44464c652b063edfb51c5f7931624b6973
When a DNS lookup occurs, a new listening UDP socket will be
created to receive the DNS response. This listening socket is
only temporary, and shouldn't count as a permanent open
socket.
Bug: 3276283
Change-Id: I45090c0e07d9b360cc26f4bce23833db8c399507
Bug 3188260
Remove the code that was trying to write to secure settings
and take off the BrokenTest annotation.
Change-Id: I0759db38225a9822b25c987e66a7590c555b5e9e
Bug 3106981
ConnectivityManager#setNetworkPreference used to be synchronous,
but now it merely sends a handler message. As a result, the
method won't throw any SecurityExceptions, because it will throw
it in the handler instead when trying to write to System.Secure
settings. The test tries to write invalid settings or the same
settings value to test that it won't throw a SecurityException.
Since the method won't throw the exceptions anymore and its
not clear how long to wait to confirm that the settings weren't
going to be changed, just delete these tests.
Change-Id: I9e754bb0e026656511512b17108c42c37d84b069
Bug 2732034
Check that devices do not have any listening ports open by
scanning files in the /proc/net directory.
Change-Id: Ic6204667809b3a0c136e38f35fe536bc6d79dcad