Blame SOURCES/0382-test-NBD-add-checks-for-needed-binaries.patch

712866
From 15ec719501af349a3b02495d6151e3b92854572b Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Tue, 1 Mar 2016 12:32:23 +0100
712866
Subject: [PATCH] test/NBD: add checks for needed binaries
712866
712866
---
712866
 test/TEST-40-NBD/test.sh | 10 ++++++----
712866
 1 file changed, 6 insertions(+), 4 deletions(-)
712866
712866
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
5c6c2a
index 1a6524de..848a103f 100755
712866
--- a/test/TEST-40-NBD/test.sh
712866
+++ b/test/TEST-40-NBD/test.sh
712866
@@ -95,7 +95,6 @@ client_test() {
712866
 }
712866
 
712866
 test_run() {
712866
-    modinfo nbd &>/dev/null || { echo "Kernel does not support nbd"; exit 1; }
712866
     if ! run_server; then
712866
         echo "Failed to start server" 1>&2
712866
         return 1
712866
@@ -325,9 +324,6 @@ make_server_root() {
712866
 }
712866
 
712866
 test_setup() {
712866
-
712866
-    modinfo nbd &>/dev/null || { echo "Kernel does not support nbd"; exit 1; }
712866
-
712866
     make_encrypted_root || return 1
712866
     make_client_root || return 1
712866
     make_server_root || return 1
712866
@@ -370,6 +366,12 @@ kill_server() {
712866
     fi
712866
 }
712866
 
712866
+test_check() {
712866
+    modinfo nbd &>/dev/null || { echo "Kernel does not support nbd"; return 1; }
712866
+    command -v nbd-client &>/dev/null || { echo "No nbd-client available"; return 1; }
712866
+    command -v nbd-server &>/dev/null || { echo "No nbd-server available"; return 1; }
712866
+}
712866
+
712866
 test_cleanup() {
712866
     kill_server
712866
 }