bcachefs-tools/checks/outputs.sh
Thomas Mühlbacher 3e50eea605 test(nix): add basic functionality testing infra
Use nixos-test scaffolding to spawn VMs and run any scripts in
`checks/*.sh` as tests inside of the VM. This should lessen the risk of
any obvious breakage in the CI but needs more and better tests to cover
more commands.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-30 13:01:18 +02:00

21 lines
339 B
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
blkdev="/dev/vdb"
mnt="/tmp/mnt"
uuid=$(uuidgen)
bcachefs format \
--verbose \
--uuid "$uuid" \
--fs_label test-fs \
"$blkdev"
udevadm settle
mkdir -p "$mnt"
mount "$blkdev" "$mnt"
bcachefs show-super "$blkdev" | grep -i "external.*$uuid"
bcachefs fs usage "$mnt" | grep "$uuid"