]> www.infradead.org Git - users/sagi/blktests.git/commit
check: Add TEST_DEV_PART_SYSFS variable
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 5 Mar 2019 05:24:45 +0000 (14:24 +0900)
committerOmar Sandoval <osandov@fb.com>
Thu, 7 Mar 2019 19:23:44 +0000 (11:23 -0800)
commited76f166658702a7724c228325e02fc434570a1e
treeae5515fa139edd0c9527d5d503b03095e612071c
parent1ecc19ef2db32926ca4efde8adf19434143e11ba
check: Add TEST_DEV_PART_SYSFS variable

When partition devices are specified in TEST_DEV, TEST_DEV_SYSFS
variable points to the sysfs paths of holder devices of the partition
devices (e.g., /sys/block/sda). This sysfs path is different from the
sysfs path of the partition devices (e.g., /sys/block/sda/sda1). For
example, size parameters exist in both the holder device sysfs and
the partition device sysfs with different values.

To allow test cases to access sysfs path of the partition devices,
add TEST_DEV_PART_SYSFS variable. TEST_DEV_SYSFS is set as is to refer
the sysfs path of the holder devices. If the TEST_DEV is not a partition
device, an empty string is set to the TEST_DEV_PART_SYSFS variable.

Rename _find_sysfs_dir() function to _find_sysfs_dirs() and make it find
holder device sysfs as well as the partition device sysfs. The function
obtains the canonical sysfs path, and if the device is a partition
device, the function cuts the last device name in the canonical sysfs
path to obtain the holder device sysfs path.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
check
new