summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2012-05-25 18:31:58 +0200
committerHarald Hoyer <harald@redhat.com>2012-05-29 09:23:37 +0200
commit1ecf6a2b4960229ad1d06c591b4776ddf065e834 (patch)
tree2585e191fe461edc8906aa1abf0c6ade59fd17db /test
parent6ea4364c7b40d21464b5fc64d6c5506658eb9401 (diff)
test/test-functions: add check_qemu() and check_nspawn() functions
Diffstat (limited to 'test')
-rw-r--r--test/test-functions19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/test-functions b/test/test-functions
index 84ce1e947..5fdf0a18b 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -574,22 +574,21 @@ inst_libdir_file() {
fi
}
+check_qemu() {
+ command -v qemu-kvm &>/dev/null && [[ -c /dev/kvm ]]
+}
+
+check_nspawn() {
+ [[ -d /sys/fs/cgroup/systemd ]]
+}
+
+
do_test() {
if [[ $UID != "0" ]]; then
echo "TEST: $TEST_DESCRIPTION [SKIPPED]: not root" >&2
exit 0
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
[[ $libdir ]] || for libdir in /lib64 /lib; do
[[ -d $libdir ]] && libdirs+=" $libdir" && break