From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - tests: vdo emulation without vdo binary
Date: Wed, 7 Sep 2022 13:04:52 +0000 (GMT) [thread overview]
Message-ID: <20220907130452.D21933858428@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=15ad2b8e5585b89bc3f09a53567f17eb70f45714
Commit: 15ad2b8e5585b89bc3f09a53567f17eb70f45714
Parent: acbeaa7a8d86acc0f0e3c04723d066d995f29fe5
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Tue Sep 6 16:44:24 2022 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Sep 7 14:58:01 2022 +0200
tests: vdo emulation without vdo binary
Avoid inserting 'vdo' binary into path - and use
alias and VDO_BINARY shell vars for emulation.
---
test/lib/lvm_vdo_wrapper.sh | 2 +-
test/shell/vdo-convert.sh | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/test/lib/lvm_vdo_wrapper.sh b/test/lib/lvm_vdo_wrapper.sh
index d622d6456..90d0b2ce8 100755
--- a/test/lib/lvm_vdo_wrapper.sh
+++ b/test/lib/lvm_vdo_wrapper.sh
@@ -344,7 +344,7 @@ vdo_dry_ vdo_remove_ -f "$vdo_confFile" -n "$vdo_name" || true
#
# MAIN
#
-case "$1" in
+case "${1-}" in
"create") shift; vdo_create_ "$@" ;;
"remove") shift; vdo_remove_ "$@" ;;
"stop") shift; vdo_stop_ "$@" ;;
diff --git a/test/shell/vdo-convert.sh b/test/shell/vdo-convert.sh
index f1d04d596..5bf53d081 100644
--- a/test/shell/vdo-convert.sh
+++ b/test/shell/vdo-convert.sh
@@ -29,7 +29,16 @@ aux prepare_dmeventd
#
# Main
#
-which vdo || skip
+if not which vdo ; then
+ which lvm_vdo_wrapper || skip "Missing 'lvm_vdo_wrapper'."
+ which oldvdoformat || skip "Emulation of vdo manager 'oldvdoformat' missing."
+ which oldvdoprepareforlvm || skip "Emulation of vdo manager 'oldvdoprepareforlvm' missing."
+ # enable expansion of aliasis within script itself
+ shopt -s expand_aliases
+ alias vdo='lvm_vdo_wrapper'
+ export VDO_BINARY=lvm_vdo_wrapper
+ echo "Using 'lvm_vdo_wrapper' emulation of 'vdo' manager."
+fi
which mkfs.ext4 || skip
export MKE2FS_CONFIG="$TESTDIR/lib/mke2fs.conf"
reply other threads:[~2022-09-07 13:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220907130452.D21933858428@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.