64e054a0535ba64868f6b07f0091bb54bd89021d
[platform/upstream/cryptsetup.git] / tests / 00modules-test
1 #!/bin/bash
2
3 [ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
4
5 function 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 -h
27
28 pversion cryptsetup
29 pversion veritysetup
30 pversion integritysetup
31 pversion cryptsetup-reencrypt
32
33 [ $(id -u) != 0 ] && exit 77
34
35 modprobe dm-crypt     >/dev/null 2>&1
36 modprobe dm-verity    >/dev/null 2>&1
37 modprobe dm-integrity >/dev/null 2>&1
38 modprobe dm-zero      >/dev/null 2>&1
39
40 dmsetup version
41
42 echo "Device mapper targets:"
43 dmsetup targets
44
45 exit 0