summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMilan Broz <gmazyland@gmail.com>2011-11-13 22:12:51 +0000
committerMilan Broz <gmazyland@gmail.com>2011-11-13 22:12:51 +0000
commit203f2e082d8bf77b49a5237db2d4399d6f2b7025 (patch)
tree5be1212f3a4ea4324722b5934d2077bc26bdda6f /tests
parentb4e2306da8def2c9325befb68da6ae84fdaf4eba (diff)
downloadcryptsetup-203f2e082d8bf77b49a5237db2d4399d6f2b7025.tar.gz
cryptsetup-203f2e082d8bf77b49a5237db2d4399d6f2b7025.tar.bz2
cryptsetup-203f2e082d8bf77b49a5237db2d4399d6f2b7025.zip
Fix error message for luksClose and detached LUKS header.
Allow --header for status command to get full info with detached header. git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@689 36d66b0a-2a48-0410-832c-cd162a569da5
Diffstat (limited to 'tests')
-rwxr-xr-xtests/compat-test15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/compat-test b/tests/compat-test
index 3499faf..4bf70a5 100755
--- a/tests/compat-test
+++ b/tests/compat-test
@@ -7,6 +7,7 @@ DEV_NAME2=dummy2
DEV_NAME3=dummy3
ORIG_IMG=luks-test-orig
IMG=luks-test
+HEADER_IMG=luks-header
KEY1=key1
KEY2=key2
KEY5=key5
@@ -34,7 +35,7 @@ function remove_mapping()
[ -b /dev/mapper/$DEV_NAME2 ] && dmsetup remove $DEV_NAME2
[ -b /dev/mapper/$DEV_NAME ] && dmsetup remove $DEV_NAME
losetup -d $LOOPDEV >/dev/null 2>&1
- rm -f $ORIG_IMG $IMG $KEY1 $KEY2 $KEY5 >/dev/null 2>&1
+ rm -f $ORIG_IMG $IMG $KEY1 $KEY2 $KEY5 $HEADER_IMG >/dev/null 2>&1
}
function fail()
@@ -127,7 +128,6 @@ function valgrind_run()
# LUKS tests
-
prepare "[1] open - compat image - acceptance check" new
echo "compatkey" | $CRYPTSETUP luksOpen $LOOPDEV $DEV_NAME || fail
check_exists
@@ -446,5 +446,16 @@ $CRYPTSETUP luksOpen -S 1 -d $KEY5 $LOOPDEV $DEV_NAME && fail
$CRYPTSETUP luksOpen -S 5 -d $KEY1 $LOOPDEV $DEV_NAME && fail
[ -b /dev/mapper/$DEV_NAME ] && fail
+prepare "[28] Detached LUKS header" wipe
+dd if=/dev/zero of=$HEADER_IMG bs=1M count=4 >/dev/null 2>&1
+echo "key0" | $CRYPTSETUP luksFormat -i1 $LOOPDEV --header $HEADER_IMG || fail
+echo "key0" | $CRYPTSETUP luksFormat -i1 $LOOPDEV --header $HEADER_IMG --align-payload 0 || fail
+echo "key0" | $CRYPTSETUP luksOpen $LOOPDEV --header $HEADER_IMG $DEV_NAME || fail
+$CRYPTSETUP -q resize $DEV_NAME --size 100 --header $HEADER_IMG || fail
+$CRYPTSETUP -q status $DEV_NAME --header $HEADER_IMG | grep "size:" | grep -q "100 sectors" || fail
+$CRYPTSETUP luksSuspend $DEV_NAME --header $HEADER_IMG || fail
+echo "key0" | $CRYPTSETUP luksResume $DEV_NAME --header $HEADER_IMG || fail
+$CRYPTSETUP luksClose $DEV_NAME || fail
+
remove_mapping
exit 0