eclipse-bluechi / bluechi

Eclipse BlueChi is a systemd service controller intended for multi-node environments with a predefined number of nodes and with a focus on highly regulated ecosystems such as those requiring functional safety.
https://bluechi.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
130 stars 37 forks source link

Fix conf suffix check #893

Closed engelmi closed 4 months ago

engelmi commented 4 months ago

Fixes: https://github.com/eclipse-bluechi/bluechi/issues/892

The strstr command only checks if a substring exists within another string. The found string does not need to be a suffix. Therefore, a dedicated ends_with function is implemented and called for checking if the file name suffix is .conf. Unit tests for this new function have been added as well.

engelmi commented 4 months ago

@dracher @ArtiomDivak After merging this PR (and it being pushed to the copr snapshot repo), the Integration Tests on multihosts should pass for test_agent_invalid_port.

coveralls commented 4 months ago

Coverage Status

coverage: 84.602% (+0.01%) from 84.588% when pulling f3517f64ef4f2c805ea703632086254aed661f46 on engelmi:fix-conf-suffix-check into 3d19f9a4ab77f0a7e02b905eaf4f392e926189c2 on eclipse-bluechi:main.