File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1444,6 +1444,24 @@ def test_veracrypt_open_close(self):
14441444 self .assertTrue (succ )
14451445 self .assertFalse (os .path .exists ("/dev/mapper/libblockdevTestTC" ))
14461446
1447+ @tag_test (TestTags .NOSTORAGE )
1448+ def test_seems_encrypted (self ):
1449+ """Verify that BlockDev.crypto_device_seems_encrypted works"""
1450+
1451+ # truecrypt device without header
1452+ enc = BlockDev .crypto_device_seems_encrypted (self .tc_dev )
1453+ self .assertTrue (enc )
1454+
1455+ ctx = BlockDev .CryptoKeyslotContext (passphrase = self .passphrase )
1456+ succ = BlockDev .crypto_tc_open (self .tc_dev , "libblockdevTestTC" , ctx )
1457+ self .assertTrue (succ )
1458+
1459+ # the cleartext device is not encrypted
1460+ enc = BlockDev .crypto_device_seems_encrypted ("/dev/mapper/libblockdevTestTC" )
1461+ self .assertFalse (enc )
1462+
1463+ succ = BlockDev .crypto_tc_close ("libblockdevTestTC" )
1464+
14471465
14481466class CryptoTestBitlk (CryptoTestCase ):
14491467
You can’t perform that action at this time.
0 commit comments