From fa5db009c98fd0363b69d225704b9346930fd926 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 14 Feb 2019 16:25:44 +0100 Subject: [PATCH] virkmodtest: Don't fail if modprobe doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some very basic installations (e.g. some container images) the modprobe binary might be missing. If that is the case, don't fail virkmodtest. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrangé --- tests/virkmodtest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c index c90830a23c..80029244ff 100644 --- a/tests/virkmodtest.c +++ b/tests/virkmodtest.c @@ -46,7 +46,12 @@ testKModConfig(const void *args ATTRIBUTE_UNUSED) */ outbuf = virKModConfig(); if (!outbuf) { - fprintf(stderr, "Failed to get config\n"); + if (virFileIsExecutable(MODPROBE)) { + fprintf(stderr, "Failed to get config\n"); + } else { + /* modprobe doesn't exist, do not claim error. */ + ret = 0; + } goto cleanup; } ret = 0; -- GitLab