Files
cryptsetup/tests/00modules-test
Milan Broz ba57351fc6 Merge branch 'vm-test' into 'main'
Draft: WIP: print info from VMs

See merge request cryptsetup/cryptsetup!864
2025-11-28 23:05:13 +01:00

70 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
[ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
pversion() {
if [ ! -x $CRYPTSETUP_PATH/$1 ] ; then
return
fi
echo -n "$CRYPTSETUP_PATH/"
$CRYPTSETUP_PATH/$1 --version
}
echo "Cryptsetup test environment ($(date))"
uname -a
if [ "$(cat /proc/sys/crypto/fips_enabled 2>/dev/null)" = "1" ] ; then
echo "Kernel running in FIPS mode."
fi
./crypto-check fips_mode && echo "Crypto backend running in FIPS mode."
./crypto-check fips_mode_kernel && echo "Kernel running in FIPS mode."
if [ -f /etc/os-release ] ; then
source /etc/os-release
echo "$PRETTY_NAME ($NAME) $VERSION"
fi
echo "Memory"
free -m
pversion cryptsetup
pversion veritysetup
pversion integritysetup
[ -x $CRYPTSETUP_PATH/cryptsetup ] && {
echo -e "Cryptsetup defaults:"
$CRYPTSETUP_PATH/cryptsetup --help | sed -n '/optional key file for/,$p' | tail -n +3
}
if [ -b "$OPAL2_DEV" ]; then
echo "OPAL test device:"
lsblk "$OPAL2_DEV" -d -o NAME,TRAN,MODEL,REV,MIN-IO,PHY-SEC,LOG-SEC,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO 2>/dev/null
fi
[ $(id -u) != 0 ] && exit 77
modprobe dm-crypt >/dev/null 2>&1
modprobe dm-verity >/dev/null 2>&1
modprobe dm-integrity >/dev/null 2>&1
modprobe dm-zero >/dev/null 2>&1
dmsetup version
echo "Device mapper targets:"
dmsetup targets
echo "---------------------------"
pwd
lsblk
lsblk -S
lsblk -N
lsblk -D
lsblk -t
nvme list
mount
time $CRYPTSETUP_PATH/cryptsetup benchmark
echo "---------------------------"
exit 0