History log of /libcore/luni/src/test/java/libcore/java/nio/channels/DatagramChannelMulticastTest.java
Revision Date Author Comments
76c13bb7c7079351105a98588f13f12b9511e516 18-Aug-2017 Tobias Thierer <tobiast@google.com> Fix DatagramChannelMulticastTest.test_joinSourceSpecific_groupBind_ipv4

The test was passing the wrong NetworkInterface (IPv6 instead of IPv4)
to a helper method; this would fail if that network interface didn't
also support IPv4.

Bug: 64825787
Test: DatagramChannelMulticastTest

(cherry picked from commit 4aa761e49c9dcf534f8fc66389bd70323942aaf4)

Change-Id: Ic934a03adc8e43dfdb3b50ba215933cf992fb58b
Merged-In: Ic934a03adc8e43dfdb3b50ba215933cf992fb58b
7cd7bf2e543625280ac22d7b2a18ffa3e3cbbe44 18-Aug-2017 Tobias Thierer <tobiast@google.com> Fix DatagramChannelMulticastTest.test_joinSourceSpecific_groupBind_ipv4

The test was passing the wrong NetworkInterface (IPv6 instead of IPv4)
to a helper method; this would fail if that network interface didn't
also support IPv4.

Bug: 64825787
Test: DatagramChannelMulticastTest

(cherry picked from commit 4aa761e49c9dcf534f8fc66389bd70323942aaf4)

Change-Id: Ic934a03adc8e43dfdb3b50ba215933cf992fb58b
2c9bf1099057a50df42d7257b2e16115051e1370 03-Jul-2017 Shigeki Yokomichi <shigeki.x.yokomichi@sonymobile.com> Fix DatagramChannelMulticastTest#test_multicastLoopOption_IPv6

DatagramChannelMulticastTest#test_multicastLoopOption_IPv6 was failed
because any SocketAddress can't be received from DatagramChannel.
The defect comes from that network interface for send is unspecified
to the DatagramChannel while sending multicast datagrams.
We should apply the modification of
"Fix DatagramChannelMulticastTest#test_joinAnySource_IPv6" here as well.

Bug: 63515474
Test: libcore.java.nio.channels.DatagramChannelMulticastTest
Test: Confirmed that on some devices, the following test
fails before this CL:
libcore.java.nio.channels.DatagramChannelMulticastTest#test_multicastLoopOption_IPv6

(cherry picked from commit 5ff0c539e8e8944a8d5aab97669fc0b6b0b3288e)

Change-Id: Ib31c2b0d24badc70f21fa4577de540589564ad41
010656b2ffba828db9179727087437e1e0701ed0 21-Jun-2017 Lorenzo Colitti <lorenzo@google.com> Fix DatagramChannelMulticastTest#test_joinAnySource_IPv6

This test works by sending a packet and ensuring that we receive
it. But while we specify the interface to receive on
(specifically: ipv6NetworkInterface), we don't specify which
interface to send the packet on. As a result, the kernel is free
to use whatever interface it wants. When the test fails, the
kernel picks the wrong interface.

Bug: 38167941
Test: make cts && cts-tradefed run singleCommand cts -a arm64-v8a \
-m CtsLibcoreTestCases -t libcore.java.nio.channels.DatagramChannelMulticastTest
Change-Id: Ie7d62901adfbf5b37c5ad8a67d299b7b15955ce3
f393ec80c97a5baa736abe6ecfb074138988165d 21-Jun-2017 Tobias Thierer <tobiast@google.com> Rename DatagramChannelMulticastTest helper methods.

Rename private methods from test_* to check_* since they're not tests.

Bug: 38167941
Test: Treehugger
Change-Id: I0a15b61c4d22e0a516b2813ff89c157fe6bebf7a
4f51e6cf5f53293434b1ddd69bc6bb449898ae68 21-Jun-2017 Lorenzo Colitti <lorenzo@google.com> Fix DatagramChannelMulticastTest#test_joinAnySource_IPv6

This test works by sending a packet and ensuring that we receive
it. But while we specify the interface to receive on
(specifically: ipv6NetworkInterface), we don't specify which
interface to send the packet on. As a result, the kernel is free
to use whatever interface it wants. When the test fails, the
kernel picks the wrong interface.

