diff options
Diffstat (limited to 'sys-kernel/ugrd/ugrd-9999.ebuild')
-rw-r--r-- | sys-kernel/ugrd/ugrd-9999.ebuild | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sys-kernel/ugrd/ugrd-9999.ebuild b/sys-kernel/ugrd/ugrd-9999.ebuild index 79e735294206..6f4810071f2d 100644 --- a/sys-kernel/ugrd/ugrd-9999.ebuild +++ b/sys-kernel/ugrd/ugrd-9999.ebuild @@ -21,6 +21,13 @@ RDEPEND=" sys-apps/pciutils " +BDEPEND=" + test? ( + amd64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] ) + arm64? ( app-emulation/qemu[qemu_softmmu_targets_aarch64] ) + ) +" + python_install_all() { # Call the distutils-r1_python_install_all function distutils-r1_python_install_all @@ -45,3 +52,22 @@ pkg_postinst() { optfeature "ugrd.crypto.gpg support" app-crypt/gnupg optfeature "ugrd.fs.lvm support" sys-fs/lvm2[lvm] } + +distutils_enable_tests unittest + +src_test() { + if [[ ! -w '/dev/kvm' ]]; then + ewarn "Skipping tests: Cannot write to /dev/kvm." + return 1 + fi + if [[ ! -r "$(command -v mount)" ]]; then + ewarn "Cannot read the mount binary, tests may fail until" + ewarn "util-linux is re-emerged without the sfperms feature." + fi + + distutils-r1_src_test +} + +python_test() { + eunittest tests/ +} |