Skip to contentSkip to conversation

master - tests: fix check sysfs

PATCH Zdenek Kabelac 1 participant 1 message May 12, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ca87674ea4f6fd12b9049ea2a6498a5cf191893e
Commit:        ca87674ea4f6fd12b9049ea2a6498a5cf191893e
Parent:        edede1d20f413a5baee5474e40cffd135c133bef
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat May 12 23:01:52 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sat May 12 23:01:52 2018 +0200

tests: fix check sysfs

Commit 810f856c2490eb1d5db858f26a26621c4a3477e0 missed to move assign of P after setting maj & min.

---
 test/lib/check.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
test/lib/check.sh +2 -1
index c796104..8637619 100644
@@ -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!"