test: fix fd_is_mount_point() check
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Dec 2020 15:19:09 +0000 (16:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 17 Dec 2020 18:29:24 +0000 (19:29 +0100)
commit95231c7215c3ff14c491eb1d2a93312a8fe0c4f6
tree3313cf2b437bc9f3e9c3fc509c372ffe59bc73ae
parent8b08be4052fa51a9ad0de8a6f9213efe4dac213d
test: fix fd_is_mount_point() check

So the currentl and only fd_is_mount_point() check is actually entirely
bogus: it passes "/" as filename argument, but that's not actually a
a valid filename, but an absolute path.

fd_is_mount_point() is written in a way tha the fd refers to a directory
and the specified path is a file directly below it that shall be
checked. The test call actually violated that rule, but still expected
success.

Let's fix this, and check for this explicitly, and refuse it.

Let's extend the test and move it to test-mountpoint-util.c where the
rest of the tests for related calls are placed.

Replaces: #18004
Fixes: #17950
src/basic/mountpoint-util.c
src/test/test-mountpoint-util.c
src/test/test-path-util.c