. "$BST_LIB"
# base-files ships no binary — it supplies the /etc skeleton and the FHS
# directory layout — so the coverage is those files and dirs themselves.
# /etc/profile is asserted present but never read: the image postprocess
# (brintos_fixup_rootfs) deliberately truncates it to zero bytes, because the
# Yocto default runs tty helpers that hang the browser login shell.

# --- the /etc skeleton ---
check     base-files/profile  test -f /etc/profile
check_out base-files/fstab    "/dev/root"       cat /etc/fstab
check_out base-files/hosts    "127.0.0.1"       cat /etc/hosts
check_out base-files/issue    "brintOS"         cat /etc/issue
check_out base-files/shells   "/bin/sh"         cat /etc/shells
check_out base-files/hostname "brintos-wasm32"  cat /etc/hostname
check     base-files/nsswitch test -s /etc/nsswitch.conf
check     base-files/mtab     test -e /etc/mtab

# --- FHS directory layout: one result, naming whatever is missing ---
# /var/log is excluded: it is a symlink into the /var/volatile tmpfs, so it
# only resolves once ::sysinit has mounted it.
_missing=
for _d in /bin /dev /etc /home /lib /mnt /proc /run /sbin /sys /tmp /usr /var \
          /usr/bin /usr/lib /usr/share /etc/skel /etc/default /var/volatile; do
  [ -d "$_d" ] || _missing="$_missing $_d"
done
if [ -z "$_missing" ]; then bst_ok base-files/fhs-layout
else bst_notok base-files/fhs-layout "missing:$_missing"; fi
