mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-26 05:35:21 +07:00
test/test-functions: add check_qemu() and check_nspawn() functions
This commit is contained in:
parent
6ea4364c7b
commit
1ecf6a2b49
@ -574,22 +574,21 @@ inst_libdir_file() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_qemu() {
|
||||||
|
command -v qemu-kvm &>/dev/null && [[ -c /dev/kvm ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
check_nspawn() {
|
||||||
|
[[ -d /sys/fs/cgroup/systemd ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
do_test() {
|
do_test() {
|
||||||
if [[ $UID != "0" ]]; then
|
if [[ $UID != "0" ]]; then
|
||||||
echo "TEST: $TEST_DESCRIPTION [SKIPPED]: not root" >&2
|
echo "TEST: $TEST_DESCRIPTION [SKIPPED]: not root" >&2
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v qemu-kvm &>/dev/null; then
|
|
||||||
echo "TEST: $TEST_DESCRIPTION [SKIPPED]: no qemu-kvm found" >&2
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! [[ -c /dev/kvm ]]; then
|
|
||||||
echo "TEST: $TEST_DESCRIPTION [SKIPPED]: /dev/kvm not found" >&2
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Detect lib paths
|
# Detect lib paths
|
||||||
[[ $libdir ]] || for libdir in /lib64 /lib; do
|
[[ $libdir ]] || for libdir in /lib64 /lib; do
|
||||||
[[ -d $libdir ]] && libdirs+=" $libdir" && break
|
[[ -d $libdir ]] && libdirs+=" $libdir" && break
|
||||||
|
Loading…
Reference in New Issue
Block a user