Fix deactivation of device when failed underlying node disappeared
[platform/upstream/cryptsetup.git] / tests / mode-test
index ba6ac0a..3801718 100755 (executable)
@@ -51,7 +51,7 @@ add_device() {
 
 dmcrypt_check() # device outstring
 {
-       X=$(dmsetup table $1 2>/dev/null | cut -d' '  -f 4)
+       X=$(dmsetup table $1 2>/dev/null | sed 's/.*: //' | cut -d' '  -f 4)
        if [ $X = $2 ] ; then
                echo -n "[table OK]"
        else
@@ -60,7 +60,7 @@ dmcrypt_check() # device outstring
                fail
        fi
 
-       X=$($CRYPTSETUP status $1 | grep cipher | sed s/\.\*cipher:\\s*//)
+       X=$($CRYPTSETUP status $1 | grep cipher: | sed s/\.\*cipher:\\s*//)
        if [ $X = $2 ] ; then
                echo -n "[status OK]"
        else
@@ -133,6 +133,11 @@ add_device
 dmcrypt aes aes-cbc-plain
 dmcrypt aes-plain aes-cbc-plain
 
+# empty cipher
+dmcrypt null cipher_null-ecb
+dmcrypt cipher_null cipher_null-cbc-plain
+dmcrypt cipher_null-ecb
+
 # codebook doesn't support IV at all
 for cipher in $CIPHERS ; do
        dmcrypt "$cipher-ecb"