8265019: Update tests for additional TestNG test permissions

Reviewed-by: naoto, bpb, alanb
This commit is contained in:
Lance Andersen 2021-04-14 15:42:55 +00:00
parent 7e4cd48020
commit ffb3771816
2 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, 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
@ -23,6 +23,7 @@
import java.io.FilePermission;
import java.io.IOException;
import java.lang.reflect.ReflectPermission;
import java.security.CodeSource;
import java.security.Permission;
import java.security.PermissionCollection;
@ -205,14 +206,19 @@ class TestPolicy extends Policy {
permissions.add(new RuntimePermission("getClassLoader"));
permissions.add(new RuntimePermission("setSecurityManager"));
permissions.add(new RuntimePermission("createSecurityManager"));
permissions.add(new PropertyPermission("testng.show.stack.frames",
"read"));
permissions.add(new PropertyPermission("user.dir", "read"));
permissions.add(new PropertyPermission("test.src", "read"));
permissions.add(new PropertyPermission("file.separator", "read"));
permissions.add(new PropertyPermission("line.separator", "read"));
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
permissions.add(new PropertyPermission("testng.show.stack.frames",
"read"));
permissions.add(new PropertyPermission("testng.thread.affinity", "read"));
permissions.add(new PropertyPermission("testng.mode.dryrun", "read"));
permissions.add(new PropertyPermission("testng.report.xml.name", "read"));
permissions.add(new PropertyPermission("testng.timezone", "read"));
permissions.add(new ReflectPermission("suppressAccessChecks"));
permissions.add(new FilePermission("<<ALL FILES>>", "execute"));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, 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
@ -23,6 +23,7 @@
package util;
import java.io.FilePermission;
import java.lang.reflect.ReflectPermission;
import java.security.AllPermission;
import java.security.CodeSource;
import java.security.Permission;
@ -102,12 +103,17 @@ public class TestPolicy extends Policy {
permissions.add(new RuntimePermission("getClassLoader"));
permissions.add(new RuntimePermission("setSecurityManager"));
permissions.add(new RuntimePermission("createSecurityManager"));
permissions.add(new PropertyPermission("testng.show.stack.frames",
"read"));
permissions.add(new PropertyPermission("line.separator", "read"));
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
permissions.add(new PropertyPermission("testng.show.stack.frames",
"read"));
permissions.add(new PropertyPermission("testng.thread.affinity", "read"));
permissions.add(new PropertyPermission("testng.mode.dryrun", "read"));
permissions.add(new PropertyPermission("testng.report.xml.name", "read"));
permissions.add(new PropertyPermission("testng.timezone", "read"));
permissions.add(new ReflectPermission("suppressAccessChecks"));
permissions.add(new FilePermission("<<ALL FILES>>",
"read, write, delete"));
}