Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8246431: java/net/httpclient/PathSubscriber tests fail due to missing…
… FilePermission

Add explicit jtreg build configuration and adjust permissions accordingly

Reviewed-by: chegar, dfuchs
  • Loading branch information
FrauBoes committed Jun 8, 2020
1 parent f87ef60 commit 3943f9d0b78fc9181c1c9140a8a7048125cce4e7
@@ -32,8 +32,12 @@
* java.net.http/jdk.internal.net.http.hpack
* jdk.httpserver
* @library /test/lib ../http2/server
* @compile ../HttpServerAdapters.java
* @build Http2TestServer Http2TestServerConnection Http2TestExchange
* Http2Handler OutgoingPushPromise Queue
* @build jdk.test.lib.net.SimpleSSLContext
* @build jdk.test.lib.Platform
* @build jdk.test.lib.util.FileUtils
* @compile ../HttpServerAdapters.java
* @run testng/othervm BodyHandlerOfFileDownloadTest
* @run testng/othervm/java.security.policy=ofFileDownload.policy BodyHandlerOfFileDownloadTest
*/
@@ -33,8 +33,12 @@
* java.net.http/jdk.internal.net.http.hpack
* jdk.httpserver
* @library /test/lib ../http2/server
* @compile ../HttpServerAdapters.java
* @build Http2TestServer Http2TestServerConnection Http2TestExchange
* Http2Handler OutgoingPushPromise Queue
* @build jdk.test.lib.net.SimpleSSLContext
* @build jdk.test.lib.Platform
* @build jdk.test.lib.util.FileUtils
* @compile ../HttpServerAdapters.java
* @run testng/othervm BodyHandlerOfFileTest
* @run testng/othervm/java.security.policy=ofFile.policy BodyHandlerOfFileTest
*/
@@ -33,8 +33,12 @@
* java.net.http/jdk.internal.net.http.hpack
* jdk.httpserver
* @library /test/lib ../http2/server
* @compile ../HttpServerAdapters.java
* @build Http2TestServer Http2TestServerConnection Http2TestExchange
* Http2Handler OutgoingPushPromise Queue
* @build jdk.test.lib.net.SimpleSSLContext
* @build jdk.test.lib.Platform
* @build jdk.test.lib.util.FileUtils
* @compile ../HttpServerAdapters.java
* @run testng/othervm BodySubscriberOfFileTest
* @run testng/othervm/java.security.policy=ofFile.policy BodySubscriberOfFileTest
*/
@@ -21,7 +21,7 @@
// questions.
//

// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
// for test/lib library classes
grant codeBase "file:${test.classes}/../../../../../test/lib/-" {
permission java.util.PropertyPermission "java.vm.info", "read";
permission java.util.PropertyPermission "jdk.debug", "read";
@@ -31,9 +31,14 @@ grant codeBase "file:${test.classes}/../../../../../test/lib/-" {
permission java.util.PropertyPermission "test.src.path", "read";
permission java.util.PropertyPermission "user.name", "read";
permission java.io.FilePermission "${test.src}/../../../../../lib/jdk/test/lib/net/testkeys", "read";

// file permissions for test files
permission java.io.FilePermission "${user.dir}${/}defaultFile.txt", "read,delete";
permission java.io.FilePermission "${user.dir}${/}file.zip", "delete";
permission java.io.FilePermission "${user.dir}${/}defaultDir", "delete";
};

// for JTwork/classes/0/java/net/httpclient/http2/server/*
// for java/net/httpclient/http2/server/*
grant codeBase "file:${test.classes}/../../../../../java/net/httpclient/http2/server/*" {
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.common";
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.frame";
@@ -54,9 +59,9 @@ grant codeBase "file:${test.classes}/*" {
permission java.net.URLPermission "http://localhost:*/http2/echo", "GET";
permission java.net.URLPermission "https://localhost:*/https2/echo", "GET";

// file permissions
// file permissions for test files
permission java.io.FilePermission "${user.dir}${/}defaultFile.txt", "read,write,delete";
permission java.io.FilePermission "${user.dir}${/}file.zip", "read,write,delete";
permission java.io.FilePermission "${user.dir}${/}file.zip", "read,write";
permission java.io.FilePermission "${user.dir}${/}defaultDir", "read,write,delete";

// file permission required by ZipFileSystem for temporary file creation
@@ -21,7 +21,7 @@
// questions.
//

// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
// for test/lib library classes
grant codeBase "file:${test.classes}/../../../../../test/lib/-" {
permission java.util.PropertyPermission "java.vm.info", "read";
permission java.util.PropertyPermission "jdk.debug", "read";
@@ -31,9 +31,14 @@ grant codeBase "file:${test.classes}/../../../../../test/lib/-" {
permission java.util.PropertyPermission "test.src.path", "read";
permission java.util.PropertyPermission "user.name", "read";
permission java.io.FilePermission "${test.src}/../../../../../lib/jdk/test/lib/net/testkeys", "read";

// file permissions for test files
permission java.io.FilePermission "${user.dir}${/}file.zip", "delete";
permission java.io.FilePermission "${user.dir}${/}defaultDir", "read,delete";
permission java.io.FilePermission "${user.dir}${/}defaultDir/*", "read,delete";
};

// for JTwork/classes/0/java/net/httpclient/http2/server/*
// for java/net/httpclient/http2/server/*
grant codeBase "file:${test.classes}/../../../../../java/net/httpclient/http2/server/*" {
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.common";
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.net.http.frame";
@@ -54,8 +59,8 @@ grant codeBase "file:${test.classes}/*" {
permission java.net.URLPermission "http://localhost:*/http2/echo", "GET";
permission java.net.URLPermission "https://localhost:*/https2/echo", "GET";

// file permissions
permission java.io.FilePermission "${user.dir}${/}file.zip", "read,write,delete";
// file permissions for test files
permission java.io.FilePermission "${user.dir}${/}file.zip", "read,write";
permission java.io.FilePermission "${user.dir}${/}defaultDir", "read,write,delete";
permission java.io.FilePermission "${user.dir}${/}defaultDir/*", "read,write,delete";

0 comments on commit 3943f9d

Please sign in to comment.