From e9811559cb558b42833d8090a42c7f7bef602596 Mon Sep 17 00:00:00 2001 From: Philip Meulengracht Date: Wed, 4 Sep 2024 09:20:27 +0200 Subject: [PATCH] slices: add debianutils --- slices/debianutils.yaml | 35 +++++++++++++++++++ .../spread/integration/debianutils/task.yaml | 29 +++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 slices/debianutils.yaml create mode 100644 tests/spread/integration/debianutils/task.yaml diff --git a/slices/debianutils.yaml b/slices/debianutils.yaml new file mode 100644 index 000000000..640483c07 --- /dev/null +++ b/slices/debianutils.yaml @@ -0,0 +1,35 @@ +package: debianutils + +essential: + - debianutils_copyright + +slices: + bins: + essential: + - debianutils_config + - libc6_libs + contents: + /usr/bin/ischroot: + /usr/bin/run-parts: + /usr/bin/savelog: + /usr/bin/tempfile: + /usr/bin/which.debianutils: + /usr/sbin/add-shell: + /usr/sbin/installkernel: + /usr/sbin/remove-shell: + /usr/sbin/update-shells: + + # the following emulates the post-install script + which: + essential: + - debianutils_bins + contents: + /usr/bin/which: {symlink: /usr/bin/which.debianutils} + + config: + contents: + /usr/share/debianutils/shells: + + copyright: + contents: + /usr/share/doc/debianutils/copyright: diff --git a/tests/spread/integration/debianutils/task.yaml b/tests/spread/integration/debianutils/task.yaml new file mode 100644 index 000000000..f5af85c60 --- /dev/null +++ b/tests/spread/integration/debianutils/task.yaml @@ -0,0 +1,29 @@ +summary: Integration tests for debianutils + +execute: | + rootfs="$(install-slices bash_bins base-files_base coreutils_bins debianutils_bins debianutils_which)" + + # ischroot needs proc mounted + mkdir -p "${rootfs}"/proc + mount --bind /proc "${rootfs}"/proc + + # some executables are scripts that need /bin/sh + chroot "$rootfs" ln -s /usr/bin/bash /bin/sh + + # smoke test some of the binaries + chroot "${rootfs}" /usr/bin/ischroot + chroot "${rootfs}" /usr/bin/which savelog | grep "/usr/bin/savelog" + chroot "${rootfs}" /usr/bin/run-parts --list --regex 'shell$' /usr/sbin | tr '\n' ' ' | grep "/usr/sbin/add-shell /usr/sbin/remove-shell" + + # run the update-shells to generate the shells file, this + # will output an error due to missing dpkg-realpath + chroot "${rootfs}" /usr/sbin/update-shells || true + + # still expect the file to be generated + if ! [ -e "${rootfs}/etc/shells" ]; then + echo "expected shells file to be generated" + exit 1 + fi + + # cleanup + umount "${rootfs}"/proc