Skip to content

Commit 976d3c6

Browse files
Mirsad TodorovacBartosz Golaszewski
authored andcommitted
selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change
According to Mirsad the gpio-sim.sh test appears to FAIL in a wrong way due to missing initialisation of shell variables: 4.2. Bias settings work correctly cat: /sys/devices/platform/gpio-sim.0/gpiochip18/sim_gpio0/value: No such file or directory ./gpio-sim.sh: line 393: test: =: unary operator expected bias setting does not work GPIO gpio-sim test FAIL After this change the test passed: 4.2. Bias settings work correctly GPIO gpio-sim test PASS His testing environment is AlmaLinux 8.7 on Lenovo desktop box with the latest Linux kernel based on v6.2: Linux 6.2.0-mglru-kmlk-andy-09238-gd2980d8d8265 x86_64 Suggested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr> Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent eb4b8ec commit 976d3c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/testing/selftests/gpio/gpio-sim.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ create_chip chip
389389
create_bank chip bank
390390
set_num_lines chip bank 8
391391
enable_chip chip
392+
DEVNAME=`configfs_dev_name chip`
393+
CHIPNAME=`configfs_chip_name chip bank`
394+
SYSFS_PATH="/sys/devices/platform/$DEVNAME/$CHIPNAME/sim_gpio0/value"
392395
$BASE_DIR/gpio-mockup-cdev -b pull-up /dev/`configfs_chip_name chip bank` 0
393396
test `cat $SYSFS_PATH` = "1" || fail "bias setting does not work"
394397
remove_chip chip

0 commit comments

Comments
 (0)