diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2016-03-01 15:32:20 +0100 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2016-03-03 13:09:02 +0100 |
commit | 7cdc21a0bd0b3cd2159704839ffc5ebed48ba73c (patch) | |
tree | 287e1db4fe6f872a032308411557523592784008 | |
parent | f398150b85eef8a512edc679603e3efa1ef9a98c (diff) | |
download | lvm2-7cdc21a0bd0b3cd2159704839ffc5ebed48ba73c.tar.gz |
tests: add "get lvh_field" for "lvs -H"
-rw-r--r-- | test/lib/check.sh | 6 | ||||
-rw-r--r-- | test/lib/get.sh | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/lib/check.sh b/test/lib/check.sh index 4ede0be11..e729ab21d 100644 --- a/test/lib/check.sh +++ b/test/lib/check.sh @@ -310,6 +310,12 @@ lv_field() { die "lv_field: lv=$1, field=\"$2\", actual=\"$actual\", expected=\"$3\"" } +lvh_field() { + local actual=$(get lvh_field "$1" "$2" "${@:4}") + test "$actual" = "$3" || \ + die "lvh_field: lv=$1, field=\"$2\", actual=\"$actual\", expected=\"$3\"" +} + lva_field() { local actual=$(get lva_field "$1" "$2" "${@:4}") test "$actual" = "$3" || \ diff --git a/test/lib/get.sh b/test/lib/get.sh index 0d22eb48b..74ee7e83d 100644 --- a/test/lib/get.sh +++ b/test/lib/get.sh @@ -42,6 +42,11 @@ lv_field() { trim_ "$r" } +lvh_field() { + local r=$(lvs -H --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1") + trim_ "$r" +} + lva_field() { local r=$(lvs -a --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1") trim_ "$r" |