File 0019-tests-missing-to-check-for-writecache-support.patch of Package lvm2.36155

From da95bb6883810863a394525c9a66196b7b0dda21 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Wed, 13 Sep 2023 23:23:47 +0200
Subject: [PATCH 19/24] tests: missing to check for writecache support

Ono more case requires writecache presence.
---
 test/shell/caching-snapshot.sh | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/test/shell/caching-snapshot.sh b/test/shell/caching-snapshot.sh
index 854d8bad7..b31cb520f 100644
--- a/test/shell/caching-snapshot.sh
+++ b/test/shell/caching-snapshot.sh
@@ -72,7 +72,8 @@ test_snap_create() {
 
 test_snap_create cache --cachepool
 test_snap_create cache --cachevol
-test_snap_create writecache --cachevol
+
+[ "$HAVE_WRITECACHE" = "1" ] && test_snap_create writecache --cachevol
 
 # removing cache|writecache while snapshot exists
 
@@ -109,9 +110,7 @@ test_snap_remove() {
 test_snap_remove cache --cachepool
 test_snap_remove cache --cachevol
 
-if [ "$HAVE_WRITECACHE" = "1" ]; then
-test_snap_remove writecache --cachevol
-fi
+[ "$HAVE_WRITECACHE" = "1" ] && test_snap_remove writecache --cachevol
 
 # adding cache|writecache to an LV that has a snapshot
 
@@ -150,9 +149,7 @@ test_caching_with_snap() {
 test_caching_with_snap cache --cachepool
 test_caching_with_snap cache --cachevol
 
-if [ "$HAVE_WRITECACHE" = "1" ]; then
-test_caching_with_snap writecache --cachevol
-fi
+[ "$HAVE_WRITECACHE" = "1" ] && test_caching_with_snap writecache --cachevol
 
 # adding cache|writecache to a snapshot is not allowed
 
-- 
2.35.3

openSUSE Build Service is sponsored by