Skip to content

Commit 46a84eb

Browse files
vojtechtrefnyclaude
andcommitted
tests: Remove test_reload test case
The test_reload test recompiled the LVM plugin and verified that reinit picked up the new code. This no longer works because plugins are loaded with RTLD_NODELETE, which prevents the shared library from being unmapped on dlclose -- dlopen of the same path returns the already-loaded library. The test_force_plugin test already covers reloading with a different .so name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e230828 commit 46a84eb

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

tests/library_test.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -210,39 +210,6 @@ def _clean_up(self):
210210
# try to get everything back to normal by (re)loading all plugins
211211
BlockDev.reinit(self.requested_plugins, True, None)
212212

213-
# recompiles the LVM plugin
214-
@tag_test(TestTags.SLOW, TestTags.CORE, TestTags.SOURCEONLY)
215-
def test_reload(self):
216-
"""Verify that reloading plugins works as expected"""
217-
218-
# max LV size should be something sane (not 1024 bytes)
219-
orig_max_size = BlockDev.lvm_get_max_lv_size()
220-
self.assertNotEqual(orig_max_size, 1024)
221-
222-
# change the sources and recompile
223-
os.system("sed -ri 's?MAX_LV_SIZE;?1024;//test-change?' src/plugins/lvm/lvm-common.c > /dev/null")
224-
ret = os.system("make -C src/plugins/lvm/ libbd_lvm.la >/dev/null 2>&1")
225-
self.assertEqual(ret, 0, "Failed to recompile libblockdev for reload test")
226-
227-
# library should successfully reinitialize without reloading plugins
228-
self.assertTrue(BlockDev.reinit(self.requested_plugins, False, None))
229-
230-
# LVM plugin not reloaded, max LV size should be the same
231-
self.assertEqual(BlockDev.lvm_get_max_lv_size(), orig_max_size)
232-
233-
# library should successfully reinitialize reloading plugins
234-
self.assertTrue(BlockDev.reinit(self.requested_plugins, True, None))
235-
236-
# LVM plugin reloaded, max LV size should be 1024 bytes
237-
self.assertEqual(BlockDev.lvm_get_max_lv_size(), 1024)
238-
239-
# change the sources back and recompile
240-
os.system("sed -ri 's?1024;//test-change?MAX_LV_SIZE;?' src/plugins/lvm/lvm-common.c > /dev/null")
241-
os.system("make -C src/plugins/lvm/ libbd_lvm.la >/dev/null 2>&1")
242-
243-
# library should successfully reinitialize reloading original plugins
244-
self.assertTrue(BlockDev.reinit(self.requested_plugins, True, None))
245-
246213
# recompiles the LVM plugin
247214
@tag_test(TestTags.SLOW, TestTags.SOURCEONLY)
248215
def test_force_plugin(self):

0 commit comments

Comments
 (0)