Debian Codegraph @

tests/00modules-test

raw symbols SCIP
1 #!/bin/bash
2
3 [ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
4
5 pversion() {
6 if [ ! -x $CRYPTSETUP_PATH/$1 ] ; then
7 return
8 fi
9
10 echo -n "$CRYPTSETUP_PATH/"
11 $CRYPTSETUP_PATH/$1 --version
12 }
13
14 echo "Cryptsetup test environment ($(date))"
15 uname -a
16 if [ "$(cat /proc/sys/crypto/fips_enabled 2>/dev/null)" = "1" ] ; then
17 echo "Kernel running in FIPS mode."
18 fi
19
20 if [ -f /etc/os-release ] ; then
21 source /etc/os-release
22 echo "$PRETTY_NAME ($NAME) $VERSION"
23 fi
24
25 echo "Memory"
26 free -m
27
28 pversion cryptsetup
29 pversion veritysetup
30 pversion integritysetup
31
32 [ -x $CRYPTSETUP_PATH/cryptsetup ] && {
33 echo -e "Cryptsetup defaults:"
34 $CRYPTSETUP_PATH/cryptsetup --help | sed -n '/optional key file for/,$p' | tail -n +3
35 }
36
37 if [ -b "$OPAL2_DEV" ]; then
38 echo "OPAL test device:"
39 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
40 fi
41
42 [ $(id -u) != 0 ] && exit 77
43
44 modprobe dm-crypt >/dev/null 2>&1
45 modprobe dm-verity >/dev/null 2>&1
46 modprobe dm-integrity >/dev/null 2>&1
47 modprobe dm-zero >/dev/null 2>&1
48
49 dmsetup version
50
51 echo "Device mapper targets:"
52 dmsetup targets
53
54 exit 0