diff -r a5ed9456c9be -r 0676e37a0b9c jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java --- a/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java Tue Feb 23 09:49:04 2016 +0100 +++ b/jdk/test/java/nio/channels/ServerSocketChannel/SocketOptionTests.java Tue Feb 23 17:41:00 2016 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,8 +49,11 @@ // check supported options Set> options = ssc.supportedOptions(); + boolean reuseport = options.contains(SO_REUSEPORT); if (!options.contains(SO_REUSEADDR)) throw new RuntimeException("SO_REUSEADDR should be supported"); + if (!options.contains(SO_REUSEPORT) && reuseport) + throw new RuntimeException("SO_REUSEPORT should be supported"); if (!options.contains(SO_RCVBUF)) throw new RuntimeException("SO_RCVBUF should be supported"); @@ -64,6 +67,12 @@ checkOption(ssc, SO_REUSEADDR, true); ssc.setOption(SO_REUSEADDR, false); checkOption(ssc, SO_REUSEADDR, false); + if (reuseport) { + ssc.setOption(SO_REUSEPORT, true); + checkOption(ssc, SO_REUSEPORT, true); + ssc.setOption(SO_REUSEPORT, false); + checkOption(ssc, SO_REUSEPORT, false); + } // NullPointerException try {