Merge
This commit is contained in:
commit
0c6ea7bab0
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2017, 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
|
||||
@ -44,7 +44,6 @@ import java.lang.management.ManagementFactory;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.registry.LocateRegistry;
|
||||
import java.rmi.registry.Registry;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Properties;
|
||||
import javax.management.Attribute;
|
||||
@ -57,24 +56,11 @@ import javax.management.remote.JMXConnector;
|
||||
import javax.management.remote.JMXConnectorFactory;
|
||||
import javax.management.remote.JMXConnectorServer;
|
||||
import javax.management.remote.JMXConnectorServerFactory;
|
||||
import javax.management.remote.JMXPrincipal;
|
||||
import javax.management.remote.JMXServiceURL;
|
||||
import javax.security.auth.Subject;
|
||||
|
||||
public class SubjectDelegation2Test {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Check for supported operating systems: Solaris
|
||||
//
|
||||
// This test runs only on Solaris due to CR 6285916
|
||||
//
|
||||
String osName = System.getProperty("os.name");
|
||||
System.out.println("os.name = " + osName);
|
||||
if (!osName.equals("SunOS")) {
|
||||
System.out.println("This test runs on Solaris only.");
|
||||
System.out.println("Bye! Bye!");
|
||||
return;
|
||||
}
|
||||
String policyFile = args[0];
|
||||
String testResult = args[1];
|
||||
System.out.println("Policy file = " + policyFile);
|
||||
@ -137,9 +123,8 @@ public class SubjectDelegation2Test {
|
||||
// Create an RMI connector server
|
||||
//
|
||||
System.out.println("Create an RMI connector server");
|
||||
JMXServiceURL url =
|
||||
new JMXServiceURL("rmi", null, 0,
|
||||
"/jndi/rmi://:" + port + "/server" + port);
|
||||
JMXServiceURL url = new JMXServiceURL("rmi", null, 0);
|
||||
|
||||
jmxcs =
|
||||
JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
|
||||
jmxcs.start();
|
||||
@ -151,7 +136,7 @@ public class SubjectDelegation2Test {
|
||||
//
|
||||
String[] credentials = new String[] { "monitorRole" , "QED" };
|
||||
cli_env.put("jmx.remote.credentials", credentials);
|
||||
jmxc = JMXConnectorFactory.connect(url, cli_env);
|
||||
jmxc = JMXConnectorFactory.connect(jmxcs.getAddress(), cli_env);
|
||||
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
|
||||
// Get domains from MBeanServer
|
||||
//
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2017, 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
|
||||
@ -65,17 +65,6 @@ import javax.security.auth.Subject;
|
||||
public class SubjectDelegation3Test {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Check for supported operating systems: Solaris
|
||||
//
|
||||
// This test runs only on Solaris due to CR 6285916
|
||||
//
|
||||
String osName = System.getProperty("os.name");
|
||||
System.out.println("os.name = " + osName);
|
||||
if (!osName.equals("SunOS")) {
|
||||
System.out.println("This test runs on Solaris only.");
|
||||
System.out.println("Bye! Bye!");
|
||||
return;
|
||||
}
|
||||
String policyFile = args[0];
|
||||
String testResult = args[1];
|
||||
System.out.println("Policy file = " + policyFile);
|
||||
@ -139,8 +128,7 @@ public class SubjectDelegation3Test {
|
||||
//
|
||||
System.out.println("Create an RMI connector server");
|
||||
JMXServiceURL url =
|
||||
new JMXServiceURL("rmi", null, 0,
|
||||
"/jndi/rmi://:" + port + "/server" + port);
|
||||
new JMXServiceURL("rmi", null, 0);
|
||||
jmxcs =
|
||||
JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
|
||||
jmxcs.start();
|
||||
@ -152,7 +140,7 @@ public class SubjectDelegation3Test {
|
||||
//
|
||||
String[] credentials = new String[] { "monitorRole" , "QED" };
|
||||
cli_env.put("jmx.remote.credentials", credentials);
|
||||
jmxc = JMXConnectorFactory.connect(url, cli_env);
|
||||
jmxc = JMXConnectorFactory.connect(jmxcs.getAddress(), cli_env);
|
||||
Subject delegationSubject =
|
||||
new Subject(true,
|
||||
Collections.singleton(new JMXPrincipal("delegate")),
|
||||
|
@ -2,6 +2,7 @@ grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission javax.management.MBeanPermission "*", "getDomains";
|
||||
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
|
||||
permission javax.security.auth.AuthPermission "getSubject";
|
||||
|
@ -1,6 +1,7 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
// permission javax.management.MBeanPermission "*", "getDomains";
|
||||
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
|
||||
|
@ -1,6 +1,7 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.MBeanPermission "*", "getDomains";
|
||||
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
|
||||
|
@ -1,5 +1,6 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
|
||||
|
@ -1,5 +1,6 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
|
||||
|
@ -1,6 +1,7 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.MBeanPermission "*", "getDomains";
|
||||
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
|
||||
|
@ -1,6 +1,7 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
// permission javax.management.MBeanPermission "*", "getDomains";
|
||||
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
|
||||
|
@ -1,6 +1,7 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.MBeanPermission "*", "getDomains";
|
||||
permission javax.management.MBeanPermission "SimpleStandard#State[MBeans:type=SimpleStandard]", "getAttribute";
|
||||
|
@ -1,5 +1,6 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
|
||||
|
@ -1,5 +1,6 @@
|
||||
grant codebase "file:/-" {
|
||||
permission javax.security.auth.AuthPermission "createLoginContext.JMXPluggableAuthenticator";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
permission java.net.SocketPermission "*:*", "accept,connect,listen,resolve";
|
||||
permission java.security.SecurityPermission "createAccessControlContext";
|
||||
permission javax.management.remote.SubjectDelegationPermission "javax.management.remote.JMXPrincipal.monitorRole";
|
||||
|
@ -58,6 +58,11 @@ public abstract class DynamicLauncher {
|
||||
}
|
||||
}
|
||||
} while (tryAgain);
|
||||
output.shouldHaveExitValue(0);
|
||||
// java.lang.Exception is thrown by JdpTestCase if something goes wrong
|
||||
// for instance - see JdpTestCase::shutdown()
|
||||
output.shouldNotContain("java.lang.Exception:");
|
||||
output.shouldNotContain("Error: Could not find or load main class");
|
||||
}
|
||||
|
||||
protected OutputAnalyzer runVM() throws Exception {
|
||||
|
@ -40,7 +40,6 @@ public class JdpJmxRemoteDynamicPortTest extends DynamicLauncher {
|
||||
public static void main(String[] args) throws Exception {
|
||||
DynamicLauncher launcher = new JdpJmxRemoteDynamicPortTest();
|
||||
launcher.run();
|
||||
launcher.getProcessOutpoutAnalyzer().stderrShouldNotContain("java.lang.Exception:");
|
||||
}
|
||||
|
||||
protected String[] options() {
|
||||
|
Loading…
Reference in New Issue
Block a user