@@ -402,6 +402,167 @@ jobs:
402402 path : ~/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
403403 continue-on-error : true
404404
405+ linux_x64_test_fips :
406+ name : Linux x64 + FIPS
407+ runs-on : " ubuntu-20.04"
408+ needs :
409+ - prerequisites
410+ - linux_x64_build
411+
412+ strategy :
413+ fail-fast : false
414+ matrix :
415+ test :
416+ - jdk/tier1 part 1
417+ - jdk/tier1 part 2
418+ - jdk/tier1 part 3
419+ include :
420+ - test : jdk/tier1 part 1
421+ suites : test/jdk/:tier1_part1
422+ - test : jdk/tier1 part 2
423+ suites : test/jdk/:tier1_part2
424+ - test : jdk/tier1 part 3
425+ suites : test/jdk/:tier1_part3
426+
427+ env :
428+ JDK_VERSION : " ${{ needs.prerequisites.outputs.jdk_version }}"
429+ BOOT_JDK_VERSION : " ${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
430+ BOOT_JDK_FILENAME : " ${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
431+ BOOT_JDK_URL : " ${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
432+ BOOT_JDK_SHA256 : " ${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
433+
434+ steps :
435+ - name : Checkout the source
436+ uses : actions/checkout@v2
437+
438+ - name : Restore boot JDK from cache
439+ id : bootjdk
440+ uses : actions/cache@v2
441+ with :
442+ path : ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
443+ key : bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
444+
445+ - name : Download boot JDK
446+ run : |
447+ mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
448+ wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
449+ echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
450+ tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
451+ mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
452+ if : steps.bootjdk.outputs.cache-hit != 'true'
453+
454+ - name : Restore jtreg artifact
455+ id : jtreg_restore
456+ uses : actions/download-artifact@v2
457+ with :
458+ name : transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
459+ path : ~/jtreg/
460+ continue-on-error : true
461+
462+ - name : Restore jtreg artifact (retry)
463+ uses : actions/download-artifact@v2
464+ with :
465+ name : transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
466+ path : ~/jtreg/
467+ if : steps.jtreg_restore.outcome == 'failure'
468+
469+ - name : Restore build artifacts
470+ id : build_restore
471+ uses : actions/download-artifact@v2
472+ with :
473+ name : transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
474+ path : ~/jdk-linux-x64${{ matrix.artifact }}
475+ continue-on-error : true
476+
477+ - name : Restore build artifacts (retry)
478+ uses : actions/download-artifact@v2
479+ with :
480+ name : transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
481+ path : ~/jdk-linux-x64${{ matrix.artifact }}
482+ if : steps.build_restore.outcome == 'failure'
483+
484+ - name : Unpack jdk
485+ run : |
486+ mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}"
487+ tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}"
488+
489+ - name : Unpack tests
490+ run : |
491+ mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}"
492+ tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}"
493+
494+ - name : Find root of jdk image dir
495+ run : |
496+ imageroot=`find ${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }} -name release -type f`
497+ echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
498+
499+ - name : Turn on system security properties and FIPS mode support
500+ run : |
501+ sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" ${{ env.imageroot }}/conf/security/java.security
502+
503+ - name : Run tests
504+ run : >
505+ JDK_IMAGE_DIR=${{ env.imageroot }}
506+ TEST_IMAGE_DIR=${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}
507+ BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}
508+ JT_HOME=${HOME}/jtreg
509+ make test-prebuilt
510+ CONF_NAME=run-test-prebuilt
511+ LOG_CMDLINES=true
512+ JTREG_VERBOSE=fail,error,time
513+ TEST="${{ matrix.suites }}"
514+ TEST_OPTS_JAVA_OPTIONS=
515+ JTREG_KEYWORDS="!headful"
516+ JTREG="JAVA_OPTIONS='-Djava.security.debug=properties -XX:-CreateCoredumpOnCrash'"
517+
518+ - name : Check that all tests executed successfully
519+ if : always()
520+ run : >
521+ if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
522+ cat build/*/test-results/*/text/newfailures.txt ;
523+ cat build/*/test-results/*/text/other_errors.txt ;
524+ exit 1 ;
525+ fi
526+
527+ - name : Create suitable test log artifact name
528+ if : always()
529+ run : echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV
530+
531+ - name : Package test results
532+ if : always()
533+ working-directory : build/run-test-prebuilt/test-results/
534+ run : >
535+ zip -r9
536+ "$HOME/linux-x64${{ matrix.artifact }}-fips_testresults_${{ env.logsuffix }}.zip"
537+ .
538+ continue-on-error : true
539+
540+ - name : Package test support
541+ if : always()
542+ working-directory : build/run-test-prebuilt/test-support/
543+ run : >
544+ zip -r9
545+ "$HOME/linux-x64${{ matrix.artifact }}-fips_testsupport_${{ env.logsuffix }}.zip"
546+ .
547+ -i *.jtr
548+ -i */hs_err*.log
549+ -i */replay*.log
550+ continue-on-error : true
551+
552+ - name : Persist test results
553+ if : always()
554+ uses : actions/upload-artifact@v2
555+ with :
556+ path : ~/linux-x64${{ matrix.artifact }}-fips_testresults_${{ env.logsuffix }}.zip
557+ continue-on-error : true
558+
559+ - name : Persist test outputs
560+ if : always()
561+ uses : actions/upload-artifact@v2
562+ with :
563+ path : ~/linux-x64${{ matrix.artifact }}-fips_testsupport_${{ env.logsuffix }}.zip
564+ continue-on-error : true
565+
405566 linux_additional_build :
406567 name : Linux additional
407568 runs-on : " ubuntu-20.04"
@@ -1685,6 +1846,7 @@ jobs:
16851846 - linux_additional_build
16861847 - windows_aarch64_build
16871848 - linux_x64_test
1849+ - linux_x64_test_fips
16881850 - linux_x86_test
16891851 - windows_x64_test
16901852 - macos_x64_test
0 commit comments