8173257: test/script/trusted/JDK-8021189.js and test/script/trusted/JDK-8021129.js fail in nashorn nightly
authorsundar
Tue, 24 Jan 2017 18:08:04 +0530
changeset 43348 cfa58a828e96
parent 43282 45b751afd11e
child 43349 be6e40f785d7
8173257: test/script/trusted/JDK-8021189.js and test/script/trusted/JDK-8021129.js fail in nashorn nightly Reviewed-by: hannesw, jlaskey
nashorn/make/build.xml
nashorn/make/project.properties
--- a/nashorn/make/build.xml	Wed Jul 05 22:44:47 2017 +0200
+++ b/nashorn/make/build.xml	Tue Jan 24 18:08:04 2017 +0530
@@ -394,6 +394,18 @@
 
   </target>
 
+  <target name="generate-security-config" depends="generate-policy-file, generate-security-properties-file"/>
+
+  <target name="generate-security-properties-file" depends="prepare">
+    <echo file="${build.dir}/nashorn.security.properties">
+
+package.access=sun.misc.,\
+    sun.reflect.,\
+    jdk.nashorn.internal.
+
+    </echo>
+  </target>
+
   <target name="generate-policy-file" depends="prepare">
     <echo file="${build.dir}/nashorn.policy">
 
@@ -600,7 +612,7 @@
 
   <target name="test" depends="prepare, javadoc, test-pessimistic, test-optimistic"/>
 
-  <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
     <echo message="Running test suite in OPTIMISTIC mode..."/>
     <antcall target="-test-nosecurity" inheritRefs="true">
       <param name="optimistic" value="true"/>
@@ -612,7 +624,7 @@
     </antcall>
   </target>
 
-  <target name="test-pessimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test-pessimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
     <echo message="Running test suite in PESSIMISTIC mode..."/>
     <antcall target="-test-nosecurity" inheritRefs="true">
       <param name="optimistic" value="false"/>
@@ -655,7 +667,7 @@
     </testng>
   </target>
 
-  <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
     </fileset>
@@ -673,7 +685,7 @@
     </testng>
   </target>
 
-  <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
     <fileset id="test.classes" dir="${build.test.classes.dir}">
        <include name="**/framework/*Test.class"/>
     </fileset>
@@ -696,7 +708,7 @@
 
   <target name="test262parallel" depends="test262-parallel"/>
 
-  <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true" failonerror="true">
       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
@@ -714,7 +726,7 @@
 
   <target name="testparallel" depends="test-parallel"/>
 
-  <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
+  <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
       <java classname="${parallel.test.runner}" dir="${basedir}"
         failonerror="true"
--- a/nashorn/make/project.properties	Wed Jul 05 22:44:47 2017 +0200
+++ b/nashorn/make/project.properties	Tue Jan 24 18:08:04 2017 +0530
@@ -408,7 +408,7 @@
 run.test.jvmargs.octane.main=${run.test.jvmargs.common} -XX:TypeProfileLevel=222
 
 # Security manager args - make sure that we run with the nashorn.policy that the build creates
-run.test.jvmsecurityargs=-Xverify:all -Djava.security.manager -Djava.security.policy=${build.dir}/nashorn.policy
+run.test.jvmsecurityargs=-Xverify:all -Djava.security.manager -Djava.security.policy=${build.dir}/nashorn.policy -Djava.security.properties=${build.dir}/nashorn.security.properties
 
 # VM options for script tests with @fork option
 test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -cp ${run.test.classpath}