forked from rhinstaller/kickstart-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autopart-luks-3.ks.in
44 lines (32 loc) · 926 Bytes
/
autopart-luks-3.ks.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#test name: autopart-luks-3
%ksappend repos/default.ks
network --bootproto=dhcp
bootloader --timeout=1
zerombr
clearpart --all --initlabel
# Test LUKS 2 with pbkdf2 and limited iterations.
autopart --type=lvm --encrypted --passphrase="passphrase" --luks-version=luks2 --pbkdf=pbkdf2 --pbkdf-time=10
keyboard us
lang en
timezone America/New_York
rootpw qweqwe
shutdown
%packages
%end
%post
# Find the LUKS device.
crypted="$(blkid --match-token TYPE="crypto_LUKS" --output device)"
if [[ $? != 0 ]] ; then
echo "*** couldn't find a LUKS device" > /root/RESULT
exit 1
fi
# Check the PBKDF of the LUKS device.
result="$(cryptsetup luksDump ${crypted} | awk '{ if ($1 == "PBKDF:") print $2; }' )"
if [[ "$result" != "pbkdf2" ]] ; then
echo "*** unexpected PBKDF for ${crypted}: ${result}" >> /root/RESULT
fi
# The test was successful.
if [ ! -e /root/RESULT ]; then
echo SUCCESS > /root/RESULT
fi
%end