#!/bin/bash
## kola:
##   # We now have composefs turned on in CoreOS.
##   exclusive: false
##   description: Verify that composefs is on.

set -euo pipefail

# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"

features=$(ostree --version)
if ! [[ "${features}" =~ "composefs" ]]; then
    fatal "Error: ostree has no composefs support: ${features}"
fi

rootfs=$(findmnt -n -o FSTYPE /)
if [ "${rootfs}" != "overlay" ]; then
    fatal "Error: Expected overlay on /, found: ${rootfs}"
fi

journalctl -u ostree-prepare-root.service | grep -q "composefs: mounted successfully"

ok "composefs is on"
