selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change
authorMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Tue, 11 Apr 2023 17:15:20 +0000 (20:15 +0300)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 11 May 2023 12:41:45 +0000 (14:41 +0200)
commit976d3c6778e99390c6d854d140b746d12ea18a51
treef0a5357e20f10631f35b3178b2a0a6ff21bbb200
parenteb4b8eca1bad98f4b8574558a74f041f9acb5a54
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>
tools/testing/selftests/gpio/gpio-sim.sh