Bug: 38167941
Test: make cts && cts-tradefed run singleCommand cts -a arm64-v8a \
-m CtsLibcoreTestCases -t libcore.java.nio.channels.DatagramChannelMulticastTest
Change-Id: Ie7d62901adfbf5b37c5ad8a67d299b7b15955ce3
ebed02ce4e5b38af8f695822f108cca6360a2da4 17-May-2017 bohu <bohu@google.com> Skip multicast test if it is not supported

DatagramChannelMulticastTest had some tests that
would not check the supportsMulticast flag to see
if they should execute before accessing fields that
are not initialized when supportsMulticast
is false.

supportsMulticast is set to false when the system
property "android.cts.device.multicast" is "false"
(normally provided by the CTS runner).

Thanks to bohu@ for the original fix.

BUG: 37719321
Test: vogar --vm-arg "-Dandroid.cts.device.multicast=false" \
luni/src/test/java/libcore/java/nio/channels/DatagramChannelMulticastTest.java

(cherry picked from commit f515ad8fb5dac39b9e32f4cd06097ecaabb10fbd)

Change-Id: Ifb5dc448d9f72b1267d133c5b0b13983e79a8ebe
f515ad8fb5dac39b9e32f4cd06097ecaabb10fbd 17-May-2017 bohu <bohu@google.com> Skip multicast test if it is not supported

DatagramChannelMulticastTest had some tests that
would not check the supportsMulticast flag to see
if they should execute before accessing fields that
are not initialized when supportsMulticast
is false.

supportsMulticast is set to false when the system
property "android.cts.device.multicast" is "false"
(normally provided by the CTS runner).

Thanks to bohu@ for the original fix.

BUG: 37719321
Test: vogar --vm-arg "-Dandroid.cts.device.multicast=false" \
luni/src/test/java/libcore/java/nio/channels/DatagramChannelMulticastTest.java
Change-Id: I0d3de3512b8f8ac300546f072eb98e760ccfbe66
d880e69f88b68996b19385d55bcdfe7796f95e02 05-Dec-2016 Yi Kong <yikong@google.com> Move blockUntilAvailableOrTimeout method to IoBridge

... so that we can reuse this method in other classes.

Test: java.nio.channels.DatagramChannelMulticastTest
Change-Id: Ibf6c1a6bef3cc1d0f76387331159f0c9a383a919
6a68248983b32c8fe6e6c330ac8e09853b4e61b1 30-Nov-2016 Yi Kong <yikong@google.com> [DatagramChannelMulticastTest] poll before receive

Make sure packets are given enough time to be delievered before we
assert that receive succeeds.

Test: libcore.java.nio.channels.DatagramChannelMulticastTest
Bug: 33100308
Change-Id: Iceb6d4413bc8de6c42f1dc2c43de9602b2152d17
2e5060e06146d114175319477783488d2360da93 14-Sep-2016 Shubham Ajmera <shubhamajmera@google.com> Add missing datagram channel #close statement.

Test: Ran 'cts-tradefed run cts -m CtsLibcoreTestCases -t \
libcore.java.nio.channels.DatagramChannelMulticastTest' on GCE device.

Bug: 31391600
Change-Id: I764ce920f363639bcbcfe74e4ad3372ab390a87c
d4b7449574ca69c713a3f2230cb77c68ee642700 06-Sep-2016 Tobias Thierer <tobiast@google.com> Fix 58 libcore tests that caught "expected" Exceptions but didn't fail()

There were no changes to code under test.

4 tests were fixed to not tolerate an Exception:
- libcore.java.util.CollectionsTest#test_CheckedMap_computeIfAbsent
In the case where a Map key is present, computeIfAbsent() should
not invoke the Function, so there is no return value that could
be expected to undergo a type check. The test was changed to
verify that the Function is not invoked.
- libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_sort and
libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_subList_sort
were sorting an already-sorted non-null list that contains no null
values. That logic was redundant and wouldn't have thrown.
- org.apache.harmony.security.tests.java.security.KeyStoreSpiTest#test_engineEntryInstanceOf
(the KeyStoreSpi documentation does not mention whether NPE is thrown;
the implementation comes from upstream and does not throw it).

