doc/testing.html
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54570 93b702d2a0cb
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     3 <head>
     3 <head>
     4   <meta charset="utf-8" />
     4   <meta charset="utf-8" />
     5   <meta name="generator" content="pandoc" />
     5   <meta name="generator" content="pandoc" />
     6   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
     6   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
     7   <title>Testing the JDK</title>
     7   <title>Testing the JDK</title>
     8   <style type="text/css">
     8   <style>
     9       code{white-space: pre-wrap;}
     9       code{white-space: pre-wrap;}
    10       span.smallcaps{font-variant: small-caps;}
    10       span.smallcaps{font-variant: small-caps;}
    11       span.underline{text-decoration: underline;}
    11       span.underline{text-decoration: underline;}
    12       div.column{display: inline-block; vertical-align: top; width: 50%;}
    12       div.column{display: inline-block; vertical-align: top; width: 50%;}
    13   </style>
    13   </style>
    19 </head>
    19 </head>
    20 <body>
    20 <body>
    21 <header id="title-block-header">
    21 <header id="title-block-header">
    22 <h1 class="title">Testing the JDK</h1>
    22 <h1 class="title">Testing the JDK</h1>
    23 </header>
    23 </header>
    24 <nav id="TOC">
    24 <nav id="TOC" role="doc-toc">
    25 <ul>
    25 <ul>
    26 <li><a href="#using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</a><ul>
    26 <li><a href="#using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</a><ul>
    27 <li><a href="#configuration">Configuration</a></li>
    27 <li><a href="#configuration">Configuration</a></li>
    28 </ul></li>
    28 </ul></li>
    29 <li><a href="#test-selection">Test selection</a><ul>
    29 <li><a href="#test-selection">Test selection</a><ul>
    30 <li><a href="#jtreg">JTReg</a></li>
    30 <li><a href="#jtreg">JTReg</a></li>
    31 <li><a href="#gtest">Gtest</a></li>
    31 <li><a href="#gtest">Gtest</a></li>
    40 <li><a href="#microbenchmark-keywords">Microbenchmark keywords</a></li>
    40 <li><a href="#microbenchmark-keywords">Microbenchmark keywords</a></li>
    41 </ul></li>
    41 </ul></li>
    42 <li><a href="#notes-for-specific-tests">Notes for Specific Tests</a><ul>
    42 <li><a href="#notes-for-specific-tests">Notes for Specific Tests</a><ul>
    43 <li><a href="#docker-tests">Docker Tests</a></li>
    43 <li><a href="#docker-tests">Docker Tests</a></li>
    44 <li><a href="#non-us-locale">Non-US locale</a></li>
    44 <li><a href="#non-us-locale">Non-US locale</a></li>
       
    45 <li><a href="#pkcs11-tests">PKCS11 Tests</a></li>
    45 </ul></li>
    46 </ul></li>
    46 </ul>
    47 </ul>
    47 </nav>
    48 </nav>
    48 <h2 id="using-make-test-the-run-test-framework">Using &quot;make test&quot; (the run-test framework)</h2>
    49 <h2 id="using-make-test-the-run-test-framework">Using "make test" (the run-test framework)</h2>
    49 <p>This new way of running tests is developer-centric. It assumes that you have built a JDK locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
    50 <p>This new way of running tests is developer-centric. It assumes that you have built a JDK locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.</p>
    50 <p>The main target <code>test</code> uses the jdk-image as the tested product. There is also an alternate target <code>exploded-test</code> that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.</p>
    51 <p>The main target <code>test</code> uses the jdk-image as the tested product. There is also an alternate target <code>exploded-test</code> that uses the exploded image instead. Not all tests will run successfully on the exploded image, but using this target can greatly improve rebuild times for certain workflows.</p>
    51 <p>Previously, <code>make test</code> was used to invoke an old system for running tests, and <code>make run-test</code> was used for the new test framework. For backward compatibility with scripts and muscle memory, <code>run-test</code> (and variants like <code>exploded-run-test</code> or <code>run-test-tier1</code>) are kept as aliases.</p>
    52 <p>Previously, <code>make test</code> was used to invoke an old system for running tests, and <code>make run-test</code> was used for the new test framework. For backward compatibility with scripts and muscle memory, <code>run-test</code> (and variants like <code>exploded-run-test</code> or <code>run-test-tier1</code>) are kept as aliases.</p>
    52 <p>Some example command-lines:</p>
    53 <p>Some example command-lines:</p>
    53 <pre><code>$ make test-tier1
    54 <pre><code>$ make test-tier1
    54 $ make test-jdk_lang JTREG=&quot;JOBS=8&quot;
    55 $ make test-jdk_lang JTREG=&quot;JOBS=8&quot;
    55 $ make test TEST=jdk_lang
    56 $ make test TEST=jdk_lang
    56 $ make test-only TEST=&quot;gtest:LogTagSet gtest:LogTagSetDescriptions&quot; GTEST=&quot;REPEAT=-1&quot;
    57 $ make test-only TEST=&quot;gtest:LogTagSet gtest:LogTagSetDescriptions&quot; GTEST=&quot;REPEAT=-1&quot;
    57 $ make test TEST=&quot;hotspot:hotspot_gc&quot; JTREG=&quot;JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;
    58 $ make test TEST=&quot;hotspot:hotspot_gc&quot; JTREG=&quot;JOBS=1;TIMEOUT_FACTOR=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;
    58 $ make test TEST=&quot;jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java&quot;
    59 $ make test TEST=&quot;jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java&quot;
    59 $ make test TEST=&quot;micro:java.lang.reflect&quot; MICRO=&quot;FORK=1;WARMUP_ITER=2&quot;
    60 $ make test TEST=&quot;micro:java.lang.reflect&quot; MICRO=&quot;FORK=1;WARMUP_ITER=2&quot;
    60 $ make exploded-test TEST=tier2</code></pre>
    61 $ make exploded-test TEST=tier2</code></pre>
    61 <h3 id="configuration">Configuration</h3>
    62 <h3 id="configuration">Configuration</h3>
    62 <p>To be able to run JTReg tests, <code>configure</code> needs to know where to find the JTReg test framework. If it is not picked up automatically by configure, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc. (An alternative is to set the <code>JT_HOME</code> environment variable to point to the JTReg home before running <code>configure</code>.)</p>
    63 <p>To be able to run JTReg tests, <code>configure</code> needs to know where to find the JTReg test framework. If it is not picked up automatically by configure, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc. (An alternative is to set the <code>JT_HOME</code> environment variable to point to the JTReg home before running <code>configure</code>.)</p>
    63 <p>To be able to run microbenchmarks, <code>configure</code> needs to know where to find the JMH dependency. Use <code>--with-jmh=&lt;path to JMH jars&gt;</code> to point to a directory containing the core JMH and transitive dependencies. The recommended dependencies can be retrieved by running <code>sh make/devkit/createJMHBundle.sh</code>, after which <code>--with-jmh=build/jmh/jars</code> should work.</p>
    64 <p>To be able to run microbenchmarks, <code>configure</code> needs to know where to find the JMH dependency. Use <code>--with-jmh=&lt;path to JMH jars&gt;</code> to point to a directory containing the core JMH and transitive dependencies. The recommended dependencies can be retrieved by running <code>sh make/devkit/createJMHBundle.sh</code>, after which <code>--with-jmh=build/jmh/jars</code> should work.</p>
    64 <h2 id="test-selection">Test selection</h2>
    65 <h2 id="test-selection">Test selection</h2>
    65 <p>All functionality is available using the <code>test</code> make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, <code>test-only</code> can be used instead, which do not depend on the source and test image build.</p>
    66 <p>All functionality is available using the <code>test</code> make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, <code>test-only</code> can be used instead, which do not depend on the source and test image build.</p>
    66 <p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make test-tier1</code> is equivalent to <code>make test TEST=&quot;tier1&quot;</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST=&quot;x&quot;</code> solution needs to be used.</p>
    67 <p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make test-tier1</code> is equivalent to <code>make test TEST="tier1"</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>test TEST="x"</code> solution needs to be used.</p>
    67 <p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
    68 <p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
    68 <h3 id="jtreg">JTReg</h3>
    69 <h3 id="jtreg">JTReg</h3>
    69 <p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
    70 <p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
    70 <p>JTReg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot:tier1</code>, <code>test/jdk:jdk_util</code> or <code>$(TOPDIR)/test/hotspot/jtreg:hotspot_all</code>. The test root can be specified either as an absolute path, or a path relative to the JDK top directory, or the <code>test</code> directory. For simplicity, the hotspot JTReg test root, which really is <code>hotspot/jtreg</code> can be abbreviated as just <code>hotspot</code>.</p>
    71 <p>JTReg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot:tier1</code>, <code>test/jdk:jdk_util</code> or <code>$(TOPDIR)/test/hotspot/jtreg:hotspot_all</code>. The test root can be specified either as an absolute path, or a path relative to the JDK top directory, or the <code>test</code> directory. For simplicity, the hotspot JTReg test root, which really is <code>hotspot/jtreg</code> can be abbreviated as just <code>hotspot</code>.</p>
    71 <p>When specified without a test root, all matching groups from all test roots will be added. Otherwise, only the group from the specified test root will be added.</p>
    72 <p>When specified without a test root, all matching groups from all test roots will be added. Otherwise, only the group from the specified test root will be added.</p>
   101 <p>In case of test failures, <code>make test</code> will exit with a non-zero exit value.</p>
   102 <p>In case of test failures, <code>make test</code> will exit with a non-zero exit value.</p>
   102 <p>All tests have their result stored in <code>build/$BUILD/test-results/$TEST_ID</code>, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for <code>jtreg:jdk/test:tier1</code> the TEST_ID is <code>jtreg_jdk_test_tier1</code>. This path is also printed in the log at the end of the test run.</p>
   103 <p>All tests have their result stored in <code>build/$BUILD/test-results/$TEST_ID</code>, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for <code>jtreg:jdk/test:tier1</code> the TEST_ID is <code>jtreg_jdk_test_tier1</code>. This path is also printed in the log at the end of the test run.</p>
   103 <p>Additional work data is stored in <code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.</p>
   104 <p>Additional work data is stored in <code>build/$BUILD/test-support/$TEST_ID</code>. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.</p>
   104 <h2 id="test-suite-control">Test suite control</h2>
   105 <h2 id="test-suite-control">Test suite control</h2>
   105 <p>It is possible to control various aspects of the test suites using make control variables.</p>
   106 <p>It is possible to control various aspects of the test suites using make control variables.</p>
   106 <p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG=&quot;JOBS=1;TIMEOUT=8&quot;</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG=&quot;TMIEOUT=8&quot;</code> would give an error, while <code>JTREG_TMIEOUT=8</code> would just pass unnoticed.</p>
   107 <p>These variables use a keyword=value approach to allow multiple values to be set. So, for instance, <code>JTREG="JOBS=1;TIMEOUT_FACTOR=8"</code> will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting <code>JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8</code>, but using the keyword format means that the <code>JTREG</code> variable is parsed and verified for correctness, so <code>JTREG="TMIEOUT_FACTOR=8"</code> would give an error, while <code>JTREG_TMIEOUT_FACTOR=8</code> would just pass unnoticed.</p>
   107 <p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG=&quot;...;...&quot;</code>. This will also make sure spaces are preserved, as in <code>JTREG=&quot;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug&quot;</code>.</p>
   108 <p>To separate multiple keyword=value pairs, use <code>;</code> (semicolon). Since the shell normally eats <code>;</code>, the recommended usage is to write the assignment inside qoutes, e.g. <code>JTREG="...;..."</code>. This will also make sure spaces are preserved, as in <code>JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"</code>.</p>
   108 <p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
   109 <p>(Other ways are possible, e.g. using backslash: <code>JTREG=JOBS=1\;TIMEOUT_FACTOR=8</code>. Also, as a special technique, the string <code>%20</code> will be replaced with space for certain options, e.g. <code>JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug</code>. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)</p>
   109 <p>As far as possible, the names of the keywords have been standardized between test suites.</p>
   110 <p>As far as possible, the names of the keywords have been standardized between test suites.</p>
   110 <h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
   111 <h3 id="general-keywords-test_opts">General keywords (TEST_OPTS)</h3>
   111 <p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
   112 <p>Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.</p>
   112 <p>There are also some keywords that applies globally to the test runner system, not to any specific test suites. These are also available as TEST_OPTS keywords.</p>
   113 <p>There are also some keywords that applies globally to the test runner system, not to any specific test suites. These are also available as TEST_OPTS keywords.</p>
   113 <h4 id="jobs">JOBS</h4>
   114 <h4 id="jobs">JOBS</h4>
   152 <p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
   153 <p>JTReg kewords sent to JTReg using <code>-k</code>. Please be careful in making sure that spaces and special characters (like <code>!</code>) are properly quoted. To avoid some issues, the special value <code>%20</code> can be used instead of space.</p>
   153 <h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
   154 <h4 id="extra_problem_lists">EXTRA_PROBLEM_LISTS</h4>
   154 <p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
   155 <p>Use additional problem lists file or files, in addition to the default ProblemList.txt located at the JTReg test roots.</p>
   155 <p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
   156 <p>If multiple file names are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
   156 <p>The file names should be either absolute, or relative to the JTReg test root of the tests to be run.</p>
   157 <p>The file names should be either absolute, or relative to the JTReg test root of the tests to be run.</p>
       
   158 <h4 id="run_problem_lists">RUN_PROBLEM_LISTS</h4>
       
   159 <p>Use the problem lists to select tests instead of excluding them.</p>
       
   160 <p>Set to <code>true</code> or <code>false</code>. If <code>true</code>, JTReg will use <code>-match:</code> option, otherwise <code>-exclude:</code> will be used. Default is <code>false</code>.</p>
   157 <h4 id="options">OPTIONS</h4>
   161 <h4 id="options">OPTIONS</h4>
   158 <p>Additional options to the JTReg test framework.</p>
   162 <p>Additional options to the JTReg test framework.</p>
   159 <p>Use <code>JTREG=&quot;OPTIONS=--help all&quot;</code> to see all available JTReg options.</p>
   163 <p>Use <code>JTREG="OPTIONS=--help all"</code> to see all available JTReg options.</p>
   160 <h4 id="java_options-1">JAVA_OPTIONS</h4>
   164 <h4 id="java_options-1">JAVA_OPTIONS</h4>
   161 <p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
   165 <p>Additional Java options to JTReg (<code>-javaoption</code>).</p>
   162 <h4 id="vm_options-1">VM_OPTIONS</h4>
   166 <h4 id="vm_options-1">VM_OPTIONS</h4>
   163 <p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
   167 <p>Additional VM options to JTReg (<code>-vmoption</code>).</p>
   164 <h4 id="aot_modules-1">AOT_MODULES</h4>
   168 <h4 id="aot_modules-1">AOT_MODULES</h4>
   167 <h4 id="repeat">REPEAT</h4>
   171 <h4 id="repeat">REPEAT</h4>
   168 <p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
   172 <p>The number of times to repeat the tests (<code>--gtest_repeat</code>).</p>
   169 <p>Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with <code>OPTIONS=--gtest_break_on_failure</code> to reproduce an intermittent problem.</p>
   173 <p>Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with <code>OPTIONS=--gtest_break_on_failure</code> to reproduce an intermittent problem.</p>
   170 <h4 id="options-1">OPTIONS</h4>
   174 <h4 id="options-1">OPTIONS</h4>
   171 <p>Additional options to the Gtest test framework.</p>
   175 <p>Additional options to the Gtest test framework.</p>
   172 <p>Use <code>GTEST=&quot;OPTIONS=--help&quot;</code> to see all available Gtest options.</p>
   176 <p>Use <code>GTEST="OPTIONS=--help"</code> to see all available Gtest options.</p>
   173 <h4 id="aot_modules-2">AOT_MODULES</h4>
   177 <h4 id="aot_modules-2">AOT_MODULES</h4>
   174 <p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
   178 <p>Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value <code>%20</code>).</p>
   175 <h3 id="microbenchmark-keywords">Microbenchmark keywords</h3>
   179 <h3 id="microbenchmark-keywords">Microbenchmark keywords</h3>
   176 <h4 id="fork">FORK</h4>
   180 <h4 id="fork">FORK</h4>
   177 <p>Override the number of benchmark forks to spawn. Same as specifying <code>-f &lt;num&gt;</code>.</p>
   181 <p>Override the number of benchmark forks to spawn. Same as specifying <code>-f &lt;num&gt;</code>.</p>
   194 <p>Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:</p>
   198 <p>Docker tests with default parameters may fail on systems with glibc versions not compatible with the one used in the default docker image (e.g., Oracle Linux 7.6 for x86). For example, they pass on Ubuntu 16.04 but fail on Ubuntu 18.04 if run like this on x86:</p>
   195 <pre><code>$ make test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot;</code></pre>
   199 <pre><code>$ make test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot;</code></pre>
   196 <p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
   200 <p>To run these tests correctly, additional parameters for the correct docker image are required on Ubuntu 18.04 by using <code>JAVA_OPTIONS</code>.</p>
   197 <pre><code>$ make test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot; JTREG=&quot;JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest&quot;</code></pre>
   201 <pre><code>$ make test TEST=&quot;jtreg:test/hotspot/jtreg/containers/docker&quot; JTREG=&quot;JAVA_OPTIONS=-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest&quot;</code></pre>
   198 <h3 id="non-us-locale">Non-US locale</h3>
   202 <h3 id="non-us-locale">Non-US locale</h3>
   199 <p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG=&quot;en_US&quot;</code> in the environment before running tests should work. On Windows, setting <code>JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot;</code> helps for most, but not all test cases. For example:</p>
   203 <p>If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting <code>LANG="en_US"</code> in the environment before running tests should work. On Windows, setting <code>JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"</code> helps for most, but not all test cases. For example:</p>
   200 <pre><code>$ export LANG=&quot;en_US&quot; &amp;&amp; make test TEST=...
   204 <pre><code>$ export LANG=&quot;en_US&quot; &amp;&amp; make test TEST=...
   201 $ make test JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot; TEST=...</code></pre>
   205 $ make test JTREG=&quot;VM_OPTIONS=-Duser.language=en -Duser.country=US&quot; TEST=...</code></pre>
       
   206 <h3 id="pkcs11-tests">PKCS11 Tests</h3>
       
   207 <p>It is highly recommended to use the latest NSS version when running PKCS11 tests. Improper NSS version may lead to unexpected failures which are hard to diagnose. For example, sun/security/pkcs11/Secmod/AddTrustedCert.java may fail on Ubuntu 18.04 with the default NSS version in the system. To run these tests correctly, the system property <code>test.nss.lib.paths</code> is required on Ubuntu 18.04 to specify the alternative NSS lib directories. For example:</p>
       
   208 <pre><code>$ make test TEST=&quot;jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java&quot; JTREG=&quot;JAVA_OPTIONS=-Dtest.nss.lib.paths=/path/to/your/latest/NSS-libs&quot;</code></pre>
       
   209 <p>For more notes about the PKCS11 tests, please refer to test/jdk/sun/security/pkcs11/README.</p>
   202 </body>
   210 </body>
   203 </html>
   211 </html>