| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Some platforms fail with EAFNOSUPPORT instead of
EACCES.
Bug: 183995234
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest#test_VmSocket
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I85cafff256675cb709693a413c31a3ced3f3a0f1
|
| |
|
|
|
|
|
|
|
|
|
|
| |
ClipboardService.java has an option to talk to the
Android Studio Emulator to exchange the clipboard
with the host. The emulator is migrating virtio-vsock.
Bug: 182436079
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest#test_VmSocketAddress
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest#test_VmSocket
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I3429a7f27972a2ea25194e5d44dc06cb0646e650
|
| |
|
|
|
|
|
|
| |
The UDP_GRO socket option requires 5.4 or above.
Bug: 172945027
Test: atest libcore.android.system.OsTest
Change-Id: I5a07b7a87c297ad27b3461d46be08f3421fdd2da
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create new wrappers for sendmsg and recvmsg so that apps
that know about UDP GRO can call these directly.
Bug: 172945027
Test: atest libcore.android.system.OsTest#test_sendmsg_af_inet_4K
libcore.android.system.OsTest#test_sendmsg_af_inet6_4K
libcore.android.system.OsTest#test_sendmsg_af_inet_16K_recvparts
libcore.android.system.OsTest#test_sendmsg_af_inet_16K_reciveall
libcore.android.system.OsTest#test_sendmsg_af_inet_16K_reciveall_without_recv_msgname
libcore.android.system.OsTest#test_sendmsg_af_inet_16K_without_send_msgcontrl
libcore.android.system.OsTest#test_sendmsg_af_inet_abnormal
Change-Id: Ib65bfba7361139d49049c5f2cae9f2b0da6e27cb
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
On older kernels, timeouts may return a few seconds early
so tolerate that on anything older than 3.18, which is the
kernel version for a sailfish running O MR1.
Converted to JUnit 4 (needed for an earlier patchset) and got
rid of a bunch of lint errors while I was in here.
Fixes: 176104885
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Change-Id: I529e98fe8507cadf007635cdba35e303f8537560
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. The GRO test was failing on new kernels. This is because
getsockopt(IPPROTO_UDP, UDP_GRO) is not supported: the option
can only be set, not get. Don't attempt to get it.
2. The GSO test was failing on older kernels because it fetched
the kernel version as a double and then compared it against
4.19. This fails on 4.9 and 4.4 kernels because 4.19 < 4.4.
Fix this by fetching the kernel version as a 2-int array
instead of a single double.
Bug: 172945027
Fix: 178257424
Test: atest libcore.android.system.OsTest#test_socket_udpGro_set passes on redfin and crosshatch
Change-Id: I862a8fe88521c0ac6e94c0c281ebb2daedc8e19a
|
| |
|
|
|
|
|
|
|
| |
On new kernel versions UDP_GRO should be supported. Add code to
enable these socket options in Java and corresponding test case.
Bug: 172945027
Test: atest libcore.android.system.OsTest#test_socket_udpGro_setAndGet libcore.android.system.OsTest#test_socket_udpGso_setAndGet
Change-Id: I5d0db2853d819957c93b0c5d10cb830109551024
|
| |
|
|
|
|
|
|
|
|
| |
Works around test failures on some old devices for now.
Needs further investigation.
Test: Treehugger.
Bug: 176104885
Change-Id: I8960f08b823fb7704760ccb2a33f96abd6443e4e
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
StructTimeval.fromMillis() failed when called on a negative integral
number of seconds. That would result in a timeval with a million
microseconds, followed by a failed range check.
Do the conversion correctly. Add the obvious test cases.
Test: Used Treehugger to both confirm the failure and test CL.
Bug: 176120149
Change-Id: Ifec35cf68d67fc684f0f6f55b0a0d13d0d98c623
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Be more tolerant of longer delays for when device is under load.
Additionally check that the process blocks for *at least* the
expected timeout. This is a potential source of new flakes
but the socket is bound but not listening, so read should
block forever in the absence of a timeout.
Hans, you've tweaked similar timeouts in the past, do these
seem about right to you?
Bug: 175252827
Test: atest OsTest.test_socket_setSockoptTimeval_effective.
Change-Id: I615f14b6d6b7e3e3e6d7a5a23f579d3681fad581
|
| |
|
|
|
|
|
|
|
|
| |
Non-system apps targeting the latest SDK are no longer able to
bind() to NETLINK_ROUTE sockets (see https://r.android.com/1219477).
Bug: 141455849
Bug: 148621612
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Change-Id: Ie4a5321711d5fda5c8df9004b41988f8521e53ea
|
| |
|
|
|
| |
Test: tests passing
Change-Id: Iae04433f19f26f0775d6dc56ef511edf138b31d9
|
| |
|
|
|
|
|
|
| |
In order to allow sockets to be set as non-blocking after the creation,
fcntlInt must be exposed.
Test: new tests added, passing
Change-Id: If30d3750734a5a3910587a06df334c04fad92703
|
| |
|
|
|
|
|
|
|
| |
bug: 145355521
bug: 145607042
test:
atest CtsLibcoreTestCases:libcore.android.system.OsTest
Change-Id: I14a78ea8f6434e0590f7096bcda5e1d0f13a6679
|
| |
|
|
|
|
| |
Bug: 143725805
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Change-Id: I5a27c2368201c5f49dca0774f61d1431cc1430dd
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
API clean-up around PacketSocketAddress:
1) Use of short / byte for enum ints in Java is awkward because
literals are "int", requiring casts. All constants in OsConstants
are defined as ints which also require casts. This commit moves to
int for PacketSocketAddress fields.
2) The constants to make sense of some PacketSocketAddress values
were missing and have been added to the Core Platform API.
Note that sll_pkttype is only set when receiving a packet, and there's
no function on Os that supports data and address to be returned (i.e.
there's no recvfrom() variant that allows for PacketSocketAddress) so
it's mostly useless and the associated constants have not been added to
@CorePlatformApi. If Android wanted to support PacketSocketAddress
fully then it's likely that the PacketSocketAddress will need to be
revisited (i.e. some or all fields made non-final) and the constants
can be exposed at that time.
Test: build / boot
Test: Removed the test from knownfailures.txt / ran OsTest on -eng build
with vogar
Bug: 135660232
Change-Id: I2ef79a3e18f6ffa890d897ac2db54f6fa8c0357a
|
| |
|
|
|
|
|
|
|
| |
Continuing the long process of shrinking the core platform API
by switching users, particularly tests, to alternatives.
Bug: 124232146
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Change-Id: If1a473f4d7a120723602faa70129ead1bf8ebc64
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Testing the implementation method is inconsistent with the other methods
tested by OsTest, and offers little value because (a) it is not part of any
API surface and (b) Android's implementation in android.system.Os.sendfile()
directly delegates to it.
That the other version was ever tested is a historical accident: Before
http://r.android.com/937425 (bug 129523169), generally only the *internal*
version of each of these methods was tested. When the test for sendfile()
was added, the need to test the actual public API surface was recognized
but the code also wanted to stay consistent with the rest of the test, so
coverage for both was added. Now that the other OsTest methods have moved
to testing the public API, there is no longer a consistency reason for
also testing the private API.
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Change-Id: Iacb32601f2714a50172b79c14231a0b1a26a70a9
|
| |
|
|
|
|
|
|
|
|
| |
The parent CL reformatted OsTest.java using IntelliJ's automated reformatter
(Code / Reformat Code). It messed up in a handful of places, creating lines
that were too long (in line comments) or too short (in block comments). This
CL manually corrects these minor mistakes.
Test: Treehugger
Change-Id: I14fd7a3d58fffdb60e88b3dca7c7fe47ad1481a4
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This CL was created via Code / Reformat Code (Ctrl+Alt+L) in
IntelliJ. Note that the reformatting also introduced newlines
(including empty lines) and other whitespace.
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Test: Confirmed that the following steps resulted in no net
changes to the commit:
git checkout HEAD^ luni/src/test/java/libcore/android/system/OsTest.java
re-run Code / Reformat Code
Change-Id: Iba672674cd14793de82641f34ca55bb55f5cdb39
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libcore.libcore.io.OsTest was testing libcore.io.Libcore.os, which is the
implementation of android.system.Os. This CL moves all applicable parts
into libcore.android.system.OsTest and makes them test android.system.Os
instead, since that is the public API.
Notes:
- android.system.OsTest still covers both versions of sendfile()
(via enum SendFileImpl) like the old test did. In a future CL,
we could optionally drop coverage for the libcore.io version
since it's not part of any API surface.
- libcore.io.Os has a method accept(FileDescriptor, SocketAddress) but
android.system.Os has accept(FileDescriptor, InetSocketAddress).
OsTest calls accept() both with InetSocketAddress and
UnixSocketAddress compile-time types. This CL adds a @hide method
android.system.Os.accept(FileDescriptor, SocketAddress) and delegates
to it from the InetSocketAddress method; this way, the existing
tests can be reused for android.system.Os.
- Even though android/system/OsTest.java did not exist before this
CL, I've kept the existing file header from the existing OsTest.java
from which the contents of the file are derived.
- One test is known to be failing; this CL updates the expectations
file to the new name.
Fixes: 129523169
Test: atest CtsLibcoreTestCases:libcore.android.system.OsTest
Test: atest CtsLibcoreTestCases:libcore.libcore.io.OsTest
Test: Used meld to compare libcore/io/OsTest.java from before this CL
vs. android/system/OsTest.java after this CL to confirm that
the only differences are (a) Libcore.{os,rawOs}. -> Os.,
(b) removal of the logic that remained in libcore/io/OsTest.java
Change-Id: Ic6d7ef683a26ae8a7198a30638bfaa87012f3b11
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
@Test rethrow() covers non-SDK CorePlatformApi and IntraCoreApi.
Fixes: 129200494
Test: atest CtsLibcoreTestCases:libcore.android.system.ErrnoExceptionTest
Change-Id: Id80d4934f134ef8e8c43ace5b9f3aab6973ce492
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
Prepare to add Os.getSockOptTimeVal() and Os.setSockOptTimeVal()
to the public SDK API surface along with StructTimeVal. This will also
enable them to be removed from the core-platform and intra-core APIs.
Test: atest CtsLibcoreTestCases:libcore.android.system.StructTimevalTest
Test: atest CtsLibcoreTestCases:libcore.libcore.io.OsTest
Bug: 129251251
Bug: 117867568
Bug: 129433363
Change-Id: Ie0b629195f1aac50d78b61203d2f7b91be3454c9
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Android makes the function socketpair() publicly visible, but never made
SOCK_CLOEXEC nor SOCK_NONBLOCK visible. Java socketpair() users have no
approved flag to ensure sockets are immediately created with O_CLOEXEC,
nor set the non-blocking status on sockets.
socketpair() documentation:
https://developer.android.com/reference/android/system/Os.html#socketpair(int,%20int,%20int,%20java.io.FileDescriptor,%20java.io.FileDescriptor)
Test: compiles
Test: cts-tradefed run cts -m CtsLibcoreTestCases -t libcore.android.system.OsConstantsTest
Bug: 120983106
Change-Id: Iba6bd318b14faad1696e5ea5d346d2f2f85b8044
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The integration of OpenJDK 9 javac into the Android build system
requires non-libcore code to live in non-libcore packages, as
long as that code isn't considered part of the same module as
libcore at javac time.
This CL moves libcore test related classes out of such
packages; since libcore tests could already only test
public (as opposed to package private APIs), no change
other than the package name and imports is necessary.
Because many libcore tests already live below a top-level
package "libcore" (eg., the tests for java.util are in
libcore.java.util), this CL likewise prepends "libcore."
to the package names of affected classes. For classes
relating to libcore.* packages, this results in a package
name of the form "libcore.libcore.*".
Alternative considered but not pursued:
To compile the test classes without moving the out of a libcore
package, javac would need to consider them to be in the same
module as libcore. This would likely be possible via
javac --patch-module, but this has not been explored in detail
because:
- Most luni tests are already in a toplevel package libcore.*,
so this CL makes the test structure more consistent.
- Use of --patch-module would likely cause problems when running
tests under a runtime that implements the OpenJDK 9 module
system; for example, --patch-module cannot add exported
packages to the module, so any new packages added in tests
(such as the libcore.* packages of most existing luni tests)
would not be visible at test runtime.
- Having tests in different packages from code under tests makes
it more obvious (including to IDEs in which the code might be
edited as a single project) that these tests cannot access
package-private identifiers in the code under test.
Test: Treehugger
Test: "make cts" with EXPERIMENTAL_USE_OPENJDK9=true
passes with additional changes present locally
that have not yet been exported as CLs.
Test: CtsLibcoreTestCases
Bug: 68224249
Bug: 68932217 (tracks potential follow-up work)
Change-Id: Ib6b8e6f3bc87093bc219d2108e601163c6e334cd
|
| |
|
|
|
|
|
| |
Test: cts-tradefed run cts-dev -m CtsContentTestCases --test=android.content.cts.SharedPreferencesTest
cts-tradefed run cts-dev -m CtsLibcoreTestCases --test=libcore.android.system.StructTimespecTest
Bug: 62949739
Change-Id: I503d0d9fb696051924c17b12b3a708954fb01bc2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is for systems whose tcp.h defines this constant, which is
true for bionic on recent versions of Android but not the prebuilt
glibc-2.15-4.8 currently on host (checked for host/x86_64).
Exposed android.system.Os.setsocketoptInt(). Added a test that
checks that TCP_USER_TIMEOUT can be set and gotten from stream
sockets. Since this is just piping through behavior from the
kernel, added no tests for the semantics of that socket option.
Test: Checked that the newly added tests pass in cts on Nexus6P.
Bug: 30402085
Change-Id: I5fb9e491ce5c856587423d074e9fa3c4b722d956
|
| |
|
|
| |
Change-Id: Id14719899f5dcbd1da1f5067b6d54db9cb506f64
|
|
|
RT_* constants are enum members in the UAPI so we can't
use #define checks for them. Also fix a typo in the define
check for an IFA_ constant.
More generally, we should get rid of all these conditional
checks for target builds because we know what version of the
UAPI we have in bionic. We should move these conditional
checks under #if HOST_BUILD or something similar.
bug: 15602893
Change-Id: I3affc10773ade4dac68c176f79962ca8ad312579
|