From e280f56dd3fa1419c37c486ae651b000f26cfeca Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 22 Sep 2020 23:37:50 +0200 Subject: [PATCH] tests: move function to aux for reuse --- test/lib/aux.sh | 8 ++++++++ test/shell/lvextend-thin-metadata-dmeventd.sh | 5 +---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/lib/aux.sh b/test/lib/aux.sh index a17bf846c..77942009b 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -1467,6 +1467,14 @@ thin_pool_error_works_32() { esac } +thin_restore_needs_more_volumes() { + case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in + # With older version of thin-tool we got slightly more compact metadata + 0.[0-6]*|0.7.0*) return 0 ;; + esac + return 1 +} + udev_wait() { pgrep udev >/dev/null || return 0 which udevadm &>/dev/null || return 0 diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh index 5f6db994a..3193cc29c 100644 --- a/test/shell/lvextend-thin-metadata-dmeventd.sh +++ b/test/shell/lvextend-thin-metadata-dmeventd.sh @@ -61,10 +61,7 @@ test -n "$LVM_TEST_THIN_RESTORE_CMD" || LVM_TEST_THIN_RESTORE_CMD=$(which thin_r aux have_thin 1 10 0 || skip BIG_DATA="" -case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in - # With older version of thin-tool we got slightly more compact metadata - 0.[0-6]*|0.7.0*) BIG_DATA="generate_more_metadata" ;; -esac +aux thin_restore_needs_more_volumes && BIG_DATA="generate_more_metadata" aux prepare_dmeventd