WLAN-Pi / wlanpi-hwtest

hwtest drives a suite of tests to determine diagnostic health for WLAN Pi Pro hardware.
Other
1 stars 0 forks source link

Improve test robustness involving `/boot/config.txt` #32

Closed joshschmelzle closed 2 years ago

joshschmelzle commented 2 years ago

Any tests that read from /boot/config.txt should be robust enough to verify if a particular line of interest is also a comment.

For example in fan_test.py::test_gpio_fan_conf we currently assert "gpio-fan" is in config.txt, but do not check if the line is commented out.

So, this should fail, but instead passes:

cat /boot/config.txt | grep fan
#dtoverlay=gpio-fan,gpiopin=26,temp=60000
joshschmelzle commented 2 years ago

Fixed in 6f8844c. Example logic used:

>>> foo = "#dtoverlay=gpio-fan,gpiopin=26,temp=60000"
>>> sliced = foo.split('#')[0]
>>> sliced
''
joshschmelzle commented 2 years ago

Actually fixed in c4da614.