chiark / gitweb /
fsck: Search for fsck.type in PATH
[elogind.git] / src / test / test-path-util.c
index bec2a836112693836f3851165d30171850f8901d..a2cf0af75fef675774444ced03a7f49c81acb0b2 100644 (file)
@@ -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;
 }