diff options
author | Mike Gilbert <floppym@gentoo.org> | 2014-04-12 16:07:45 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-04-12 17:23:13 -0400 |
commit | eb66db55fc4b342e4253065886e0cc0419c45a07 (patch) | |
tree | ba9a5862de90e86b3ebeb662a7746cc740618eeb /src/test | |
parent | b189101727e80a09864c5e5880663ef565467f19 (diff) |
fsck: Search for fsck.type in PATH
Modifies find_binary() to accept NULL in the second argument.
fsck.type lookup logic moved to new fsck_exists() function, with a test.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-path-util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index bec2a83611..a2cf0af75f 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -158,9 +158,20 @@ static void test_prefixes(void) { } } +static void test_fsck_exists(void) { + /* Ensure we use a sane default for PATH. */ + unsetenv("PATH"); + + /* fsck.minix is provided by util-linux and will probably exist. */ + assert_se(fsck_exists("minix") == 0); + + assert_se(fsck_exists("AbCdE") == -ENOENT); +} + int main(void) { test_path(); test_find_binary(); test_prefixes(); + test_fsck_exists(); return 0; } |