@@ -22,10 +22,6 @@ def setUpClass(cls):
2222 else :
2323 BlockDev .reinit (cls .requested_plugins , True , None )
2424
25- class DevMapperPluginVersionCase (DevMapperTest ):
26- @tag_test (TestTags .NOSTORAGE )
27- def test_plugin_version (self ):
28- self .assertEqual (BlockDev .get_plugin_soname (BlockDev .Plugin .DM ), "libbd_dm.so.3" )
2925
3026class DevMapperTestCase (DevMapperTest ):
3127
@@ -51,6 +47,7 @@ def _clean_up(self):
5147
5248 os .unlink (self .dev_file )
5349
50+
5451class DevMapperGetSubsystemFromName (DevMapperTestCase ):
5552 def _destroy_lvm (self ):
5653 run ("vgremove --yes libbd_dm_tests --config \" devices {use_devicesfile = 0}\" >/dev/null 2>&1" )
@@ -71,11 +68,12 @@ def test_get_subsystem_from_name_lvm(self):
7168 def test_get_subsystem_from_name_crypt (self ):
7269 """Verify that it is possible to get luks device subsystem from its name"""
7370 self .addCleanup (self ._destroy_crypt )
74- run ("echo \" supersecretkey\" | cryptsetup luksFormat %s -" % self .loop_dev )
71+ run ("echo \" supersecretkey\" | cryptsetup luksFormat --pbkdf=pbkdf2 --pbkdf-force-iterations=1000 %s -" % self .loop_dev )
7572 run ("echo \" supersecretkey\" | cryptsetup open %s libbd_dm_tests-subsystem_crypt --key-file=-" % self .loop_dev )
7673 subsystem = BlockDev .dm_get_subsystem_from_name ("libbd_dm_tests-subsystem_crypt" )
7774 self .assertEqual (subsystem , "CRYPT" )
7875
76+
7977 def test_get_subsystem_from_name_linear (self ):
8078 succ = BlockDev .dm_create_linear ("testMap" , self .loop_dev , 100 , None )
8179 self .assertTrue (succ )
@@ -101,16 +99,20 @@ def test_get_subsystem_from_name_linear(self):
10199 with self .assertRaisesRegex (GLib .GError , "does not exist" ):
102100 BlockDev .dm_get_subsystem_from_name ("testMap" )
103101
102+
104103class DevMapperCreateRemoveLinear (DevMapperTestCase ):
105104 @tag_test (TestTags .CORE )
106105 def test_create_remove_linear (self ):
107106 """Verify that it is possible to create new linear mapping and remove it"""
108107
109108 succ = BlockDev .dm_create_linear ("testMap" , self .loop_dev , 100 , None )
110109 self .assertTrue (succ )
110+ self .assertTrue (os .path .exists ("/dev/mapper/testMap" ))
111111
112112 succ = BlockDev .dm_remove ("testMap" )
113113 self .assertTrue (succ )
114+ self .assertFalse (os .path .exists ("/dev/mapper/testMap" ))
115+
114116
115117class DevMapperMapExists (DevMapperTestCase ):
116118 def test_map_exists (self ):
@@ -140,6 +142,7 @@ def test_map_exists(self):
140142 succ = BlockDev .dm_map_exists ("testMap" , False , False )
141143 self .assertFalse (succ )
142144
145+
143146class DevMapperNameNodeBijection (DevMapperTestCase ):
144147 def test_name_node_bijection (self ):
145148 """Verify that the map's node and map name points to each other"""
@@ -150,9 +153,11 @@ def test_name_node_bijection(self):
150153 self .assertEqual (BlockDev .dm_name_from_node (BlockDev .dm_node_from_name ("testMap" )),
151154 "testMap" )
152155
153- self .assertTrue (succ )
154156
155- class DMDepsTest (DevMapperTest ):
157+ class DMNoStorageTest (DevMapperTest ):
158+ @tag_test (TestTags .NOSTORAGE )
159+ def test_plugin_version (self ):
160+ self .assertEqual (BlockDev .get_plugin_soname (BlockDev .Plugin .DM ), "libbd_dm.so.3" )
156161
157162 @tag_test (TestTags .NOSTORAGE )
158163 def test_missing_dependencies (self ):
0 commit comments