test-fs-util: do not assume /dev is always real
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Jul 2020 11:49:12 +0000 (13:49 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Jul 2020 08:39:41 +0000 (10:39 +0200)
commit933ab8199d51f25e7dafbaad54d73c80a4d15a1f
tree7553ab67b358589a42ff57e012f8cc24150ae4cf
parente128723dae62e3c73b29d74ca9f4548d8a5303be
test-fs-util: do not assume /dev is always real

When building in Fedora's koji, test-fs-util would fail:
--- command ---
10:18:29 SYSTEMD_LANGUAGE_FALLBACK_MAP='/builddir/build/BUILD/systemd-246-rc2/src/locale/language-fallback-map' PATH='/builddir/build/BUILD/systemd-246-rc2/x86_64-redhat-linux-gnu:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin' SYSTEMD_KBD_MODEL_MAP='/builddir/build/BUILD/systemd-246-rc2/src/locale/kbd-model-map' /builddir/build/BUILD/systemd-246-rc2/x86_64-redhat-linux-gnu/test-fs-util
--- stderr ---
/* test_chase_symlinks */
/* test_unlink_noerrno */
/* test_readlink_and_make_absolute */
/* test_var_tmp */
/* test_dot_or_dot_dot */
/* test_access_fd */
/* test_touch_file */
/* test_unlinkat_deallocate */
/* test_fsync_directory_of_file */
/* test_rename_noreplace */
/* test_path_is_encrypted */
/home encrypted: yes
/var encrypted: yes
/ encrypted: yes
/proc encrypted: no
/sys encrypted: no
/dev encrypted: yes
Assertion 'expect < 0 || ((r > 0) == (expect > 0))' failed at src/test/test-fs-util.c:863, function test_path_is_encrypted_one(). Aborting.
-------

It seems / is encrypted, but /dev is just a normal directory.
src/test/test-fs-util.c