From 6ba20f9b3be324c3e13d532bb94136801cff1aff Mon Sep 17 00:00:00 2001 From: Linostar Date: Thu, 21 Nov 2024 10:49:38 +0200 Subject: [PATCH] feat(24.04): add erlang slices (#384) --- slices/erlang-asn1.yaml | 22 ++++++++++ slices/erlang-base.yaml | 45 +++++++++++++++++++ slices/erlang-crypto.yaml | 23 ++++++++++ slices/erlang-eldap.yaml | 19 ++++++++ slices/erlang-ftp.yaml | 19 ++++++++ slices/erlang-inets.yaml | 27 ++++++++++++ slices/erlang-mnesia.yaml | 16 +++++++ slices/erlang-os-mon.yaml | 25 +++++++++++ slices/erlang-parsetools.yaml | 16 +++++++ slices/erlang-public-key.yaml | 20 +++++++++ slices/erlang-runtime-tools.yaml | 23 ++++++++++ slices/erlang-snmp.yaml | 39 +++++++++++++++++ slices/erlang-ssl.yaml | 21 +++++++++ slices/erlang-syntax-tools.yaml | 17 ++++++++ slices/erlang-tftp.yaml | 16 +++++++ slices/erlang-tools.yaml | 23 ++++++++++ slices/erlang-xmerl.yaml | 16 +++++++ tests/spread/integration/erlang/task.yaml | 53 +++++++++++++++++++++++ 18 files changed, 440 insertions(+) create mode 100644 slices/erlang-asn1.yaml create mode 100644 slices/erlang-base.yaml create mode 100644 slices/erlang-crypto.yaml create mode 100644 slices/erlang-eldap.yaml create mode 100644 slices/erlang-ftp.yaml create mode 100644 slices/erlang-inets.yaml create mode 100644 slices/erlang-mnesia.yaml create mode 100644 slices/erlang-os-mon.yaml create mode 100644 slices/erlang-parsetools.yaml create mode 100644 slices/erlang-public-key.yaml create mode 100644 slices/erlang-runtime-tools.yaml create mode 100644 slices/erlang-snmp.yaml create mode 100644 slices/erlang-ssl.yaml create mode 100644 slices/erlang-syntax-tools.yaml create mode 100644 slices/erlang-tftp.yaml create mode 100644 slices/erlang-tools.yaml create mode 100644 slices/erlang-xmerl.yaml create mode 100644 tests/spread/integration/erlang/task.yaml diff --git a/slices/erlang-asn1.yaml b/slices/erlang-asn1.yaml new file mode 100644 index 000000000..efe9910a6 --- /dev/null +++ b/slices/erlang-asn1.yaml @@ -0,0 +1,22 @@ +package: erlang-asn1 + +essential: + - erlang-asn1_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/erlang/lib/asn1-*/priv/**: + + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/asn1-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-asn1/copyright: diff --git a/slices/erlang-base.yaml b/slices/erlang-base.yaml new file mode 100644 index 000000000..8f8c140e0 --- /dev/null +++ b/slices/erlang-base.yaml @@ -0,0 +1,45 @@ +package: erlang-base + +essential: + - erlang-base_copyright + +slices: + bins: + essential: + - bash_bins + - coreutils_bins + - erlang-base_modules + - libc6_libs + - libgcc-s1_libs + - libreadline8t64_libs + - libstdc++6_libs + - libsystemd0_libs + - libtinfo6_libs + - zlib1g_libs + contents: + /usr/bin/epmd: + /usr/bin/erl: + /usr/bin/erl_call: + /usr/bin/erlc: + /usr/bin/escript: + /usr/bin/run_erl: + /usr/bin/start_embedded: + /usr/bin/to_erl: + /usr/lib/erlang/bin/**: + /usr/lib/erlang/erts-*/bin/**: + /usr/lib/erlang/lib/erl_interface-*/bin/erl_call: + + modules: + contents: + /usr/lib/erlang/lib/compiler-*/ebin/**: + /usr/lib/erlang/lib/erts-*/ebin/**: + /usr/lib/erlang/lib/kernel-*/ebin/**: + /usr/lib/erlang/lib/kernel-*/include/**: + /usr/lib/erlang/lib/sasl-*/ebin/**: + /usr/lib/erlang/lib/stdlib-*/ebin/**: + /usr/lib/erlang/lib/stdlib-*/include/**: + /usr/lib/erlang/releases/**: + + copyright: + contents: + /usr/share/doc/erlang-base/copyright: diff --git a/slices/erlang-crypto.yaml b/slices/erlang-crypto.yaml new file mode 100644 index 000000000..c6b51ff94 --- /dev/null +++ b/slices/erlang-crypto.yaml @@ -0,0 +1,23 @@ +package: erlang-crypto + +essential: + - erlang-crypto_copyright + +slices: + libs: + essential: + - libc6_libs + - libssl3t64_libs + contents: + /usr/lib/erlang/lib/crypto-*/priv/lib/**: + + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/crypto-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-crypto/copyright: diff --git a/slices/erlang-eldap.yaml b/slices/erlang-eldap.yaml new file mode 100644 index 000000000..eb60d367d --- /dev/null +++ b/slices/erlang-eldap.yaml @@ -0,0 +1,19 @@ +package: erlang-eldap + +essential: + - erlang-eldap_copyright + +slices: + modules: + essential: + - erlang-asn1_libs + - erlang-asn1_modules + - erlang-base_bins + - erlang-base_modules + - erlang-ssl_modules + contents: + /usr/lib/erlang/lib/eldap-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-eldap/copyright: diff --git a/slices/erlang-ftp.yaml b/slices/erlang-ftp.yaml new file mode 100644 index 000000000..5542bf431 --- /dev/null +++ b/slices/erlang-ftp.yaml @@ -0,0 +1,19 @@ +package: erlang-ftp + +essential: + - erlang-ftp_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-runtime-tools_libs + - erlang-runtime-tools_modules + - erlang-ssl_modules + contents: + /usr/lib/erlang/lib/ftp-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-ftp/copyright: diff --git a/slices/erlang-inets.yaml b/slices/erlang-inets.yaml new file mode 100644 index 000000000..dbaf0072a --- /dev/null +++ b/slices/erlang-inets.yaml @@ -0,0 +1,27 @@ +package: erlang-inets + +essential: + - erlang-inets_copyright + +slices: + scripts: + contents: + /usr/lib/erlang/lib/inets-*/priv/bin/runcgi.sh: + + modules: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-ftp_modules + - erlang-mnesia_modules + - erlang-runtime-tools_libs + - erlang-runtime-tools_modules + - erlang-ssl_modules + - erlang-tftp_modules + contents: + /usr/lib/erlang/lib/inets-*/ebin/**: + /usr/lib/erlang/lib/inets-*/include/**: + + copyright: + contents: + /usr/share/doc/erlang-inets/copyright: diff --git a/slices/erlang-mnesia.yaml b/slices/erlang-mnesia.yaml new file mode 100644 index 000000000..7a4d2d009 --- /dev/null +++ b/slices/erlang-mnesia.yaml @@ -0,0 +1,16 @@ +package: erlang-mnesia + +essential: + - erlang-mnesia_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/mnesia-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-mnesia/copyright: diff --git a/slices/erlang-os-mon.yaml b/slices/erlang-os-mon.yaml new file mode 100644 index 000000000..67aba2b96 --- /dev/null +++ b/slices/erlang-os-mon.yaml @@ -0,0 +1,25 @@ +package: erlang-os-mon + +essential: + - erlang-os-mon_copyright + +slices: + bins: + essential: + - erlang-os-mon_modules + contents: + /usr/lib/erlang/lib/os_mon-*/priv/**: + + modules: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-mnesia_modules + - erlang-snmp_bins + - libc6_libs + contents: + /usr/lib/erlang/lib/os_mon-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-os-mon/copyright: diff --git a/slices/erlang-parsetools.yaml b/slices/erlang-parsetools.yaml new file mode 100644 index 000000000..0e54a331d --- /dev/null +++ b/slices/erlang-parsetools.yaml @@ -0,0 +1,16 @@ +package: erlang-parsetools + +essential: + - erlang-parsetools_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/parsetools-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-parsetools/copyright: diff --git a/slices/erlang-public-key.yaml b/slices/erlang-public-key.yaml new file mode 100644 index 000000000..143e72ac0 --- /dev/null +++ b/slices/erlang-public-key.yaml @@ -0,0 +1,20 @@ +package: erlang-public-key + +essential: + - erlang-public-key_copyright + +slices: + modules: + essential: + - erlang-asn1_libs + - erlang-asn1_modules + - erlang-base_bins + - erlang-base_modules + - erlang-crypto_libs + - erlang-crypto_modules + contents: + /usr/lib/erlang/lib/public_key-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-public-key/copyright: diff --git a/slices/erlang-runtime-tools.yaml b/slices/erlang-runtime-tools.yaml new file mode 100644 index 000000000..713f2f0f1 --- /dev/null +++ b/slices/erlang-runtime-tools.yaml @@ -0,0 +1,23 @@ +package: erlang-runtime-tools + +essential: + - erlang-runtime-tools_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/erlang/lib/runtime_tools-*/priv/**: + + modules: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-mnesia_modules + contents: + /usr/lib/erlang/lib/runtime_tools-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-runtime-tools/copyright: diff --git a/slices/erlang-snmp.yaml b/slices/erlang-snmp.yaml new file mode 100644 index 000000000..c1fffcc89 --- /dev/null +++ b/slices/erlang-snmp.yaml @@ -0,0 +1,39 @@ +package: erlang-snmp + +essential: + - erlang-snmp_copyright + +slices: + bins: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-crypto_libs + - erlang-crypto_modules + - erlang-mnesia_modules + - erlang-runtime-tools_libs + - erlang-runtime-tools_modules + - erlang-snmp_config + - erlang-snmp_data + - erlang-snmp_modules + contents: + /usr/bin/snmpc: + /usr/lib/erlang/lib/snmp-*/bin/snmpc: + + config: + contents: + /usr/lib/erlang/lib/snmp-*/priv/conf/**: + + data: + contents: + /usr/lib/erlang/lib/snmp-*/mibs/**: + /usr/lib/erlang/lib/snmp-*/priv/mibs/**: + + modules: + contents: + /usr/lib/erlang/lib/snmp-*/ebin/**: + /usr/lib/erlang/lib/snmp-*/include/**: + + copyright: + contents: + /usr/share/doc/erlang-snmp/copyright: diff --git a/slices/erlang-ssl.yaml b/slices/erlang-ssl.yaml new file mode 100644 index 000000000..6cffbb6a9 --- /dev/null +++ b/slices/erlang-ssl.yaml @@ -0,0 +1,21 @@ +package: erlang-ssl + +essential: + - erlang-ssl_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-crypto_libs + - erlang-crypto_modules + - erlang-public-key_modules + - erlang-runtime-tools_libs + - erlang-runtime-tools_modules + contents: + /usr/lib/erlang/lib/ssl-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-ssl/copyright: diff --git a/slices/erlang-syntax-tools.yaml b/slices/erlang-syntax-tools.yaml new file mode 100644 index 000000000..4cead1b27 --- /dev/null +++ b/slices/erlang-syntax-tools.yaml @@ -0,0 +1,17 @@ +package: erlang-syntax-tools + +essential: + - erlang-syntax-tools_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/syntax_tools-*/ebin/**: + /usr/lib/erlang/lib/syntax_tools-*/include/**: + + copyright: + contents: + /usr/share/doc/erlang-syntax-tools/copyright: diff --git a/slices/erlang-tftp.yaml b/slices/erlang-tftp.yaml new file mode 100644 index 000000000..8b7cca934 --- /dev/null +++ b/slices/erlang-tftp.yaml @@ -0,0 +1,16 @@ +package: erlang-tftp + +essential: + - erlang-tftp_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/tftp-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-tftp/copyright: diff --git a/slices/erlang-tools.yaml b/slices/erlang-tools.yaml new file mode 100644 index 000000000..d3af0cb43 --- /dev/null +++ b/slices/erlang-tools.yaml @@ -0,0 +1,23 @@ +package: erlang-tools + +essential: + - erlang-tools_copyright + +slices: + emacs-plugins: + contents: + /usr/lib/erlang/lib/tools-*/emacs/**: + + modules: + essential: + - erlang-base_bins + - erlang-base_modules + - erlang-runtime-tools_libs + - erlang-runtime-tools_modules + contents: + /usr/lib/erlang/lib/tools-*/ebin/**: + /usr/lib/erlang/lib/tools-*/priv/**: + + copyright: + contents: + /usr/share/doc/erlang-tools/copyright: diff --git a/slices/erlang-xmerl.yaml b/slices/erlang-xmerl.yaml new file mode 100644 index 000000000..f41bc82f8 --- /dev/null +++ b/slices/erlang-xmerl.yaml @@ -0,0 +1,16 @@ +package: erlang-xmerl + +essential: + - erlang-xmerl_copyright + +slices: + modules: + essential: + - erlang-base_bins + - erlang-base_modules + contents: + /usr/lib/erlang/lib/xmerl-*/ebin/**: + + copyright: + contents: + /usr/share/doc/erlang-xmerl/copyright: diff --git a/tests/spread/integration/erlang/task.yaml b/tests/spread/integration/erlang/task.yaml new file mode 100644 index 000000000..bc4fce22e --- /dev/null +++ b/tests/spread/integration/erlang/task.yaml @@ -0,0 +1,53 @@ +summary: Integration tests for Erlang + +execute: | + # install slices + rootfs="$(install-slices \ + erlang-base_bins \ + erlang-inets_scripts \ + erlang-os-mon_bins \ + erlang-crypto_libs \ + erlang-crypto_modules \ + erlang-eldap_modules \ + erlang-mnesia_modules \ + erlang-parsetools_modules \ + erlang-public-key_modules \ + erlang-runtime-tools_libs \ + erlang-runtime-tools_modules \ + erlang-ssl_modules \ + erlang-syntax-tools_modules \ + erlang-tools_modules \ + erlang-xmerl_modules \ + base-files_base)" + + # preparing the test environment + mkdir -p "$rootfs"/bin "$rootfs"/etc "$rootfs"/dev "$rootfs"/root + cp /bin/sh "$rootfs"/bin/ + cp /etc/resolv.conf "$rootfs"/etc/ + cp /etc/nsswitch.conf "$rootfs"/etc/ + touch "$rootfs"/dev/null + chmod 777 "$rootfs"/dev/null + echo "cookie" > "$rootfs"/root/.erlang.cookie + chroot "$rootfs" chmod 400 /root/.erlang.cookie + + # test epmd daemon + chroot "$rootfs" /usr/bin/epmd -daemon + + # test erl eval + chroot "$rootfs" /usr/bin/erl -noshell -eval 'io:format("Erlang OK~n"), halt().' | grep "Erlang OK" + + # test escript by executing a simple script + echo '#!/usr/bin/escript' > test_script + echo 'main(_) -> io:format("escript OK~n").' >> test_script + chmod +x test_script + mv test_script "$rootfs" + chroot "$rootfs" /usr/bin/escript test_script + + # test start_embedded to start the embedded environment + chroot "$rootfs" /usr/bin/start_embedded + + # test runcgi.sh from erlang-inets + chroot "$rootfs" /usr/lib/erlang/lib/inets-8.3.1.2/priv/bin/runcgi.sh /bin + + # test snmpc + chroot "$rootfs" snmpc /usr/lib/erlang/lib/snmp-5.13.5/mibs/STANDARD-MIB.mib