Skip to content

[DeviceManager] Fix storageAccessFromPath and add tests

Stefan Brüns requested to merge bruns/solid:test_storageaccessfrompath into master

Unfortunately, no tests were added when the method was added, and as bugs keep surfacing, add the long overdue tests.

Fix the incorrect match with unmounted filesystems, when "/" is added to an empty string as returned for an unmounted filesystem not part of the fstab it becomes the same as the filesystem root.

Remove the string mangling and detaches, make the checks just strict enough to avoid false prefix matches.

The tests cover all currently known pitfalls which were reported and/or fixed up to date. Hopefully the next time some corner case is found, or one of the backends changes, the fault can be isolated faster, and new tests are added accordingly.

Merge request reports