You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the option "system.WithDigitalPinGpiodAccess()" is set on constructor and there is no "system.WithDigitalPinSysfsAccess()", it is not possible to test (and unit-test) the sysfs behaviour on a board which supports gpiod. Especially all unit tests run OK on server or on machines where the feature is not activated because there is a fallback programmed to use sysfs in this case.
If unit tests of e.g. tinkerboard or nanopi platform are started on a machine with activated gpiod, the test tries to use gpiod, which can be critical for the machine, if the gpiod access rights are configured properly and the used pin is not busy. In any case this tests will fail in raspi_adaptor_test.go, tinkerboard/adaptor_test.go , nanopi/nanopi_adaptor_test.go:
TestDigitalIO
TestFinalizeErrorAfterGPIO
The fix should include:
introduce "system.WithDigitalPinSysfsAccess()" to override the constructors default
use gpiod as default in constructor for all those adaptors without the "system.WithDigitalPinGpiodAccess" call
change all examples and unit-tests to use "system.WithDigitalPinSysfsAccess()"
try to introduce unit-tests for gpiod (-mock, on starting with gpiod there was no simple solution for that)
The text was updated successfully, but these errors were encountered:
Because the option "system.WithDigitalPinGpiodAccess()" is set on constructor and there is no "system.WithDigitalPinSysfsAccess()", it is not possible to test (and unit-test) the sysfs behaviour on a board which supports gpiod. Especially all unit tests run OK on server or on machines where the feature is not activated because there is a fallback programmed to use sysfs in this case.
If unit tests of e.g. tinkerboard or nanopi platform are started on a machine with activated gpiod, the test tries to use gpiod, which can be critical for the machine, if the gpiod access rights are configured properly and the used pin is not busy. In any case this tests will fail in raspi_adaptor_test.go, tinkerboard/adaptor_test.go , nanopi/nanopi_adaptor_test.go:
The fix should include:
The text was updated successfully, but these errors were encountered: