summaryrefslogtreecommitdiff
path: root/test/lib/check.sh
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-05-12 23:01:52 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2018-05-12 23:01:52 +0200
commitca87674ea4f6fd12b9049ea2a6498a5cf191893e (patch)
tree6e9fa81fe0545b9c23fb9a5d4bbe0d1f92f9540a /test/lib/check.sh
parentedede1d20f413a5baee5474e40cffd135c133bef (diff)
downloadlvm2-ca87674ea4f6fd12b9049ea2a6498a5cf191893e.tar.gz
tests: fix check sysfs
Commit 810f856c2490eb1d5db858f26a26621c4a3477e0 missed to move assign of P after setting maj & min.
Diffstat (limited to 'test/lib/check.sh')
-rw-r--r--test/lib/check.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lib/check.sh b/test/lib/check.sh
index c79610494..8637619f4 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -422,10 +422,11 @@ sysfs() {
# read maj min and also convert hex to decimal
local maj
local min
- local P="/sys/dev/block/$maj:$min/$2"
+ local P
local val
maj=$(($(stat -L --printf=0x%t "$1")))
min=$(($(stat -L --printf=0x%T "$1")))
+ P="/sys/dev/block/$maj:$min/$2"
val=$(< "$P") || return 0 # no sysfs ?
test "$val" -eq "$3" || \
die "$1: $P = $val differs from expected value $3!"