summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-10-08 11:52:29 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-11-01 18:01:15 +0100
commit9607023e9accd1cfdd8236bafc6bc669651a3a3b (patch)
tree975f9ab2933b94b3659dbfcd1d331980c9d1291d /sys-kernel/dracut
parentnet-misc/frr: drop 9.0.4 (diff)
downloadgentoo-9607023e9accd1cfdd8236bafc6bc669651a3a3b.tar.gz
gentoo-9607023e9accd1cfdd8236bafc6bc669651a3a3b.tar.bz2
gentoo-9607023e9accd1cfdd8236bafc6bc669651a3a3b.zip
sys-kernel/dracut: get the tests up and running
Instead of skipping the tests if we are not root or cannot access kvm, communicate properly what we need with PROPERTIES and addwrite. Also add several missing dependencies and the dependency on qemu Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sys-kernel/dracut')
-rw-r--r--sys-kernel/dracut/dracut-103-r4.ebuild54
-rw-r--r--sys-kernel/dracut/dracut-9999.ebuild54
2 files changed, 94 insertions, 14 deletions
diff --git a/sys-kernel/dracut/dracut-103-r4.ebuild b/sys-kernel/dracut/dracut-103-r4.ebuild
index 2e6c11185065..ae58053e70fc 100644
--- a/sys-kernel/dracut/dracut-103-r4.ebuild
+++ b/sys-kernel/dracut/dracut-103-r4.ebuild
@@ -22,7 +22,8 @@ HOMEPAGE="https://github.com/dracut-ng/dracut-ng/wiki"
LICENSE="GPL-2"
SLOT="0"
IUSE="selinux test"
-RESTRICT="!test? ( test )"
+RESTRICT="test"
+PROPERTIES="test? ( test_privileged test_network )"
RDEPEND="
app-alternatives/cpio
@@ -58,6 +59,38 @@ BDEPEND="
>=app-text/docbook-xsl-stylesheets-1.75.2
>=dev-libs/libxslt-1.1.26
virtual/pkgconfig
+ test? (
+ net-nds/rpcbind
+ net-fs/nfs-utils
+ sys-block/open-iscsi
+ sys-fs/btrfs-progs
+ sys-fs/dmraid
+ sys-fs/lvm2[lvm,thin]
+ sys-fs/mdadm
+ sys-fs/multipath-tools
+ alpha? ( app-emulation/qemu[qemu_softmmu_targets_alpha] )
+ amd64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] )
+ arm? ( app-emulation/qemu[qemu_softmmu_targets_arm] )
+ arm64? ( app-emulation/qemu[qemu_softmmu_targets_aarch64] )
+ hppa? ( app-emulation/qemu[qemu_softmmu_targets_hppa] )
+ loong? ( app-emulation/qemu[qemu_softmmu_targets_loongarch64] )
+ mips? ( || (
+ app-emulation/qemu[qemu_softmmu_targets_mips]
+ app-emulation/qemu[qemu_softmmu_targets_mips64]
+ app-emulation/qemu[qemu_softmmu_targets_mips64el]
+ ) )
+ ppc? ( app-emulation/qemu[qemu_softmmu_targets_ppc] )
+ ppc64? ( app-emulation/qemu[qemu_softmmu_targets_ppc64] )
+ riscv? ( || (
+ app-emulation/qemu[qemu_softmmu_targets_riscv32]
+ app-emulation/qemu[qemu_softmmu_targets_riscv64]
+ ) )
+ sparc? ( || (
+ app-emulation/qemu[qemu_softmmu_targets_sparc]
+ app-emulation/qemu[qemu_softmmu_targets_sparc64]
+ ) )
+ x86? ( app-emulation/qemu[qemu_softmmu_targets_i386] )
+ )
"
QA_MULTILIB_PATHS="usr/lib/dracut/.*"
@@ -89,14 +122,21 @@ src_configure() {
}
src_test() {
- if [[ ${EUID} != 0 ]]; then
- # Tests need root privileges, bug #298014
- ewarn "Skipping tests: Not running as root."
- elif [[ ! -w /dev/kvm ]]; then
- ewarn "Skipping tests: Unable to access /dev/kvm."
+ addwrite /dev/kvm
+ # Translate ARCH so run-qemu can find the correct qemu-system-ARCH
+ local qemu_arch
+ if use amd64; then
+ qemu_arch=x86_64
+ elif use arm64; then
+ qemu_arch=aarch64
+ elif use loong; then
+ qemu_arch=loongarch64
+ elif use x86; then
+ qemu_arch=i386
else
- emake -C test check
+ qemu_arch=$(tc-arch)
fi
+ ARCH=${qemu_arch} emake -C test check
}
src_install() {
diff --git a/sys-kernel/dracut/dracut-9999.ebuild b/sys-kernel/dracut/dracut-9999.ebuild
index ae23c47eba7d..8bbef8760f9d 100644
--- a/sys-kernel/dracut/dracut-9999.ebuild
+++ b/sys-kernel/dracut/dracut-9999.ebuild
@@ -22,7 +22,8 @@ HOMEPAGE="https://github.com/dracut-ng/dracut-ng/wiki"
LICENSE="GPL-2"
SLOT="0"
IUSE="selinux test"
-RESTRICT="!test? ( test )"
+RESTRICT="test"
+PROPERTIES="test? ( test_privileged test_network )"
RDEPEND="
app-alternatives/cpio
@@ -58,6 +59,38 @@ BDEPEND="
>=app-text/docbook-xsl-stylesheets-1.75.2
>=dev-libs/libxslt-1.1.26
virtual/pkgconfig
+ test? (
+ net-nds/rpcbind
+ net-fs/nfs-utils
+ sys-block/open-iscsi
+ sys-fs/btrfs-progs
+ sys-fs/dmraid
+ sys-fs/lvm2[lvm,thin]
+ sys-fs/mdadm
+ sys-fs/multipath-tools
+ alpha? ( app-emulation/qemu[qemu_softmmu_targets_alpha] )
+ amd64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] )
+ arm? ( app-emulation/qemu[qemu_softmmu_targets_arm] )
+ arm64? ( app-emulation/qemu[qemu_softmmu_targets_aarch64] )
+ hppa? ( app-emulation/qemu[qemu_softmmu_targets_hppa] )
+ loong? ( app-emulation/qemu[qemu_softmmu_targets_loongarch64] )
+ mips? ( || (
+ app-emulation/qemu[qemu_softmmu_targets_mips]
+ app-emulation/qemu[qemu_softmmu_targets_mips64]
+ app-emulation/qemu[qemu_softmmu_targets_mips64el]
+ ) )
+ ppc? ( app-emulation/qemu[qemu_softmmu_targets_ppc] )
+ ppc64? ( app-emulation/qemu[qemu_softmmu_targets_ppc64] )
+ riscv? ( || (
+ app-emulation/qemu[qemu_softmmu_targets_riscv32]
+ app-emulation/qemu[qemu_softmmu_targets_riscv64]
+ ) )
+ sparc? ( || (
+ app-emulation/qemu[qemu_softmmu_targets_sparc]
+ app-emulation/qemu[qemu_softmmu_targets_sparc64]
+ ) )
+ x86? ( app-emulation/qemu[qemu_softmmu_targets_i386] )
+ )
"
QA_MULTILIB_PATHS="usr/lib/dracut/.*"
@@ -85,14 +118,21 @@ src_configure() {
}
src_test() {
- if [[ ${EUID} != 0 ]]; then
- # Tests need root privileges, bug #298014
- ewarn "Skipping tests: Not running as root."
- elif [[ ! -w /dev/kvm ]]; then
- ewarn "Skipping tests: Unable to access /dev/kvm."
+ addwrite /dev/kvm
+ # Translate ARCH so run-qemu can find the correct qemu-system-ARCH
+ local qemu_arch
+ if use amd64; then
+ qemu_arch=x86_64
+ elif use arm64; then
+ qemu_arch=aarch64
+ elif use loong; then
+ qemu_arch=loongarch64
+ elif use x86; then
+ qemu_arch=i386
else
- emake -C test check
+ qemu_arch=$(tc-arch)
fi
+ ARCH=${qemu_arch} emake -C test check
}
src_install() {