54 tests were fixed by adding the missing
fail();
No attempt was made to make this failure message specific to the
exception that was expected.

Tests that weren't changed:

- SSLEngineTest.test_wrap_ByteBuffer_ByteBuffer_04() requires
investigation to determine the correct resolution.
A comment was added to the test linking to the corresponding bug.

- ThreadTest#testParkUntilWithUnderflowValue() and
OldNodeChangeEventTest.waitForEvent() were not touched since
it was not clear whether that it was relevent to the test whether
or not the exception was thrown.

- two cases in Files2Test#test_setPosixFilePermissions_NPE() are
left to a future CL

Test:
(croot; make vogar core-tests) \
&& git diff aosp/master --name-only | xargs vogar `cparg core-tests`

Change-Id: I1cd3220a06e331ff049b146b393f78879f07211a
d27d16405ee9c9753d253bc311bf00f5de2e25b5 07-Jul-2016 Shubham Ajmera <shubhamajmera@google.com> Fix IPv6 DatagramChannelMulticastTest

The default network interface for the tests was to support both IPv4 and
IPv6, however, there was no check to make sure that.
Now, independent network selection is done for both IPv4 and IPv6 tests.

Also added a waiver for devices which don't support multicast.

Bug: 30008753
Test: Ran the test on Hammerhead & Shamu using Vogar.
Change-Id: I298cceafc8901fbcc48a2548b93326771b47ba0b
aea78555169709a2586b585e61414d9aee1d8e28 13-May-2016 Neil Fuller <nfuller@google.com> Add multicast channel tests for DatagramChannel

Bug: 27214236
Change-Id: I66be0e4f97516ea1991cf69e068028ecc37f914a
0aff1dd0b4be1b8d8cb45b59079ca883a1b3205a 17-Jun-2014 Elliott Hughes <enh@google.com> Remove.

(cherry-pick of 63744c884dd4b4f4307f2b021fb894af164972af.)

Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
63744c884dd4b4f4307f2b021fb894af164972af 17-Jun-2014 Elliott Hughes <enh@google.com> Remove.

Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
6d7b081971d12b25426c46e4989e7df3a5995eae 09-Jun-2014 Neil Fuller <nfuller@google.com> Fix DatagramMulticastChannelTest so it works better on hammerhead

Some android devices have a WiFi-direct interface (p2p0) that
probably shares underlying hardware with the standard wireless
interface (wlan0).

On hammerhead, when Wifi-direct is disconnected this interface
appears to (only) have an IPv6 address and is "up" and
"support multicast". The test was not tested on this hardware
when it was written.

Mako devices have the same behavior but the wlan0 interface most
likely discovered first. The ordering of interfaces may also not
be stable.

The other breakages were due to implicit assumptions that the
device supports both IPv4 and IPv6 on a single interface.
The tests also rely on the IP_MULTICAST_LOOP option to receive
packets sent out. There were some other bugs that were probably
the result of assuming that when the interface was left
unspecified the device would route outgoing packets via the interface
the test was listening on. With multiple interfaces available
those tests were flaky.

Bug: 15509450
Change-Id: I33f71e26379a53334dce9991043c3a9a21000d02
41b3a250ad7f07807b9567cb292d0f9b9287065c 07-Mar-2014 Neil Fuller <nfuller@google.com> Fix incorrectly worded assertion failure.

The failure occurs when the test is run on a device without
enough network interfaces. When running CTS tests on a freshly
flashed device the wifi interface is defaulted to off, which
means it may be seen so it's worth fixing.

Change-Id: I39d533030afe0760c343d4b8c6b858b27e0abfc9
df29508a7aa622f265aaebdc472eb7d679185ebb 30-Jan-2014 Neil Fuller <nfuller@google.com> Implementation of MulticastChannel.

Note: ProtocolFamily / StandardProtocolFamily /
DatagramChannel.open(ProtocolFamily) have not been
implemented.

There is a related change to libnativehelper that
must be merged at the same time to avoid
build breakage. See
https://android-review.googlesource.com/#/c/81371/

Bug: 12464155
Change-Id: I07fc049b429a2d373e9bd7b07149632f5cd69f9d