Skip to content

Commit 98176bf

Browse files
jtpittman195kawasaki
authored andcommitted
common/rc: support multiple arguments for _require_test_dev_sysfs()
In some cases we may need to check multiple sysfs values for tests. If this happens, create the ability to pass in multiple arguments to _require_test_dev_sysfs() instead of having to call the function multiple times. Signed-off-by: John Pittman <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 926b890 commit 98176bf

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

common/rc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,14 @@ _test_dev_is_rotational() {
326326
}
327327

328328
_require_test_dev_sysfs() {
329-
if [[ ! -e "${TEST_DEV_SYSFS}/$1" ]]; then
330-
SKIP_REASONS+=("${TEST_DEV} does not have sysfs attribute $1")
331-
return 1
332-
fi
333-
return 0
329+
local attr ret=0
330+
for attr in "$@"; do
331+
if [[ ! -e "${TEST_DEV_SYSFS}/$attr" ]]; then
332+
SKIP_REASONS+=("${TEST_DEV} does not have sysfs attribute $attr")
333+
ret=1
334+
fi
335+
done
336+
return $ret
334337
}
335338

336339
_require_test_dev_is_rotational() {

0 commit comments

Comments
 (0)