From 321146328b912f49e27e1a06e47b1125c679839e Mon Sep 17 00:00:00 2001 From: Adrian Clay Lake Date: Thu, 3 Oct 2024 09:50:13 +0200 Subject: [PATCH 01/11] feat: xz utils changes (#338) --------- Co-authored-by: Enderson Maia Co-authored-by: Rafid Bin Mostofa Co-authored-by: Cristovao Cordeiro --- slices/coreutils.yaml | 19 ++++++++-- slices/xz-utils.yaml | 35 ++++++++++++++++++ tests/spread/integration/coreutils/task.yaml | 11 ++++++ tests/spread/integration/xz-utils/task.yaml | 38 ++++++++++++++++++++ 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 slices/xz-utils.yaml create mode 100644 tests/spread/integration/coreutils/task.yaml create mode 100644 tests/spread/integration/xz-utils/task.yaml diff --git a/slices/coreutils.yaml b/slices/coreutils.yaml index d693039f..38b819b9 100644 --- a/slices/coreutils.yaml +++ b/slices/coreutils.yaml @@ -12,7 +12,9 @@ slices: bins: essential: + - coreutils_expr - coreutils_libs + - coreutils_mkdir - libacl1_libs - libattr1_libs - libc6_libs @@ -49,7 +51,6 @@ slices: /usr/bin/echo: /usr/bin/env: /usr/bin/expand: - /usr/bin/expr: /usr/bin/factor: /usr/bin/false: /usr/bin/fmt: @@ -66,7 +67,6 @@ slices: /usr/bin/ls: /usr/bin/md5sum: /usr/bin/md5sum.textutils: - /usr/bin/mkdir: /usr/bin/mkfifo: /usr/bin/mknod: /usr/bin/mktemp: @@ -129,6 +129,21 @@ slices: /usr/bin/yes: /usr/sbin/chroot: + expr: + essential: + - libc6_libs + - libgmp10_libs + contents: + /usr/bin/expr: + + mkdir: + essential: + - libc6_libs + - libpcre2-8-0_libs + - libselinux1_libs + contents: + /usr/bin/mkdir: + copyright: contents: /usr/share/doc/coreutils/copyright: diff --git a/slices/xz-utils.yaml b/slices/xz-utils.yaml new file mode 100644 index 00000000..83f53dc0 --- /dev/null +++ b/slices/xz-utils.yaml @@ -0,0 +1,35 @@ +package: xz-utils + +essential: + - xz-utils_copyright + +slices: + bins: + essential: + - libc6_libs + - liblzma5_libs + contents: + /usr/bin/lzmainfo: + /usr/bin/unxz: + /usr/bin/xz: + /usr/bin/xzcat: + scripts: # scripts which add xz compression to common utils + essential: + # shebang in scripts reference interpreter in /bin not /usr/bin + - base-files_bin + - base-files_tmp # utils require temporary storage + - coreutils_expr # used by xzcmp and xzdiff + - coreutils_mkdir # used by xzcmp and xzdiff + - diffutils_bins # used by xzcmp and xzdiff + - grep_bins # needed for xz grep utils + - xz-utils_bins + contents: + /usr/bin/xzcmp: + /usr/bin/xzdiff: + /usr/bin/xzegrep: + /usr/bin/xzfgrep: + /usr/bin/xzgrep: + + copyright: + contents: + /usr/share/doc/xz-utils/copyright: diff --git a/tests/spread/integration/coreutils/task.yaml b/tests/spread/integration/coreutils/task.yaml new file mode 100644 index 00000000..7b164139 --- /dev/null +++ b/tests/spread/integration/coreutils/task.yaml @@ -0,0 +1,11 @@ +summary: Integration tests for coreutils + +execute: | + # test expr binary + rootfs_expr="$(install-slices coreutils_expr)" + chroot "$rootfs_expr" expr --version + + # test mkdir binary + rootfs_mkdir="$(install-slices coreutils_mkdir)" + chroot "$rootfs_mkdir" mkdir test_dir + test -d "$rootfs_mkdir/test_dir" diff --git a/tests/spread/integration/xz-utils/task.yaml b/tests/spread/integration/xz-utils/task.yaml new file mode 100644 index 00000000..58724760 --- /dev/null +++ b/tests/spread/integration/xz-utils/task.yaml @@ -0,0 +1,38 @@ +summary: Integration tests for xz-utils + +execute: | + rootfs="$(install-slices xz-utils_bins xz-utils_scripts dash_bins)" + + # make artificial /dev/null for testing + mkdir "$rootfs/dev" + touch "$rootfs/dev/null" + + # smoke test + chroot "$rootfs" xz --version + + # test compression + echo "compressed content" > uncompressed.txt + cp uncompressed.txt "${rootfs}/" + chroot "$rootfs" xz -z uncompressed.txt + + # test xzgrep + chroot "$rootfs" xzgrep "$(cat uncompressed.txt)" uncompressed.txt.xz + + # test xzdiff + echo "one" > FILE1 + echo "two" > FILE2 + cp FILE1 FILE2 "${rootfs}/" + chroot "$rootfs" xz -zk FILE1 + chroot "$rootfs" xz -zk FILE2 + chroot "$rootfs" xzdiff FILE1.xz FILE2.xz > xzdiff_result || true + chroot "$rootfs" diff FILE1 FILE2 > diff_result || true + cmp xzdiff_result diff_result + + # test xzcat + chroot "$rootfs" xzcat FILE1.xz > xzcat_result + cmp xzcat_result FILE1 + + # test xzcmp + chroot "$rootfs" xzcmp -b FILE1.xz FILE2.xz | cut -d: -f2 > xzcmp_result + chroot "$rootfs" cmp -b FILE1 FILE2 | cut -d: -f2 > cmp_result + cmp xzcmp_result cmp_result From 84ac1d8fe0c42931d92d4ba17301351751f6123e Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Tue, 8 Oct 2024 00:55:00 +1300 Subject: [PATCH 02/11] feat(24.04): openjdk-21-jdk-headless slice (#313) --- slices/openjdk-21-jdk-headless.yaml | 160 +++++++++++++++ slices/openjdk-21-jre-headless.yaml | 183 ++++++++++++++++++ .../openjdk-21-jdk-headless/Main.java | 5 + .../MonitoringTest.java | 7 + .../SerializableObject.java | 4 + .../openjdk-21-jdk-headless/task.yaml | 125 ++++++++++++ .../openjdk-21-jre-headless/ConsoleTest.java | 11 ++ .../openjdk-21-jre-headless/Main.java | 5 + .../openjdk-21-jre-headless/PrefsTest.java | 13 ++ .../ReadCertificate.java | 35 ++++ .../openjdk-21-jre-headless/TestJMX.java | 42 ++++ .../openjdk-21-jre-headless/TestJMXMBean.java | 3 + .../openjdk-21-jre-headless/task.yaml | 59 ++++++ 13 files changed, 652 insertions(+) create mode 100644 slices/openjdk-21-jdk-headless.yaml create mode 100644 slices/openjdk-21-jre-headless.yaml create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/Main.java create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java create mode 100644 tests/spread/integration/openjdk-21-jdk-headless/task.yaml create mode 100644 tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/Main.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/TestJMX.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java create mode 100644 tests/spread/integration/openjdk-21-jre-headless/task.yaml diff --git a/slices/openjdk-21-jdk-headless.yaml b/slices/openjdk-21-jdk-headless.yaml new file mode 100644 index 00000000..ac919ca2 --- /dev/null +++ b/slices/openjdk-21-jdk-headless.yaml @@ -0,0 +1,160 @@ +package: openjdk-21-jdk-headless + +essential: + - openjdk-21-jdk-headless_copyright + +slices: + + # OpenJDK binaries slice + core: + essential: + - libc6_libs + - openjdk-21-jre-headless_core + - zlib1g_libs + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/javac: + /usr/lib/jvm/java-21-openjdk-*/bin/javadoc: + /usr/lib/jvm/java-21-openjdk-*/bin/javap: + /usr/lib/jvm/java-21-openjdk-*/bin/jdeprscan: + /usr/lib/jvm/java-21-openjdk-*/bin/jdeps: + /usr/lib/jvm/java-21-openjdk-*/bin/jimage: + /usr/lib/jvm/java-21-openjdk-*/bin/serialver: + # used by javac + /usr/lib/jvm/java-21-openjdk-*/lib/ct.sym: + + standard: + essential: + - openjdk-21-jdk-headless_core + - openjdk-21-jre-headless_standard + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/jar: + /usr/lib/jvm/java-21-openjdk-*/bin/jarsigner: + /usr/lib/jvm/java-21-openjdk-*/bin/jcmd: + /usr/lib/jvm/java-21-openjdk-*/bin/jdb: + /usr/lib/jvm/java-21-openjdk-*/bin/jfr: + /usr/lib/jvm/java-21-openjdk-*/bin/jhsdb: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-21-openjdk-*/bin/jinfo: + /usr/lib/jvm/java-21-openjdk-*/bin/jmap: + /usr/lib/jvm/java-21-openjdk-*/bin/jps: + /usr/lib/jvm/java-21-openjdk-*/bin/jrunscript: + /usr/lib/jvm/java-21-openjdk-*/bin/jshell: + /usr/lib/jvm/java-21-openjdk-*/bin/jstack: + /usr/lib/jvm/java-21-openjdk-*/bin/jstat: + /usr/lib/jvm/java-21-openjdk-*/bin/jstatd: + /usr/lib/jvm/java-21-openjdk-*/bin/jwebserver: + + # OpenJDK modules required to build the runtime image + modules: + essential: + - openjdk-21-jdk-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/jlink: + /usr/lib/jvm/java-21-openjdk-*/bin/jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.base.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.compiler.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.datatransfer.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.desktop.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.instrument.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.logging.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.management.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.management.rmi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.naming.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.net.http.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.prefs.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.rmi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.scripting.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.se.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.security.jgss.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.security.sasl.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.smartcardio.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.sql.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.sql.rowset.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.transaction.xa.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.xml.crypto.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/java.xml.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.accessibility.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.attach.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.charsets.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.compiler.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.crypto.cryptoki.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.crypto.ec.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.dynalink.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.editpad.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.hotspot.agent.jmod: + arch: + - amd64 + - arm64 + - ppc64el + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.httpserver.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.ed.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.jvmstat.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.le.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.opt.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.vm.ci.jmod: + arch: + - amd64 + - arm64 + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.vm.compiler.jmod: + arch: + - amd64 + - arm64 + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.internal.vm.compiler.management.jmod: + arch: + - amd64 + - arm64 + - riscv64 + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jartool.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.javadoc.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jcmd.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jconsole.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jdeps.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jdi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jdwp.agent.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jfr.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jlink.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jpackage.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jshell.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jsobject.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.jstatd.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.localedata.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.management.agent.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.management.jfr.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.management.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.naming.dns.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.naming.rmi.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.net.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.nio.mapmode.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.random.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.sctp.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.security.auth.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.security.jgss.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.unsupported.desktop.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.unsupported.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.xml.dom.jmod: + /usr/lib/jvm/java-21-openjdk-*/jmods/jdk.zipfs.jmod: + + # OpenJDK headers for JNI + headers: + contents: + /usr/lib/jvm/java-21-openjdk-*/include/classfile_constants.h: + /usr/lib/jvm/java-21-openjdk-*/include/jni.h: + /usr/lib/jvm/java-21-openjdk-*/include/jvmti.h: + /usr/lib/jvm/java-21-openjdk-*/include/jvmticmlr.h: + /usr/lib/jvm/java-21-openjdk-*/include/linux/jni_md.h: + + # OpenJDK headers for the debug agent development + debug-headers: + contents: + /usr/lib/jvm/java-21-openjdk-*/include/jdwpTransport.h: + + copyright: + essential: + - openjdk-21-jre-headless_copyright + contents: + /usr/share/doc/openjdk-21-jdk-headless: diff --git a/slices/openjdk-21-jre-headless.yaml b/slices/openjdk-21-jre-headless.yaml new file mode 100644 index 00000000..93481e07 --- /dev/null +++ b/slices/openjdk-21-jre-headless.yaml @@ -0,0 +1,183 @@ +package: openjdk-21-jre-headless + +essential: + - openjdk-21-jre-headless_copyright + +slices: + + # A set of slices to run headless openjdk runtime + standard: + essential: + - openjdk-21-jre-headless_class-data-sharing + - openjdk-21-jre-headless_console + - openjdk-21-jre-headless_core + - openjdk-21-jre-headless_debug + - openjdk-21-jre-headless_jfr + - openjdk-21-jre-headless_management + - openjdk-21-jre-headless_prefs + - openjdk-21-jre-headless_rmi + - openjdk-21-jre-headless_security + - openjdk-21-jre-headless_tools + + # List of classes required to create the Class Data Sharing archive + class-data-sharing: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/classlist: + + # A minimal set of files to run a Java application + # excluded dependencies: + # - ca-certificates-java_essential - needs chisel support to run + # maintainer scripts. + # - java-common - provides update-alternatives, + # not relevant. + # - util-linux - needed for bash completion + # not relevant. + # - libjpeg8 - used in awt, not relevant + # - liblcms2-2 - used in awt, not relevant + core: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + - zlib1g_libs + contents: + /etc/java-21-openjdk/jaxp.properties: + /etc/java-21-openjdk/jvm-*.cfg: + /etc/java-21-openjdk/logging.properties: + /etc/java-21-openjdk/net.properties: + /etc/java-21-openjdk/security/java.policy: + /etc/java-21-openjdk/security/java.security: + /usr/lib/jvm/java-21-openjdk-*/bin/java: + /usr/lib/jvm/java-21-openjdk-*/conf/jaxp.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/logging.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/net.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/security/java.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/java.security: + /usr/lib/jvm/java-21-openjdk-*/lib/jexec: + /usr/lib/jvm/java-21-openjdk-*/lib/jspawnhelper: + /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg: + /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg-default: + /usr/lib/jvm/java-21-openjdk-*/lib/libextnet.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjava.so: + # lib/modules support + /usr/lib/jvm/java-21-openjdk-*/lib/libjimage.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjli.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjsig.so: + # required for IO. + /usr/lib/jvm/java-21-openjdk-*/lib/libnet.so: + # required for IO. + /usr/lib/jvm/java-21-openjdk-*/lib/libnio.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libverify.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libzip.so: + /usr/lib/jvm/java-21-openjdk-*/lib/modules: + /usr/lib/jvm/java-21-openjdk-*/lib/server/libjsig.so: + /usr/lib/jvm/java-21-openjdk-*/lib/server/libjvm.so: + /usr/lib/jvm/java-21-openjdk-*/lib/tzdb.dat: + + # Native part of jdk.prefs modules + prefs: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/libprefs.so: + + # Native part of java.rmi + rmi: + essential: + - openjdk-21-jre-headless_security + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/rmiregistry: + /usr/lib/jvm/java-21-openjdk-*/lib/librmi.so: + + # Native part of the console support + console: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/lible.so: + + # Debug support + debug: + essential: + - openjdk-21-jre-headless_core + contents: + /usr/lib/jvm/java-21-openjdk-*/lib/libattach.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libdt_socket.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libinstrument.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjdwp.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libsaproc.so: + arch: + - amd64 + - arm64 + - armhf + - ppc64el + - riscv64 + + # Configuration and native part of Java Management Extensions + management: + essential: + - openjdk-21-jre-headless_rmi + contents: + /etc/java-21-openjdk/management/jmxremote.access: + /etc/java-21-openjdk/management/management.properties: + /usr/lib/jvm/java-21-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-21-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-21-openjdk-*/lib/libmanagement.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libmanagement_agent.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libmanagement_ext.so: + + # Security configuration files and native libraries + security: + essential: + - libnss3_libs + - libpcsclite1_libs + - openjdk-21-jre-headless_core + contents: + /etc/java-21-openjdk/security/blocked.certs: + /etc/java-21-openjdk/security/default.policy: + /etc/java-21-openjdk/security/nss.cfg: + /etc/java-21-openjdk/security/policy/limited/default_US_export.policy: + /etc/java-21-openjdk/security/policy/limited/default_local.policy: + /etc/java-21-openjdk/security/policy/limited/exempt_local.policy: + /etc/java-21-openjdk/security/policy/unlimited/default_US_export.policy: + /etc/java-21-openjdk/security/policy/unlimited/default_local.policy: + /etc/java-21-openjdk/security/public_suffix_list.dat: + /usr/lib/jvm/java-21-openjdk-*/conf/security/nss.cfg: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/limited/default_US_export.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/limited/default_local.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/limited/exempt_local.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/unlimited/default_US_export.policy: + /usr/lib/jvm/java-21-openjdk-*/conf/security/policy/unlimited/default_local.policy: + /usr/lib/jvm/java-21-openjdk-*/lib/libj2gss.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libj2pcsc.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libj2pkcs11.so: + /usr/lib/jvm/java-21-openjdk-*/lib/libjaas.so: + /usr/lib/jvm/java-21-openjdk-*/lib/security/blocked.certs: + /usr/lib/jvm/java-21-openjdk-*/lib/security/cacerts: + /usr/lib/jvm/java-21-openjdk-*/lib/security/default.policy: + /usr/lib/jvm/java-21-openjdk-*/lib/security/public_suffix_list.dat: + + # OpenJDK tools + tools: + essential: + - openjdk-21-jre-headless_security + contents: + /usr/lib/jvm/java-21-openjdk-*/bin/jpackage: + /usr/lib/jvm/java-21-openjdk-*/bin/keytool: + + # Java Flight Recorder configuration and jar file + jfr: + essential: + - openjdk-21-jre-headless_core + contents: + /etc/java-21-openjdk/jfr/default.jfc: + /etc/java-21-openjdk/jfr/profile.jfc: + /usr/lib/jvm/java-21-openjdk-*/lib/jfr/default.jfc: + /usr/lib/jvm/java-21-openjdk-*/lib/jfr/profile.jfc: + /usr/lib/jvm/java-21-openjdk-*/lib/jrt-fs.jar: + + copyright: + contents: + /usr/share/doc/openjdk-21-jre-headless/copyright: diff --git a/tests/spread/integration/openjdk-21-jdk-headless/Main.java b/tests/spread/integration/openjdk-21-jdk-headless/Main.java new file mode 100644 index 00000000..40b5eeef --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args){ + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java b/tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java new file mode 100644 index 00000000..aa09573f --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/MonitoringTest.java @@ -0,0 +1,7 @@ +public class MonitoringTest { + public static void main(String[] args) throws InterruptedException { + while (true) { + Thread.sleep(1000); + } + } +} diff --git a/tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java b/tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java new file mode 100644 index 00000000..b4605642 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/SerializableObject.java @@ -0,0 +1,4 @@ +import java.io.Serializable; + +public class SerializableObject implements Serializable { +} diff --git a/tests/spread/integration/openjdk-21-jdk-headless/task.yaml b/tests/spread/integration/openjdk-21-jdk-headless/task.yaml new file mode 100644 index 00000000..83023e6f --- /dev/null +++ b/tests/spread/integration/openjdk-21-jdk-headless/task.yaml @@ -0,0 +1,125 @@ +summary: Integration tests for openjdk-21-jdk-headless + +environment: + SLICE/core: "core" + SLICE/standard: "standard" + SLICE/modules: "modules" + +execute: | + pids=() + cleanup() { + for pid in "${pids[@]}"; do + kill "$pid" 2>/dev/null + done + } + for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done + trap cleanup EXIT + + apt install --update -y openjdk-21-jdk-headless curl + nohup java MonitoringTest.java & + pid=$! + pids+=("$pid") + + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-21-jdk-headless_${SLICE} dash_bins)" + cp *.java ${rootfs}/ + javac *.java + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc sys tmp + mount --bind /proc proc + mount --bind /sys sys + mount --bind /tmp tmp + case ${SLICE} in + core) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-21-openjdk-*/bin/javac: + chroot . ${home}/javac /Main.java -d / + # /usr/lib/jvm/java-21-openjdk-*/bin/javadoc: + chroot . ${home}/javadoc /Main.java + # /usr/lib/jvm/java-21-openjdk-*/bin/javap: + chroot . ${home}/javap -l /Main.class + # /usr/lib/jvm/java-21-openjdk-*/bin/jdeprscan: + chroot . ${home}/jdeprscan --class-path . Main + # /usr/lib/jvm/java-21-openjdk-*/bin/jdeps: + chroot . ${home}/jdeps -m java.base + # /usr/lib/jvm/java-21-openjdk-*/bin/jimage: + chroot . ${home}/jimage info ${home}/../lib/modules + # /usr/lib/jvm/java-21-openjdk-*/bin/serialver: + chroot . ${home}/serialver -classpath / SerializableObject + done + ;; + standard) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-21-openjdk-*/bin/jar: + # /usr/lib/jvm/java-21-openjdk-*/bin/jarsigner: + chroot . ${home}/jar cvf test.jar *.java + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . ${home}/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" -alias foo + chroot . ${home}/jarsigner -keystore foo -storepass barbar test.jar foo + # /usr/lib/jvm/java-21-openjdk-*/bin/jdb: + chroot . /usr/bin/sh -c "echo run | ${home}/jdb Main.java" + # /usr/lib/jvm/java-21-openjdk-*/bin/jcmd: + chroot . ${home}/jcmd jdk.compiler/com.sun.tools.javac.launcher.Main VM.version + # /usr/lib/jvm/java-21-openjdk-*/bin/jhsdb: + if [ -f ${home}/jhsdb ]; then + chroot . ${home}/jhsdb jstack --pid ${pid} + fi + # /usr/lib/jvm/java-21-openjdk-*/bin/jfr: + chroot . ${home}/jcmd ${pid} JFR.start maxsize=1MB + chroot . ${home}/jcmd ${pid} JFR.stop + chroot . ${home}/jcmd ${pid} JFR.dump filename=/tmp/recording.jfr + chroot . ${home}/jfr print /tmp/recording.jfr > /dev/null + # /usr/lib/jvm/java-21-openjdk-*/bin/jinfo: + chroot . ${home}/jinfo ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jshell: + chroot . /usr/bin/sh -c "echo 'System.out.println(\"hello world\")' | ${home}/jshell" + # /usr/lib/jvm/java-21-openjdk-*/bin/jmap: + chroot . ${home}/jmap ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jps: + chroot . ${home}/jps -l + # /usr/lib/jvm/java-21-openjdk-*/bin/jstack: + chroot . ${home}/jstack ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jstat: + chroot . ${home}/jstat -gc ${pid} + # /usr/lib/jvm/java-21-openjdk-*/bin/jstatd: + nohup chroot . ${home}/jstatd > ./jstatd.log & + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + grep -q "bound to /JStatRemoteHost" "jstatd.log" && break + sleep 10 + done + # /usr/lib/jvm/java-21-openjdk-amd64/bin/jwebserver + nohup chroot . ${home}/jwebserver & + sleep 10 + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + curl http://127.0.0.1:8000 && break + sleep 10 + done + # /usr/lib/jvm/java-21-openjdk-*/bin/jrunscript: + ${home}/jrunscript -q + done + ;; + modules) + cd ${rootfs} + for jlink in `find usr/lib/jvm -name jlink`; do + output=$(basename $(mktemp -u)) + chroot . ${jlink} --add-modules java.base --output ${output} + rm -rf ${rootfs}/${output} + done + for jmod in `find usr/lib/jvm -name jmod`; do + home=$(dirname ${jmod}) + chroot . ${jmod} list ${home}/../jmods/java.rmi.jmod + done + ;; + esac diff --git a/tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java b/tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java new file mode 100644 index 00000000..6f85fb63 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/ConsoleTest.java @@ -0,0 +1,11 @@ +import java.io.Console; + +public class ConsoleTest { + public static void main(String[] args) { + Console c = System.console(); + if (c == null) { + throw new RuntimeException("Console is not available"); + } + c.printf("console output %s\n", "success"); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/Main.java b/tests/spread/integration/openjdk-21-jre-headless/Main.java new file mode 100644 index 00000000..47e5d0af --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java b/tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java new file mode 100644 index 00000000..73c4ee63 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/PrefsTest.java @@ -0,0 +1,13 @@ +import java.util.prefs.*; + +public class PrefsTest { + public static void main(String[] args) { + if ("put".equals(args[0])) { + Preferences.userRoot().put("a", "b"); + } else if ("get".equals(args[0])) { + if (!"b".equals(Preferences.userRoot().get("a", null))) { + throw new RuntimeException("Unable to read the preference"); + } + } + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java b/tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java new file mode 100644 index 00000000..644b2b0d --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/ReadCertificate.java @@ -0,0 +1,35 @@ +import java.security.cert.*; +import java.io.*; + +public class ReadCertificate { + + static final String PEM = """ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIULvuqN3MiptnZSYS9y1qJAZYKFA4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA4MTUwMjQzNDhaFw0yNTA4 +MTUwMjQzNDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDm3990peBuPYaz0UEEc75Q7i79P4RzrD84MxhDpoPs +MSdnmO3rTkIG84Wp72+8T7TGjGjBhX++8UmZLrXy2AfcejZi3JcddMWH4V5XEnAj +hTBe1HLkiotayZst/cxuTP6KmuahjsROAqriCv/A4BBA8KjYx1e4E9k9+81FreZy +PJ8p3m7R8qZ/DtjuW1aMQ3oDRKA/iqQhLHVpJy/iYiyjwTdJm6/lA3ywGCr6ZMWm +9tWUT+4TvhyRM67Y0gcCtH51cwxPqUFGEKAkLWIu2fS6DaoXtHylxgGeKKPes3JX +uSn9QezEEqvrgLFQRqIUS8tNZFEhoJQ7dmxMP/XKAD51AgMBAAGjUzBRMB0GA1Ud +DgQWBBSb70j+xaI3eTxp4H7MDm1MLVRGNTAfBgNVHSMEGDAWgBSb70j+xaI3eTxp +4H7MDm1MLVRGNTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAp +0GIjKtwvD7BkQy+cf3dsdwYodxoIYl4E8UvHfBSPQQfFNh+chHPmrNYRuFM3Q6sT +ogNhHKLecQMK4tNUDa/vVRGnqmZVWjxqLnyH/qFKtakqPB6h6x4h50huzA+twhNm +SDjg3QqqpOuUzrs77JqYkxSjqd0QgmwmgxOdbcF0SY+ebQhAd0UXY7wIs6ByDEHO +kElgJmnGKhOpf1SFpQh2qpKGq/MvcdHWN4oKri440wCf+czkrOTyGVc275oTbRnM +Z76Ro4JDuomyWeR9iQ5pP5ug4ciflLa7hlYcH0xJbF3b2M3BlnUYKMqih/TjqKdr +NBs121h64SPY0gh7kIvF +-----END CERTIFICATE----- + """; + + public static void main(String[] args) throws Throwable { + java.security.cert.Certificate cert = CertificateFactory.getInstance("X509").generateCertificate(new ByteArrayInputStream(PEM.getBytes())); + if (cert == null) + throw new RuntimeException("It should be possible to decode a certificate"); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/TestJMX.java b/tests/spread/integration/openjdk-21-jre-headless/TestJMX.java new file mode 100644 index 00000000..4d65d7f5 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/TestJMX.java @@ -0,0 +1,42 @@ +import java.lang.management.ManagementFactory; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.*; + +import com.sun.tools.attach.*; + + +public class TestJMX implements TestJMXMBean { + + static final String CONNECTOR_ADDRESS = + "com.sun.management.jmxremote.localConnectorAddress"; + + @Override + public void test() { + + } + + public static void main(String[] args) throws Throwable { + ObjectName objectName = new ObjectName("test:type=basic,name=mbeantest"); + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + server.registerMBean(new TestJMX(), objectName); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:5000/jmxrmi"); + int count = JMXConnectorFactory.connect(url) + .getMBeanServerConnection() + .getMBeanCount(); + System.out.println(count); + } +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java b/tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java new file mode 100644 index 00000000..c75f6c57 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/TestJMXMBean.java @@ -0,0 +1,3 @@ +public interface TestJMXMBean { + void test(); +} diff --git a/tests/spread/integration/openjdk-21-jre-headless/task.yaml b/tests/spread/integration/openjdk-21-jre-headless/task.yaml new file mode 100644 index 00000000..00910ca1 --- /dev/null +++ b/tests/spread/integration/openjdk-21-jre-headless/task.yaml @@ -0,0 +1,59 @@ +summary: Integration tests for openjdk-21-jre-headless + +environment: + SLICE/classdatasharing: "class-data-sharing" + SLICE/core: "core" + SLICE/prefs: "prefs" +# SLICE/rmi: "rmi" # Tested in management slice +# SLICE/console: "console" # This test requires /dev/pty. Skip it. + SLICE/debug: "debug" + SLICE/management: "management" + SLICE/jfr: "jfr" + SLICE/security: "security" + SLICE/tools: "tools" + +execute: | + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-21-jre-headless_${SLICE})" + apt install --update -y openjdk-21-jdk-headless + javac *.java + cp *.java ${rootfs}/ + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc/self + for java in `find usr/lib/jvm -name java`; do + ln -sf /${java} proc/self/exe + chroot . ${java} --version + case ${SLICE} in + class-data-sharing) + chroot . ${java} -XX:ArchiveClassesAtExit=archive.cds /Main.java + ;; + core) + chroot . ${java} /Main.java + ;; + prefs) + chroot . ${java} /PrefsTest.java put + chroot . ${java} /PrefsTest.java get + ;; + debug) + chroot . ${java} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 /Main.java + ;; + management) + chroot . ${java} -Dcom.sun.management.jmxremote.port=5000 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote=true \ + -Dcom.sun.management.jmxremote.ssl=false -cp . TestJMX + ;; + jfr) + chroot . ${java} -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=dump.jfr /Main.java + ;; + security) + chroot . ${java} /ReadCertificate.java + ;; + tools) + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . $(dirname ${java})/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" + ;; + esac + done From a1d67c9817297d007d7a348114b46193f7cf1d35 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Thu, 10 Oct 2024 21:26:02 +1300 Subject: [PATCH 03/11] fix: remove jvm.cfg-default (packaging) (#363) jvm.cfg-default is a packaging artifact: https://salsa.debian.org/openjdk-team/openjdk/-/blob/master/debian/rules?ref_type=heads#L1335 It is not needed for the runtime. --- slices/openjdk-21-jre-headless.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/slices/openjdk-21-jre-headless.yaml b/slices/openjdk-21-jre-headless.yaml index 93481e07..659afe8b 100644 --- a/slices/openjdk-21-jre-headless.yaml +++ b/slices/openjdk-21-jre-headless.yaml @@ -58,7 +58,6 @@ slices: /usr/lib/jvm/java-21-openjdk-*/lib/jexec: /usr/lib/jvm/java-21-openjdk-*/lib/jspawnhelper: /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg: - /usr/lib/jvm/java-21-openjdk-*/lib/jvm.cfg-default: /usr/lib/jvm/java-21-openjdk-*/lib/libextnet.so: /usr/lib/jvm/java-21-openjdk-*/lib/libjava.so: # lib/modules support From f9129e665c89fd49ca0907342c583b7ee5dc2a96 Mon Sep 17 00:00:00 2001 From: Cristovao Cordeiro Date: Thu, 10 Oct 2024 10:34:54 +0200 Subject: [PATCH 04/11] fix(spread): check chisel binary integrity (#365) --- spread.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spread.yaml b/spread.yaml index b2bb3b95..83e8dbc7 100644 --- a/spread.yaml +++ b/spread.yaml @@ -84,16 +84,16 @@ backends: prepare: | # Deb arch to GOARCH arch="$(dpkg --print-architecture | sed -e 's/armhf/arm/g' -e 's/ppc64el/ppc64le/g')" - chisel_tar="chisel.tar.gz" apt install -y curl wget curl -s https://api.github.com/repos/canonical/chisel/releases/latest \ | awk "/browser_download_url/ && /chisel_v/ && /$arch/" \ | cut -d : -f 2,3 \ | tr -d \" \ - | xargs wget -O $chisel_tar + | xargs wget - tar -xf $chisel_tar -C /usr/local/bin + sha384sum -c chisel_v*sha384 + tar -xf chisel_v*tar.gz -C /usr/local/bin prepare-each: chisel version From fb721909f67167f2610c7c43322a0c04d8bf5177 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Tue, 15 Oct 2024 19:52:37 +1100 Subject: [PATCH 05/11] feat(24.04): add wget slices (#364) --- slices/wget.yaml | 20 ++++++++++++++++++++ tests/spread/integration/wget/task.yaml | 12 ++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 slices/wget.yaml create mode 100644 tests/spread/integration/wget/task.yaml diff --git a/slices/wget.yaml b/slices/wget.yaml new file mode 100644 index 00000000..60f3dbb5 --- /dev/null +++ b/slices/wget.yaml @@ -0,0 +1,20 @@ +package: wget + +essential: + - wget_copyright + +slices: + bins: + essential: + - libc6_libs + - libidn2-0_libs + - libpcre2-8-0_libs + - libpsl5t64_libs + - libssl3t64_libs + - libuuid1_libs + - zlib1g_libs + contents: + /usr/bin/wget: + copyright: + contents: + /usr/share/doc/wget/copyright: diff --git a/tests/spread/integration/wget/task.yaml b/tests/spread/integration/wget/task.yaml new file mode 100644 index 00000000..c0a82399 --- /dev/null +++ b/tests/spread/integration/wget/task.yaml @@ -0,0 +1,12 @@ +summary: Integration tests for wget + +execute: | + # Chisel a minimum number of slices to give us a runnable system that we can + # test in. + rootfs="$(install-slices ca-certificates_data wget_bins)" + cp /etc/resolv.conf "${rootfs}/etc/" + + # Download Chisel release and compare to a known hash. + chroot "${rootfs}/" wget https://github.com/canonical/chisel/releases/download/v1.0.0/chisel_v1.0.0_linux_amd64.tar.gz + chroot "${rootfs}/" wget https://github.com/canonical/chisel/releases/download/v1.0.0/chisel_v1.0.0_linux_amd64.tar.gz.sha384 + cd "${rootfs}" && sha384sum -c chisel_v1.0.0_linux_amd64.tar.gz.sha384 From 6aa1b244845b95536b71477a0c4c38af42874bec Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Fri, 18 Oct 2024 04:28:51 +0200 Subject: [PATCH 06/11] feat(24.04): add fontconfig slices (#220) --- slices/fontconfig.yaml | 33 +++++++++++++++++++ tests/spread/integration/fontconfig/task.yaml | 28 ++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 slices/fontconfig.yaml create mode 100644 tests/spread/integration/fontconfig/task.yaml diff --git a/slices/fontconfig.yaml b/slices/fontconfig.yaml new file mode 100644 index 00000000..9e3800d4 --- /dev/null +++ b/slices/fontconfig.yaml @@ -0,0 +1,33 @@ +package: fontconfig + +essential: + - fontconfig_copyright + +slices: + bins: + essential: + - fontconfig-config_config + - fontconfig_cache + - libc6_libs + - libfontconfig1_libs + - libfreetype6_libs + contents: + /usr/bin/fc-cache: + /usr/bin/fc-cat: + /usr/bin/fc-conflist: + /usr/bin/fc-list: + /usr/bin/fc-match: + /usr/bin/fc-pattern: + /usr/bin/fc-query: + /usr/bin/fc-scan: + /usr/bin/fc-validate: + + cache: + contents: + # The postinst script runs fc-cache to regenerate + # the fonts cache and populate that directory + /var/cache/fontconfig/: {make: true} + + copyright: + contents: + /usr/share/doc/fontconfig/copyright: diff --git a/tests/spread/integration/fontconfig/task.yaml b/tests/spread/integration/fontconfig/task.yaml new file mode 100644 index 00000000..86231f52 --- /dev/null +++ b/tests/spread/integration/fontconfig/task.yaml @@ -0,0 +1,28 @@ +summary: Integration tests for fontconfig + +execute: | + rootfs="$(install-slices fontconfig_bins)" + + # Test fc-cache + chroot ${rootfs} fc-cache + + # Test fc-cat + chroot ${rootfs} fc-cat + + # Test fc-conflist + chroot ${rootfs} fc-conflist + + # Test fc-list + chroot ${rootfs} fc-list + + # Test fc-pattern + chroot ${rootfs} fc-pattern /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf | grep 'Pattern has 1 elts' + + # Test fc-query + chroot ${rootfs} fc-query /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf | grep 'fullname: "DejaVu Serif"' + + # Test fc-scan + chroot ${rootfs} fc-scan /usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf | grep 'fullname: "DejaVu Sans Mono Oblique"' + + # Test fc-validate + chroot ${rootfs} fc-validate /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf | grep 'Satisfy the coverage for en language' From 2547a1e76a3ea9333c329bfa1c81a25a1deb40ab Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Fri, 18 Oct 2024 08:18:05 +0200 Subject: [PATCH 07/11] feat(24.04): openjdk-17 headless slices (#350) --- slices/openjdk-17-jdk-headless.yaml | 156 +++++++++++++++ slices/openjdk-17-jre-headless.yaml | 179 ++++++++++++++++++ .../openjdk-17-jdk-headless/Main.java | 5 + .../MonitoringTest.java | 7 + .../RemoteInterface.java | 4 + .../SerializableObject.java | 4 + .../openjdk-17-jdk-headless/all.policy | 3 + .../openjdk-17-jdk-headless/task.yaml | 112 +++++++++++ .../openjdk-17-jre-headless/Main.java | 5 + .../openjdk-17-jre-headless/PrefsTest.java | 13 ++ .../ReadCertificate.java | 14 ++ .../openjdk-17-jre-headless/TestJMX.java | 39 ++++ .../openjdk-17-jre-headless/TestJMXMBean.java | 3 + .../openjdk-17-jre-headless/certificate.pem | 21 ++ .../openjdk-17-jre-headless/task.yaml | 62 ++++++ 15 files changed, 627 insertions(+) create mode 100644 slices/openjdk-17-jdk-headless.yaml create mode 100644 slices/openjdk-17-jre-headless.yaml create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/Main.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/all.policy create mode 100644 tests/spread/integration/openjdk-17-jdk-headless/task.yaml create mode 100644 tests/spread/integration/openjdk-17-jre-headless/Main.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/TestJMX.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java create mode 100644 tests/spread/integration/openjdk-17-jre-headless/certificate.pem create mode 100644 tests/spread/integration/openjdk-17-jre-headless/task.yaml diff --git a/slices/openjdk-17-jdk-headless.yaml b/slices/openjdk-17-jdk-headless.yaml new file mode 100644 index 00000000..72ca2c27 --- /dev/null +++ b/slices/openjdk-17-jdk-headless.yaml @@ -0,0 +1,156 @@ +package: openjdk-17-jdk-headless + +essential: + - openjdk-17-jdk-headless_copyright + +slices: + + # OpenJDK binaries slice + core: + essential: + - libc6_libs + - openjdk-17-jre-headless_core + - openjdk-17-jre-headless_javac + - zlib1g_libs + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/javac: + /usr/lib/jvm/java-17-openjdk-*/bin/javadoc: + /usr/lib/jvm/java-17-openjdk-*/bin/javap: + /usr/lib/jvm/java-17-openjdk-*/bin/jdeprscan: + /usr/lib/jvm/java-17-openjdk-*/bin/jdeps: + /usr/lib/jvm/java-17-openjdk-*/bin/jimage: + /usr/lib/jvm/java-17-openjdk-*/bin/serialver: + + standard: + essential: + - openjdk-17-jdk-headless_core + - openjdk-17-jre-headless_standard + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/jar: + /usr/lib/jvm/java-17-openjdk-*/bin/jarsigner: + /usr/lib/jvm/java-17-openjdk-*/bin/jcmd: + /usr/lib/jvm/java-17-openjdk-*/bin/jdb: + /usr/lib/jvm/java-17-openjdk-*/bin/jfr: + /usr/lib/jvm/java-17-openjdk-*/bin/jhsdb: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/bin/jinfo: + /usr/lib/jvm/java-17-openjdk-*/bin/jmap: + /usr/lib/jvm/java-17-openjdk-*/bin/jps: + /usr/lib/jvm/java-17-openjdk-*/bin/jrunscript: + /usr/lib/jvm/java-17-openjdk-*/bin/jshell: + /usr/lib/jvm/java-17-openjdk-*/bin/jstack: + /usr/lib/jvm/java-17-openjdk-*/bin/jstat: + /usr/lib/jvm/java-17-openjdk-*/bin/jstatd: + + # OpenJDK modules required to build the runtime image + modules: + essential: + - openjdk-17-jdk-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/jlink: + /usr/lib/jvm/java-17-openjdk-*/bin/jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.base.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.compiler.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.datatransfer.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.desktop.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.instrument.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.logging.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.management.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.management.rmi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.naming.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.net.http.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.prefs.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.rmi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.scripting.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.se.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.security.jgss.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.security.sasl.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.smartcardio.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.sql.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.sql.rowset.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.transaction.xa.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.xml.crypto.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/java.xml.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.accessibility.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.attach.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.charsets.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.compiler.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.crypto.cryptoki.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.crypto.ec.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.dynalink.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.editpad.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.hotspot.agent.jmod: + arch: + - amd64 + - arm64 + - ppc64el + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.httpserver.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.incubator.foreign.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.incubator.vector.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.ed.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.jvmstat.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.le.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.opt.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.vm.ci.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.vm.compiler.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.internal.vm.compiler.management.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jartool.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.javadoc.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jcmd.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jconsole.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jdeps.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jdi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jdwp.agent.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jfr.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jlink.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jpackage.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jshell.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jsobject.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.jstatd.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.localedata.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.management.agent.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.management.jfr.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.management.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.naming.dns.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.naming.rmi.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.net.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.nio.mapmode.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.random.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.sctp.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.security.auth.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.security.jgss.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.unsupported.desktop.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.unsupported.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.xml.dom.jmod: + /usr/lib/jvm/java-17-openjdk-*/jmods/jdk.zipfs.jmod: + + # OpenJDK headers for JNI + headers: + contents: + /usr/lib/jvm/java-17-openjdk-*/include/classfile_constants.h: + /usr/lib/jvm/java-17-openjdk-*/include/jni.h: + /usr/lib/jvm/java-17-openjdk-*/include/jvmti.h: + /usr/lib/jvm/java-17-openjdk-*/include/jvmticmlr.h: + /usr/lib/jvm/java-17-openjdk-*/include/linux/jni_md.h: + + # OpenJDK headers for the debug agent development + debug-headers: + contents: + /usr/lib/jvm/java-17-openjdk-*/include/jdwpTransport.h: + + copyright: + essential: + - openjdk-17-jre-headless_copyright + contents: + /usr/share/doc/openjdk-17-jdk-headless: diff --git a/slices/openjdk-17-jre-headless.yaml b/slices/openjdk-17-jre-headless.yaml new file mode 100644 index 00000000..45d5c1b1 --- /dev/null +++ b/slices/openjdk-17-jre-headless.yaml @@ -0,0 +1,179 @@ +package: openjdk-17-jre-headless + +essential: + - openjdk-17-jre-headless_copyright + +slices: + + standard: + essential: + - openjdk-17-jre-headless_class-data-sharing + - openjdk-17-jre-headless_core + - openjdk-17-jre-headless_debug + - openjdk-17-jre-headless_jfr + - openjdk-17-jre-headless_management + - openjdk-17-jre-headless_prefs + - openjdk-17-jre-headless_rmi + - openjdk-17-jre-headless_security + - openjdk-17-jre-headless_tools + + # List of classes required to create the Class Data Sharing archive + class-data-sharing: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/classlist: + + # A minimal set of files to run a Java application + # excluded dependencies: + # - ca-certificates-java_essential - needs chisel support to run + # maintainer scripts. + # - java-common - provides update-alternatives, + # not relevant. + # - util-linux - needed for bash completion + # not relevant. + # - libjpeg8 - used in awt, not relevant + # - liblcms2-2 - used in awt, not relevant + core: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + - zlib1g_libs + contents: + /etc/java-17-openjdk/jvm-*.cfg: + /etc/java-17-openjdk/logging.properties: + /etc/java-17-openjdk/net.properties: + /etc/java-17-openjdk/security/java.policy: + /etc/java-17-openjdk/security/java.security: + /usr/lib/jvm/java-17-openjdk-*/bin/java: + /usr/lib/jvm/java-17-openjdk-*/conf/logging.properties: + /usr/lib/jvm/java-17-openjdk-*/conf/net.properties: + /usr/lib/jvm/java-17-openjdk-*/conf/security/java.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security: + /usr/lib/jvm/java-17-openjdk-*/lib/jexec: + /usr/lib/jvm/java-17-openjdk-*/lib/jspawnhelper: + /usr/lib/jvm/java-17-openjdk-*/lib/jvm.cfg: + /usr/lib/jvm/java-17-openjdk-*/lib/libextnet.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjava.so: + # lib/modules support + /usr/lib/jvm/java-17-openjdk-*/lib/libjimage.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjli.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjsig.so: + # required for IO. + /usr/lib/jvm/java-17-openjdk-*/lib/libnet.so: + # required for IO. + /usr/lib/jvm/java-17-openjdk-*/lib/libnio.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libverify.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libzip.so: + /usr/lib/jvm/java-17-openjdk-*/lib/modules: + /usr/lib/jvm/java-17-openjdk-*/lib/server/libjsig.so: + /usr/lib/jvm/java-17-openjdk-*/lib/server/libjvm.so: + /usr/lib/jvm/java-17-openjdk-*/lib/tzdb.dat: + + # Native part of jdk.prefs modules + prefs: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/libprefs.so: + + # Native part of java.rmi + rmi: + essential: + - openjdk-17-jre-headless_security + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/rmiregistry: + /usr/lib/jvm/java-17-openjdk-*/lib/librmi.so: + + # Debug support + debug: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/libattach.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libdt_socket.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libinstrument.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjdwp.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libsaproc.so: + arch: + - amd64 + - arm64 + - armhf + - ppc64el + + # Configuration and native part of Java Management Extensions + management: + essential: + - openjdk-17-jre-headless_rmi + contents: + /etc/java-17-openjdk/management/jmxremote.access: + /etc/java-17-openjdk/management/management.properties: + /usr/lib/jvm/java-17-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-17-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-17-openjdk-*/lib/libmanagement.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libmanagement_agent.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libmanagement_ext.so: + + # Security configuration files and native libraries + security: + essential: + - libnss3_libs + - libpcsclite1_libs + - openjdk-17-jre-headless_core + contents: + /etc/java-17-openjdk/security/blocked.certs: + /etc/java-17-openjdk/security/default.policy: + /etc/java-17-openjdk/security/nss.cfg: + /etc/java-17-openjdk/security/policy/limited/default_US_export.policy: + /etc/java-17-openjdk/security/policy/limited/default_local.policy: + /etc/java-17-openjdk/security/policy/limited/exempt_local.policy: + /etc/java-17-openjdk/security/policy/unlimited/default_US_export.policy: + /etc/java-17-openjdk/security/policy/unlimited/default_local.policy: + /etc/java-17-openjdk/security/public_suffix_list.dat: + /usr/lib/jvm/java-17-openjdk-*/conf/security/nss.cfg: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/limited/default_US_export.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/limited/default_local.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/limited/exempt_local.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/unlimited/default_US_export.policy: + /usr/lib/jvm/java-17-openjdk-*/conf/security/policy/unlimited/default_local.policy: + /usr/lib/jvm/java-17-openjdk-*/lib/libj2gss.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libj2pcsc.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libj2pkcs11.so: + /usr/lib/jvm/java-17-openjdk-*/lib/libjaas.so: + /usr/lib/jvm/java-17-openjdk-*/lib/security/blocked.certs: + /usr/lib/jvm/java-17-openjdk-*/lib/security/cacerts: + /usr/lib/jvm/java-17-openjdk-*/lib/security/default.policy: + /usr/lib/jvm/java-17-openjdk-*/lib/security/public_suffix_list.dat: + + # OpenJDK tools + tools: + essential: + - openjdk-17-jre-headless_security + contents: + /usr/lib/jvm/java-17-openjdk-*/bin/keytool: + /usr/lib/jvm/java-17-openjdk-amd64/bin/jpackage: + arch: + - amd64 + + # Java Flight Recorder configuration and jar file + jfr: + essential: + - openjdk-17-jre-headless_core + contents: + /etc/java-17-openjdk/jfr/default.jfc: + /etc/java-17-openjdk/jfr/profile.jfc: + /usr/lib/jvm/java-17-openjdk-*/lib/jfr/default.jfc: + /usr/lib/jvm/java-17-openjdk-*/lib/jfr/profile.jfc: + /usr/lib/jvm/java-17-openjdk-*/lib/jrt-fs.jar: + + # Javac JDK API signatures for the backwards compatibility + javac: + essential: + - openjdk-17-jre-headless_core + contents: + /usr/lib/jvm/java-17-openjdk-*/lib/ct.sym: + + copyright: + contents: + /usr/share/doc/openjdk-17-jre-headless/copyright: diff --git a/tests/spread/integration/openjdk-17-jdk-headless/Main.java b/tests/spread/integration/openjdk-17-jdk-headless/Main.java new file mode 100644 index 00000000..40b5eeef --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args){ + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java b/tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java new file mode 100644 index 00000000..aa09573f --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/MonitoringTest.java @@ -0,0 +1,7 @@ +public class MonitoringTest { + public static void main(String[] args) throws InterruptedException { + while (true) { + Thread.sleep(1000); + } + } +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java b/tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java new file mode 100644 index 00000000..d1940363 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/RemoteInterface.java @@ -0,0 +1,4 @@ +import java.rmi.Remote; + +public class RemoteInterface implements Remote { +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java b/tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java new file mode 100644 index 00000000..b4605642 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/SerializableObject.java @@ -0,0 +1,4 @@ +import java.io.Serializable; + +public class SerializableObject implements Serializable { +} diff --git a/tests/spread/integration/openjdk-17-jdk-headless/all.policy b/tests/spread/integration/openjdk-17-jdk-headless/all.policy new file mode 100644 index 00000000..1d0ce886 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/all.policy @@ -0,0 +1,3 @@ +grant { + permission java.security.AllPermission; +}; diff --git a/tests/spread/integration/openjdk-17-jdk-headless/task.yaml b/tests/spread/integration/openjdk-17-jdk-headless/task.yaml new file mode 100644 index 00000000..a25411f9 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jdk-headless/task.yaml @@ -0,0 +1,112 @@ +summary: Integration tests for openjdk-17-jdk-headless + +environment: + SLICE/core: "core" + SLICE/standard: "standard" + SLICE/modules: "modules" + +execute: | + pids=() + cleanup() { + for pid in "${pids[@]}"; do + kill "$pid" || true + done + } + for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done + trap cleanup EXIT + + apt install --update -y openjdk-17-jdk-headless + + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-17-jdk-headless_${SLICE} dash_bins)" + cp *.java ${rootfs}/ + cp all.policy ${rootfs}/ + javac *.java + + nohup java -cp . MonitoringTest & + pid=$! + pids+=("$pid") + + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc sys tmp + mount --bind /proc proc + mount --bind /sys sys + mount --bind /tmp tmp + case ${SLICE} in + core) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-17-openjdk-*/bin/javac: + chroot . ${home}/javac /Main.java -d / + # /usr/lib/jvm/java-17-openjdk-*/bin/javadoc: + chroot . ${home}/javadoc /Main.java + # /usr/lib/jvm/java-17-openjdk-*/bin/javap: + chroot . ${home}/javap -l /Main.class + # /usr/lib/jvm/java-17-openjdk-*/bin/jdeprscan: + chroot . ${home}/jdeprscan --class-path . Main + # /usr/lib/jvm/java-17-openjdk-*/bin/jdeps: + chroot . ${home}/jdeps -m java.base + # /usr/lib/jvm/java-17-openjdk-*/bin/jimage: + chroot . ${home}/jimage info ${home}/../lib/modules + # /usr/lib/jvm/java-17-openjdk-*/bin/serialver: + chroot . ${home}/serialver -classpath / SerializableObject + done + ;; + standard) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-17-openjdk-*/bin/jar: + # /usr/lib/jvm/java-17-openjdk-*/bin/jarsigner: + chroot . ${home}/jar cvf test.jar *.java + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . ${home}/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" -alias foo + chroot . ${home}/jarsigner -keystore foo -storepass barbar test.jar foo + # /usr/lib/jvm/java-17-openjdk-*/bin/jdb: + chroot . /usr/bin/sh -c "echo run | ${home}/jdb Main.java" + # /usr/lib/jvm/java-17-openjdk-*/bin/jcmd: + chroot . ${home}/jcmd MonitoringTest VM.version + # /usr/lib/jvm/java-17-openjdk-*/bin/jhsdb: + if [ -f ${home}/jhsdb ]; then + chroot . ${home}/jhsdb jstack --pid ${pid} + fi + # /usr/lib/jvm/java-17-openjdk-*/bin/jfr: + chroot . ${home}/jcmd ${pid} JFR.start name=recording maxsize=1MB + chroot . ${home}/jcmd ${pid} JFR.dump name=recording filename=/tmp/recording.jfr + chroot . ${home}/jfr print /tmp/recording.jfr > /dev/null + # /usr/lib/jvm/java-17-openjdk-*/bin/jinfo: + chroot . ${home}/jinfo ${pid} + # /usr/lib/jvm/java-17-openjdk-*/bin/jrunscript: + chroot . ${home}/jrunscript -q + # /usr/lib/jvm/java-17-openjdk-*/bin/jshell: + chroot . /usr/bin/sh -c "echo 'System.out.println(\"hello world\")' | ${home}/jshell" + # /usr/lib/jvm/java-17-openjdk-*/bin/jstack: + chroot . ${home}/jstack ${pid} + # /usr/lib/jvm/java-17-openjdk-*/bin/jstat: + chroot . ${home}/jstat -gc ${pid} + # /usr/lib/jvm/java-17-openjdk-*/bin/jstatd: + nohup chroot . ${home}/jstatd -J-Djava.security.policy=all.policy > ./jstatd.log & + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + grep -q "bound to /JStatRemoteHost" "jstatd.log" && break + sleep 10 + done + done + ;; + modules) + cd ${rootfs} + for jlink in `find usr/lib/jvm -name jlink`; do + output=$(basename $(mktemp -u)) + chroot . ${jlink} --add-modules java.base --output ${output} + rm -rf ${rootfs}/${output} + done + for jmod in `find usr/lib/jvm -name jmod`; do + home=$(dirname ${jmod}) + chroot . ${jmod} list ${home}/../jmods/java.rmi.jmod + done + ;; + esac diff --git a/tests/spread/integration/openjdk-17-jre-headless/Main.java b/tests/spread/integration/openjdk-17-jre-headless/Main.java new file mode 100644 index 00000000..47e5d0af --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java b/tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java new file mode 100644 index 00000000..73c4ee63 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/PrefsTest.java @@ -0,0 +1,13 @@ +import java.util.prefs.*; + +public class PrefsTest { + public static void main(String[] args) { + if ("put".equals(args[0])) { + Preferences.userRoot().put("a", "b"); + } else if ("get".equals(args[0])) { + if (!"b".equals(Preferences.userRoot().get("a", null))) { + throw new RuntimeException("Unable to read the preference"); + } + } + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java b/tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java new file mode 100644 index 00000000..ef92fd99 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/ReadCertificate.java @@ -0,0 +1,14 @@ +import java.security.cert.*; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; + +public class ReadCertificate { + + public static void main(String[] args) throws Throwable { + byte[] pem = Files.readAllBytes(Path.of("certificate.pem")); + java.security.cert.Certificate cert = CertificateFactory.getInstance("X509").generateCertificate(new ByteArrayInputStream(pem)); + if (cert == null) + throw new RuntimeException("It should be possible to decode a certificate"); + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/TestJMX.java b/tests/spread/integration/openjdk-17-jre-headless/TestJMX.java new file mode 100644 index 00000000..e27d058d --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/TestJMX.java @@ -0,0 +1,39 @@ +import java.lang.management.ManagementFactory; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.*; +import com.sun.tools.attach.*; + +public class TestJMX implements TestJMXMBean { + + static final String CONNECTOR_ADDRESS = + "com.sun.management.jmxremote.localConnectorAddress"; + + @Override + public void test() { + } + + public static void main(String[] args) throws Throwable { + ObjectName objectName = new ObjectName("test:type=basic,name=mbeantest"); + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + server.registerMBean(new TestJMX(), objectName); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:5000/jmxrmi"); + int count = JMXConnectorFactory.connect(url) + .getMBeanServerConnection() + .getMBeanCount(); + System.out.println(count); + } +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java b/tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java new file mode 100644 index 00000000..c75f6c57 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/TestJMXMBean.java @@ -0,0 +1,3 @@ +public interface TestJMXMBean { + void test(); +} diff --git a/tests/spread/integration/openjdk-17-jre-headless/certificate.pem b/tests/spread/integration/openjdk-17-jre-headless/certificate.pem new file mode 100644 index 00000000..645e9f80 --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/certificate.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIULvuqN3MiptnZSYS9y1qJAZYKFA4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA4MTUwMjQzNDhaFw0yNTA4 +MTUwMjQzNDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDm3990peBuPYaz0UEEc75Q7i79P4RzrD84MxhDpoPs +MSdnmO3rTkIG84Wp72+8T7TGjGjBhX++8UmZLrXy2AfcejZi3JcddMWH4V5XEnAj +hTBe1HLkiotayZst/cxuTP6KmuahjsROAqriCv/A4BBA8KjYx1e4E9k9+81FreZy +PJ8p3m7R8qZ/DtjuW1aMQ3oDRKA/iqQhLHVpJy/iYiyjwTdJm6/lA3ywGCr6ZMWm +9tWUT+4TvhyRM67Y0gcCtH51cwxPqUFGEKAkLWIu2fS6DaoXtHylxgGeKKPes3JX +uSn9QezEEqvrgLFQRqIUS8tNZFEhoJQ7dmxMP/XKAD51AgMBAAGjUzBRMB0GA1Ud +DgQWBBSb70j+xaI3eTxp4H7MDm1MLVRGNTAfBgNVHSMEGDAWgBSb70j+xaI3eTxp +4H7MDm1MLVRGNTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAp +0GIjKtwvD7BkQy+cf3dsdwYodxoIYl4E8UvHfBSPQQfFNh+chHPmrNYRuFM3Q6sT +ogNhHKLecQMK4tNUDa/vVRGnqmZVWjxqLnyH/qFKtakqPB6h6x4h50huzA+twhNm +SDjg3QqqpOuUzrs77JqYkxSjqd0QgmwmgxOdbcF0SY+ebQhAd0UXY7wIs6ByDEHO +kElgJmnGKhOpf1SFpQh2qpKGq/MvcdHWN4oKri440wCf+czkrOTyGVc275oTbRnM +Z76Ro4JDuomyWeR9iQ5pP5ug4ciflLa7hlYcH0xJbF3b2M3BlnUYKMqih/TjqKdr +NBs121h64SPY0gh7kIvF +-----END CERTIFICATE----- diff --git a/tests/spread/integration/openjdk-17-jre-headless/task.yaml b/tests/spread/integration/openjdk-17-jre-headless/task.yaml new file mode 100644 index 00000000..275c4a6a --- /dev/null +++ b/tests/spread/integration/openjdk-17-jre-headless/task.yaml @@ -0,0 +1,62 @@ +summary: Integration tests for openjdk-17-jre-headless + +environment: + SLICE/classdatasharing: "class-data-sharing" + SLICE/core: "core" + SLICE/prefs: "prefs" +# SLICE/rmi: "rmi" # Tested in management slice + SLICE/debug: "debug" + SLICE/management: "management" + SLICE/jfr: "jfr" + SLICE/security: "security" + SLICE/tools: "tools" + +execute: | + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-17-jre-headless_${SLICE} dash_bins)" + apt install --update -y openjdk-11-jdk-headless + javac *.java + jar cvf test.jar *.java + cp *.jar ${rootfs}/ + cp *.java ${rootfs}/ + cp *.class ${rootfs}/ + cp certificate.pem ${rootfs}/ + cd ${rootfs} + mkdir -p proc/self + for java in `find usr/lib/jvm -name java`; do + ln -sf /${java} proc/self/exe + chroot . ${java} --version + case ${SLICE} in + class-data-sharing) + chroot . ${java} -Xshare:dump + chroot . ${java} -XX:ArchiveClassesAtExit=archive.cds /Main.java + ;; + core) + chroot . ${java} -cp . Main + ;; + prefs) + chroot . ${java} -cp . PrefsTest put + chroot . ${java} -cp . PrefsTest get + ;; + debug) + chroot . ${java} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -cp . Main + ;; + management) + chroot . ${java} -Dcom.sun.management.jmxremote.port=5000 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote=true \ + -Dcom.sun.management.jmxremote.ssl=false -cp . TestJMX + ;; + jfr) + chroot . ${java} -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=dump.jfr -cp . Main + ;; + security) + chroot . ${java} -cp . ReadCertificate + ;; + tools) + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . $(dirname ${java})/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" + ;; + esac + done From d55463bd705036ec4b654ce036778512053d668d Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Fri, 18 Oct 2024 08:18:31 +0200 Subject: [PATCH 08/11] feat(24.04): openjdk-11 headless slices (#349) --- slices/openjdk-11-jdk-headless.yaml | 162 +++++++++++++++ slices/openjdk-11-jre-headless.yaml | 192 ++++++++++++++++++ .../openjdk-11-jdk-headless/Main.java | 5 + .../MonitoringTest.java | 7 + .../RemoteInterface.java | 4 + .../SerializableObject.java | 4 + .../openjdk-11-jdk-headless/all.policy | 3 + .../openjdk-11-jdk-headless/task.yaml | 114 +++++++++++ .../openjdk-11-jre-headless/Main.java | 5 + .../openjdk-11-jre-headless/PrefsTest.java | 13 ++ .../ReadCertificate.java | 14 ++ .../openjdk-11-jre-headless/TestJMX.java | 39 ++++ .../openjdk-11-jre-headless/TestJMXMBean.java | 3 + .../openjdk-11-jre-headless/certificate.pem | 21 ++ .../openjdk-11-jre-headless/task.yaml | 63 ++++++ 15 files changed, 649 insertions(+) create mode 100644 slices/openjdk-11-jdk-headless.yaml create mode 100644 slices/openjdk-11-jre-headless.yaml create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/Main.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/all.policy create mode 100644 tests/spread/integration/openjdk-11-jdk-headless/task.yaml create mode 100644 tests/spread/integration/openjdk-11-jre-headless/Main.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/TestJMX.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java create mode 100644 tests/spread/integration/openjdk-11-jre-headless/certificate.pem create mode 100644 tests/spread/integration/openjdk-11-jre-headless/task.yaml diff --git a/slices/openjdk-11-jdk-headless.yaml b/slices/openjdk-11-jdk-headless.yaml new file mode 100644 index 00000000..a2436fab --- /dev/null +++ b/slices/openjdk-11-jdk-headless.yaml @@ -0,0 +1,162 @@ +package: openjdk-11-jdk-headless + +essential: + - openjdk-11-jdk-headless_copyright + +slices: + + # OpenJDK binaries slice + core: + essential: + - libc6_libs + - openjdk-11-jre-headless_core + - openjdk-11-jre-headless_javac + - zlib1g_libs + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/javac: + /usr/lib/jvm/java-11-openjdk-*/bin/javadoc: + /usr/lib/jvm/java-11-openjdk-*/bin/javap: + /usr/lib/jvm/java-11-openjdk-*/bin/jdeprscan: + /usr/lib/jvm/java-11-openjdk-*/bin/jdeps: + /usr/lib/jvm/java-11-openjdk-*/bin/jimage: + /usr/lib/jvm/java-11-openjdk-*/bin/serialver: + + # excludes jaotc - this requires binutils + standard: + essential: + - openjdk-11-jdk-headless_core + - openjdk-11-jre-headless_standard + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/jar: + /usr/lib/jvm/java-11-openjdk-*/bin/jarsigner: + /usr/lib/jvm/java-11-openjdk-*/bin/jcmd: + /usr/lib/jvm/java-11-openjdk-*/bin/jdb: + /usr/lib/jvm/java-11-openjdk-*/bin/jfr: + /usr/lib/jvm/java-11-openjdk-*/bin/jhsdb: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/bin/jinfo: + /usr/lib/jvm/java-11-openjdk-*/bin/jmap: + /usr/lib/jvm/java-11-openjdk-*/bin/jps: + /usr/lib/jvm/java-11-openjdk-*/bin/jrunscript: + /usr/lib/jvm/java-11-openjdk-*/bin/jshell: + /usr/lib/jvm/java-11-openjdk-*/bin/jstack: + /usr/lib/jvm/java-11-openjdk-*/bin/jstat: + /usr/lib/jvm/java-11-openjdk-*/bin/jstatd: + /usr/lib/jvm/java-11-openjdk-*/bin/rmic: + + # OpenJDK modules required to build the runtime image + modules: + essential: + - openjdk-11-jdk-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/jlink: + /usr/lib/jvm/java-11-openjdk-*/bin/jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.base.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.compiler.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.datatransfer.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.desktop.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.instrument.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.logging.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.management.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.management.rmi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.naming.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.net.http.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.prefs.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.rmi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.scripting.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.se.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.security.jgss.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.security.sasl.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.smartcardio.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.sql.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.sql.rowset.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.transaction.xa.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.xml.crypto.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/java.xml.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.accessibility.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.aot.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.attach.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.charsets.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.compiler.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.crypto.cryptoki.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.crypto.ec.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.dynalink.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.editpad.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.hotspot.agent.jmod: + arch: + - amd64 + - arm64 + - ppc64el + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.httpserver.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.ed.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.jvmstat.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.le.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.opt.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.vm.ci.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.vm.compiler.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.internal.vm.compiler.management.jmod: + arch: + - amd64 + - arm64 + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jartool.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.javadoc.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jcmd.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jconsole.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jdeps.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jdi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jdwp.agent.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jfr.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jlink.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jshell.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jsobject.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.jstatd.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.localedata.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.management.agent.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.management.jfr.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.management.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.naming.dns.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.naming.ldap.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.naming.rmi.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.net.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.pack.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.rmic.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.scripting.nashorn.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.scripting.nashorn.shell.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.sctp.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.security.auth.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.security.jgss.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.unsupported.desktop.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.unsupported.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.xml.dom.jmod: + /usr/lib/jvm/java-11-openjdk-*/jmods/jdk.zipfs.jmod: + + # OpenJDK headers for JNI + headers: + contents: + /usr/lib/jvm/java-11-openjdk-*/include/classfile_constants.h: + /usr/lib/jvm/java-11-openjdk-*/include/jni.h: + /usr/lib/jvm/java-11-openjdk-*/include/jvmti.h: + /usr/lib/jvm/java-11-openjdk-*/include/jvmticmlr.h: + /usr/lib/jvm/java-11-openjdk-*/include/linux/jni_md.h: + + # OpenJDK headers for the debug agent development + debug-headers: + contents: + /usr/lib/jvm/java-11-openjdk-*/include/jdwpTransport.h: + + copyright: + essential: + - openjdk-11-jre-headless_copyright + contents: + /usr/share/doc/openjdk-11-jdk-headless: diff --git a/slices/openjdk-11-jre-headless.yaml b/slices/openjdk-11-jre-headless.yaml new file mode 100644 index 00000000..3b2d5c77 --- /dev/null +++ b/slices/openjdk-11-jre-headless.yaml @@ -0,0 +1,192 @@ +package: openjdk-11-jre-headless + +essential: + - openjdk-11-jre-headless_copyright + +slices: + + # A minimal set of files to run a Java application + # excluded dependencies: + # - ca-certificates-java_essential - needs chisel support to run + # maintainer scripts. + # - java-common - provides update-alternatives, + # not relevant. + # - util-linux - needed for bash completion + # not relevant. + # - libjpeg8 - used in awt, not relevant + # - liblcms2-2 - used in awt, not relevant + standard: + essential: + - openjdk-11-jre-headless_class-data-sharing + - openjdk-11-jre-headless_core + - openjdk-11-jre-headless_debug + - openjdk-11-jre-headless_jfr + - openjdk-11-jre-headless_management + - openjdk-11-jre-headless_prefs + - openjdk-11-jre-headless_rmi + - openjdk-11-jre-headless_security + - openjdk-11-jre-headless_tools + + # List of classes required to create the Class Data Sharing archive + class-data-sharing: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/classlist: + arch: + - amd64 + - arm64 + - armhf + - i386 + - ppc64el + - s390x + + # A minimal set of files to run a Java application + core: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + - zlib1g_libs + contents: + /etc/java-11-openjdk/jvm-*.cfg: + /etc/java-11-openjdk/logging.properties: + /etc/java-11-openjdk/management/jmxremote.access: + /etc/java-11-openjdk/management/management.properties: + /etc/java-11-openjdk/net.properties: + /etc/java-11-openjdk/security/java.policy: + /etc/java-11-openjdk/security/java.security: + /usr/lib/jvm/java-11-openjdk-*/bin/java: + /usr/lib/jvm/java-11-openjdk-*/conf/logging.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-11-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/net.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/security/java.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/java.security: + /usr/lib/jvm/java-11-openjdk-*/lib/jexec: + /usr/lib/jvm/java-11-openjdk-*/lib/jli/libjli.so: + /usr/lib/jvm/java-11-openjdk-*/lib/jspawnhelper: + /usr/lib/jvm/java-11-openjdk-*/lib/jvm.cfg: + /usr/lib/jvm/java-11-openjdk-*/lib/libextnet.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjava.so: + # lib/modules support + /usr/lib/jvm/java-11-openjdk-*/lib/libjimage.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjsig.so: + # required for IO. + /usr/lib/jvm/java-11-openjdk-*/lib/libnet.so: + # required for IO. + /usr/lib/jvm/java-11-openjdk-*/lib/libnio.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libverify.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libzip.so: + /usr/lib/jvm/java-11-openjdk-*/lib/modules: + /usr/lib/jvm/java-11-openjdk-*/lib/server/libjsig.so: + /usr/lib/jvm/java-11-openjdk-*/lib/server/libjvm.so: + /usr/lib/jvm/java-11-openjdk-*/lib/tzdb.dat: + + # Native part of jdk.prefs modules + prefs: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/libprefs.so: + + # Native part of java.rmi + rmi: + essential: + - openjdk-11-jre-headless_security + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/rmid: + /usr/lib/jvm/java-11-openjdk-*/bin/rmiregistry: + /usr/lib/jvm/java-11-openjdk-*/lib/librmi.so: + + # Debug support + debug: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/libattach.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libdt_socket.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libinstrument.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjdwp.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libsaproc.so: + arch: + - amd64 + - arm64 + - armhf + - ppc64el + + # Configuration and native part of Java Management Extensions + management: + essential: + - openjdk-11-jre-headless_rmi + contents: + /etc/java-11-openjdk/management/jmxremote.access: + /etc/java-11-openjdk/management/management.properties: + /usr/lib/jvm/java-11-openjdk-*/conf/management/jmxremote.access: + /usr/lib/jvm/java-11-openjdk-*/conf/management/management.properties: + /usr/lib/jvm/java-11-openjdk-*/lib/libmanagement.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libmanagement_agent.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libmanagement_ext.so: + + # Security configuration files and native libraries + security: + essential: + - libnss3_libs + - libpcsclite1_libs + - openjdk-11-jre-headless_core + contents: + /etc/java-11-openjdk/security/blocked.certs: + /etc/java-11-openjdk/security/default.policy: + /etc/java-11-openjdk/security/nss.cfg: + /etc/java-11-openjdk/security/policy/limited/default_US_export.policy: + /etc/java-11-openjdk/security/policy/limited/default_local.policy: + /etc/java-11-openjdk/security/policy/limited/exempt_local.policy: + /etc/java-11-openjdk/security/policy/unlimited/default_US_export.policy: + /etc/java-11-openjdk/security/policy/unlimited/default_local.policy: + /etc/java-11-openjdk/security/public_suffix_list.dat: + /usr/lib/jvm/java-11-openjdk-*/conf/security/nss.cfg: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/limited/default_US_export.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/limited/default_local.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/limited/exempt_local.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/unlimited/default_US_export.policy: + /usr/lib/jvm/java-11-openjdk-*/conf/security/policy/unlimited/default_local.policy: + /usr/lib/jvm/java-11-openjdk-*/lib/libj2gss.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libj2pcsc.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libj2pkcs11.so: + /usr/lib/jvm/java-11-openjdk-*/lib/libjaas.so: + /usr/lib/jvm/java-11-openjdk-*/lib/security/blocked.certs: + /usr/lib/jvm/java-11-openjdk-*/lib/security/cacerts: + /usr/lib/jvm/java-11-openjdk-*/lib/security/default.policy: + /usr/lib/jvm/java-11-openjdk-*/lib/security/public_suffix_list.dat: + + # OpenJDK tools + tools: + essential: + - openjdk-11-jre-headless_security + contents: + /usr/lib/jvm/java-11-openjdk-*/bin/jjs: + /usr/lib/jvm/java-11-openjdk-*/bin/keytool: + /usr/lib/jvm/java-11-openjdk-*/bin/pack200: + /usr/lib/jvm/java-11-openjdk-*/bin/unpack200: + + # Java Flight Recorder configuration and jar file + jfr: + essential: + - openjdk-11-jre-headless_core + contents: + /etc/java-11-openjdk/jfr/default.jfc: + /etc/java-11-openjdk/jfr/profile.jfc: + /usr/lib/jvm/java-11-openjdk-*/lib/jfr/default.jfc: + /usr/lib/jvm/java-11-openjdk-*/lib/jfr/profile.jfc: + /usr/lib/jvm/java-11-openjdk-*/lib/jrt-fs.jar: + + # Javac JDK API signatures for the backwards compatibility + javac: + essential: + - openjdk-11-jre-headless_core + contents: + /usr/lib/jvm/java-11-openjdk-*/lib/ct.sym: + + copyright: + contents: + /usr/share/doc/openjdk-11-jre-headless/copyright: diff --git a/tests/spread/integration/openjdk-11-jdk-headless/Main.java b/tests/spread/integration/openjdk-11-jdk-headless/Main.java new file mode 100644 index 00000000..40b5eeef --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args){ + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java b/tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java new file mode 100644 index 00000000..aa09573f --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/MonitoringTest.java @@ -0,0 +1,7 @@ +public class MonitoringTest { + public static void main(String[] args) throws InterruptedException { + while (true) { + Thread.sleep(1000); + } + } +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java b/tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java new file mode 100644 index 00000000..d1940363 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/RemoteInterface.java @@ -0,0 +1,4 @@ +import java.rmi.Remote; + +public class RemoteInterface implements Remote { +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java b/tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java new file mode 100644 index 00000000..b4605642 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/SerializableObject.java @@ -0,0 +1,4 @@ +import java.io.Serializable; + +public class SerializableObject implements Serializable { +} diff --git a/tests/spread/integration/openjdk-11-jdk-headless/all.policy b/tests/spread/integration/openjdk-11-jdk-headless/all.policy new file mode 100644 index 00000000..1d0ce886 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/all.policy @@ -0,0 +1,3 @@ +grant { + permission java.security.AllPermission; +}; diff --git a/tests/spread/integration/openjdk-11-jdk-headless/task.yaml b/tests/spread/integration/openjdk-11-jdk-headless/task.yaml new file mode 100644 index 00000000..b5afd1f0 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jdk-headless/task.yaml @@ -0,0 +1,114 @@ +summary: Integration tests for openjdk-11-jdk-headless + +environment: + SLICE/core: "core" + SLICE/standard: "standard" + SLICE/modules: "modules" + +execute: | + pids=() + cleanup() { + for pid in "${pids[@]}"; do + kill "$pid" || true + done + } + for sig in INT QUIT HUP TERM; do trap "cleanup; trap - $sig EXIT; kill -s $sig "'"$$"' "$sig"; done + trap cleanup EXIT + + apt install --update -y openjdk-11-jdk-headless + + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-11-jdk-headless_${SLICE} dash_bins)" + cp *.java ${rootfs}/ + cp all.policy ${rootfs}/ + javac *.java + + nohup java -cp . MonitoringTest & + pid=$! + pids+=("$pid") + + cp *.class ${rootfs}/ + cd ${rootfs} + mkdir -p proc sys tmp + mount --bind /proc proc + mount --bind /sys sys + mount --bind /tmp tmp + case ${SLICE} in + core) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-11-openjdk-*/bin/javac: + chroot . ${home}/javac /Main.java -d / + # /usr/lib/jvm/java-11-openjdk-*/bin/javadoc: + chroot . ${home}/javadoc /Main.java + # /usr/lib/jvm/java-11-openjdk-*/bin/javap: + chroot . ${home}/javap -l /Main.class + # /usr/lib/jvm/java-11-openjdk-*/bin/jdeprscan: + chroot . ${home}/jdeprscan --class-path . Main + # /usr/lib/jvm/java-11-openjdk-*/bin/jdeps: + chroot . ${home}/jdeps -m java.base + # /usr/lib/jvm/java-11-openjdk-*/bin/jimage: + chroot . ${home}/jimage info ${home}/../lib/modules + # /usr/lib/jvm/java-11-openjdk-*/bin/serialver: + chroot . ${home}/serialver -classpath / SerializableObject + done + ;; + standard) + for java in `find usr/lib/jvm -name java`; do + home=$(dirname ${java}) + # /usr/lib/jvm/java-11-openjdk-*/bin/jar: + # /usr/lib/jvm/java-11-openjdk-*/bin/jarsigner: + chroot . ${home}/jar cvf test.jar *.java + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . ${home}/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" -alias foo + chroot . ${home}/jarsigner -keystore foo -storepass barbar test.jar foo + # /usr/lib/jvm/java-11-openjdk-*/bin/jdb: + chroot . /usr/bin/sh -c "echo run | ${home}/jdb Main.java" + # /usr/lib/jvm/java-11-openjdk-*/bin/jcmd: + chroot . ${home}/jcmd MonitoringTest VM.version + # /usr/lib/jvm/java-11-openjdk-*/bin/jhsdb: + if [ -f ${home}/jhsdb ]; then + chroot . ${home}/jhsdb jstack --pid ${pid} + fi + # /usr/lib/jvm/java-11-openjdk-*/bin/jfr: + chroot . ${home}/jcmd ${pid} JFR.start name=recording maxsize=1MB + chroot . ${home}/jcmd ${pid} JFR.dump name=recording filename=/tmp/recording.jfr + chroot . ${home}/jfr print /tmp/recording.jfr > /dev/null + # /usr/lib/jvm/java-11-openjdk-*/bin/jinfo: + chroot . ${home}/jinfo ${pid} + # /usr/lib/jvm/java-11-openjdk-*/bin/jrunscript: + chroot . /usr/bin/sh -c "echo 'exit()' | ${home}/jrunscript" + # /usr/lib/jvm/java-11-openjdk-*/bin/jshell: + chroot . /usr/bin/sh -c "echo 'System.out.println(\"hello world\")' | ${home}/jshell" + # /usr/lib/jvm/java-11-openjdk-*/bin/jstack: + chroot . ${home}/jstack ${pid} + # /usr/lib/jvm/java-11-openjdk-*/bin/jstat: + chroot . ${home}/jstat -gc ${pid} + # /usr/lib/jvm/java-11-openjdk-*/bin/jstatd: + nohup chroot . ${home}/jstatd -J-Djava.security.policy=all.policy > ./jstatd.log & + pids+=($!) + for retry in 0 1 2 3 4 5; do + if [ ${retry} -eq 5 ]; then + exit 1 + fi + grep -q "bound to /JStatRemoteHost" "jstatd.log" && break + sleep 10 + done + # /usr/lib/jvm/java-11-openjdk-*/bin/rmic + chroot . ${home}/rmic -classpath . RemoteInterface + done + ;; + modules) + cd ${rootfs} + for jlink in `find usr/lib/jvm -name jlink`; do + output=$(basename $(mktemp -u)) + chroot . ${jlink} --add-modules java.base --output ${output} + rm -rf ${rootfs}/${output} + done + for jmod in `find usr/lib/jvm -name jmod`; do + home=$(dirname ${jmod}) + chroot . ${jmod} list ${home}/../jmods/java.rmi.jmod + done + ;; + esac diff --git a/tests/spread/integration/openjdk-11-jre-headless/Main.java b/tests/spread/integration/openjdk-11-jre-headless/Main.java new file mode 100644 index 00000000..47e5d0af --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/Main.java @@ -0,0 +1,5 @@ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java b/tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java new file mode 100644 index 00000000..73c4ee63 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/PrefsTest.java @@ -0,0 +1,13 @@ +import java.util.prefs.*; + +public class PrefsTest { + public static void main(String[] args) { + if ("put".equals(args[0])) { + Preferences.userRoot().put("a", "b"); + } else if ("get".equals(args[0])) { + if (!"b".equals(Preferences.userRoot().get("a", null))) { + throw new RuntimeException("Unable to read the preference"); + } + } + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java b/tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java new file mode 100644 index 00000000..ef92fd99 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/ReadCertificate.java @@ -0,0 +1,14 @@ +import java.security.cert.*; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.Path; + +public class ReadCertificate { + + public static void main(String[] args) throws Throwable { + byte[] pem = Files.readAllBytes(Path.of("certificate.pem")); + java.security.cert.Certificate cert = CertificateFactory.getInstance("X509").generateCertificate(new ByteArrayInputStream(pem)); + if (cert == null) + throw new RuntimeException("It should be possible to decode a certificate"); + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/TestJMX.java b/tests/spread/integration/openjdk-11-jre-headless/TestJMX.java new file mode 100644 index 00000000..e27d058d --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/TestJMX.java @@ -0,0 +1,39 @@ +import java.lang.management.ManagementFactory; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.*; +import com.sun.tools.attach.*; + +public class TestJMX implements TestJMXMBean { + + static final String CONNECTOR_ADDRESS = + "com.sun.management.jmxremote.localConnectorAddress"; + + @Override + public void test() { + } + + public static void main(String[] args) throws Throwable { + ObjectName objectName = new ObjectName("test:type=basic,name=mbeantest"); + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + server.registerMBean(new TestJMX(), objectName); + JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:5000/jmxrmi"); + int count = JMXConnectorFactory.connect(url) + .getMBeanServerConnection() + .getMBeanCount(); + System.out.println(count); + } +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java b/tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java new file mode 100644 index 00000000..c75f6c57 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/TestJMXMBean.java @@ -0,0 +1,3 @@ +public interface TestJMXMBean { + void test(); +} diff --git a/tests/spread/integration/openjdk-11-jre-headless/certificate.pem b/tests/spread/integration/openjdk-11-jre-headless/certificate.pem new file mode 100644 index 00000000..645e9f80 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/certificate.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIULvuqN3MiptnZSYS9y1qJAZYKFA4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA4MTUwMjQzNDhaFw0yNTA4 +MTUwMjQzNDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDm3990peBuPYaz0UEEc75Q7i79P4RzrD84MxhDpoPs +MSdnmO3rTkIG84Wp72+8T7TGjGjBhX++8UmZLrXy2AfcejZi3JcddMWH4V5XEnAj +hTBe1HLkiotayZst/cxuTP6KmuahjsROAqriCv/A4BBA8KjYx1e4E9k9+81FreZy +PJ8p3m7R8qZ/DtjuW1aMQ3oDRKA/iqQhLHVpJy/iYiyjwTdJm6/lA3ywGCr6ZMWm +9tWUT+4TvhyRM67Y0gcCtH51cwxPqUFGEKAkLWIu2fS6DaoXtHylxgGeKKPes3JX +uSn9QezEEqvrgLFQRqIUS8tNZFEhoJQ7dmxMP/XKAD51AgMBAAGjUzBRMB0GA1Ud +DgQWBBSb70j+xaI3eTxp4H7MDm1MLVRGNTAfBgNVHSMEGDAWgBSb70j+xaI3eTxp +4H7MDm1MLVRGNTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAp +0GIjKtwvD7BkQy+cf3dsdwYodxoIYl4E8UvHfBSPQQfFNh+chHPmrNYRuFM3Q6sT +ogNhHKLecQMK4tNUDa/vVRGnqmZVWjxqLnyH/qFKtakqPB6h6x4h50huzA+twhNm +SDjg3QqqpOuUzrs77JqYkxSjqd0QgmwmgxOdbcF0SY+ebQhAd0UXY7wIs6ByDEHO +kElgJmnGKhOpf1SFpQh2qpKGq/MvcdHWN4oKri440wCf+czkrOTyGVc275oTbRnM +Z76Ro4JDuomyWeR9iQ5pP5ug4ciflLa7hlYcH0xJbF3b2M3BlnUYKMqih/TjqKdr +NBs121h64SPY0gh7kIvF +-----END CERTIFICATE----- diff --git a/tests/spread/integration/openjdk-11-jre-headless/task.yaml b/tests/spread/integration/openjdk-11-jre-headless/task.yaml new file mode 100644 index 00000000..114d3387 --- /dev/null +++ b/tests/spread/integration/openjdk-11-jre-headless/task.yaml @@ -0,0 +1,63 @@ +summary: Integration tests for openjdk-11-jre-headless + +environment: + SLICE/classdatasharing: "class-data-sharing" + SLICE/core: "core" + SLICE/prefs: "prefs" +# SLICE/rmi: "rmi" # Tested in management slice + SLICE/debug: "debug" + SLICE/management: "management" + SLICE/jfr: "jfr" + SLICE/security: "security" + SLICE/tools: "tools" + +execute: | + # Test different slice installations + echo "SLICE=${SLICE}" + rootfs="$(install-slices openjdk-11-jre-headless_${SLICE} dash_bins)" + apt install --update -y openjdk-11-jdk-headless + javac *.java + jar cvf test.jar *.java + cp *.jar ${rootfs}/ + cp *.java ${rootfs}/ + cp *.class ${rootfs}/ + cp certificate.pem ${rootfs}/ + cd ${rootfs} + mkdir -p proc/self + for java in `find usr/lib/jvm -name java`; do + ln -sf /${java} proc/self/exe + chroot . ${java} --version + case ${SLICE} in + class-data-sharing) + chroot . ${java} -Xshare:dump + ;; + core) + chroot . ${java} -cp . Main + ;; + prefs) + chroot . ${java} -cp . PrefsTest put + chroot . ${java} -cp . PrefsTest get + ;; + debug) + chroot . ${java} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -cp . Main + ;; + management) + chroot . ${java} -Dcom.sun.management.jmxremote.port=5000 \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -Dcom.sun.management.jmxremote=true \ + -Dcom.sun.management.jmxremote.ssl=false -cp . TestJMX + ;; + jfr) + chroot . ${java} -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=dump.jfr -cp . Main + ;; + security) + chroot . ${java} -cp . ReadCertificate + ;; + tools) + DNAME="CN=Sample Cert, OU=R&D, O=Company Ltd., L=Dublin 4, S=Dublin, C=IE" + chroot . $(dirname ${java})/keytool -genkeypair -keystore foo -storepass barbar -keyalg RSA -dname "$DNAME" + chroot . $(dirname ${java})/pack200 foo.pack.gz test.jar + chroot . $(dirname ${java})/unpack200 foo.pack.gz test1.jar + ;; + esac + done From 3bf3f9ef7429c56e3716066e7023a45858e67af0 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Mon, 21 Oct 2024 12:30:35 +0200 Subject: [PATCH 09/11] feat: extract _server_vm and _client_vm slices (#360) --- slices/openjdk-8-jre-headless.yaml | 42 +++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/slices/openjdk-8-jre-headless.yaml b/slices/openjdk-8-jre-headless.yaml index 501a767b..2d247c95 100644 --- a/slices/openjdk-8-jre-headless.yaml +++ b/slices/openjdk-8-jre-headless.yaml @@ -10,6 +10,8 @@ slices: - libc6_libs - libgcc-s1_libs - libstdc++6_libs + - openjdk-8-jre-headless_client-vm + - openjdk-8-jre-headless_server-vm - zlib1g_libs contents: /etc/java-8-openjdk/calendars.properties: @@ -20,8 +22,6 @@ slices: # various classes and how they can interact with the system. /etc/java-8-openjdk/security/java.policy: /usr/lib/jvm/java-8-openjdk-*/jre/bin/java: - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjsig.so: {arch: armhf} - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjvm.so: {arch: armhf} /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/jli/libjli.so: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/jvm.cfg-default: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libjava.so: @@ -30,17 +30,6 @@ slices: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libnio.so: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libverify.so: /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/libzip.so: - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjsig.so: - arch: - - amd64 - - arm64 - - ppc64el - /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjvm.so: - arch: - - amd64 - - arm64 - - ppc64el - - s390x /usr/lib/jvm/java-8-openjdk-*/jre/lib/calendars.properties: /usr/lib/jvm/java-8-openjdk-*/jre/lib/content-types.properties: /usr/lib/jvm/java-8-openjdk-*/jre/lib/currency.data: @@ -53,6 +42,33 @@ slices: /usr/lib/jvm/java-8-openjdk-*/jre/lib/security/java.policy: /usr/lib/jvm/java-8-openjdk-*/jre/lib/tzdb.dat: + client-vm: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjsig.so: {arch: armhf} + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/client/libjvm.so: {arch: armhf} + + server-vm: + essential: + - libc6_libs + - libgcc-s1_libs + - libstdc++6_libs + contents: + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjsig.so: + arch: + - amd64 + - arm64 + - ppc64el + /usr/lib/jvm/java-8-openjdk-*/jre/lib/*/server/libjvm.so: + arch: + - amd64 + - arm64 + - ppc64el + - s390x + locale: essential: - openjdk-8-jre-headless_core From 7824fd72f13d8503314026b1cc548bd1778311a5 Mon Sep 17 00:00:00 2001 From: Rafid Bin Mostofa Date: Thu, 31 Oct 2024 15:30:57 +0600 Subject: [PATCH 10/11] fix(24.04): add default archive in chisel.yaml (#375) --- chisel.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/chisel.yaml b/chisel.yaml index d414b9c4..d5aa5547 100644 --- a/chisel.yaml +++ b/chisel.yaml @@ -2,6 +2,7 @@ format: v1 archives: ubuntu: + default: true version: 24.04 components: [main, universe] suites: [noble, noble-security, noble-updates] From c2a9c425d418d2d41ed1ed3dbbaf5c8d4a3031f9 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Wed, 6 Nov 2024 14:06:34 +0100 Subject: [PATCH 11/11] fix(spread-24.04): make spread work on armhf (#370) This fixes an error where spread tests on docker for armhf was failing the preparation step due to getting both the arm and arm64 downloads. --- spread.yaml | 2 +- tests/spread/integration/dash/task.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/spread/integration/dash/task.yaml diff --git a/spread.yaml b/spread.yaml index 83e8dbc7..f40a24fd 100644 --- a/spread.yaml +++ b/spread.yaml @@ -87,7 +87,7 @@ prepare: | apt install -y curl wget curl -s https://api.github.com/repos/canonical/chisel/releases/latest \ - | awk "/browser_download_url/ && /chisel_v/ && /$arch/" \ + | awk "/browser_download_url/ && /chisel_v/ && /_$arch\./" \ | cut -d : -f 2,3 \ | tr -d \" \ | xargs wget diff --git a/tests/spread/integration/dash/task.yaml b/tests/spread/integration/dash/task.yaml new file mode 100644 index 00000000..3d3f7e4b --- /dev/null +++ b/tests/spread/integration/dash/task.yaml @@ -0,0 +1,8 @@ +summary: Integration tests for dash + +execute: | + rootfs="$(install-slices dash_bins)" + + chroot "${rootfs}" dash -c "echo Success > /test" + + test $(cat "${rootfs}/test") == "Success"