def test_setup_unmounted_volume(self): util.unmount(self.mount) self.addCleanup(util.mount, self.device, self.mount) self.assertEqual( dattobd.setup(self.minor, self.device, self.cow_full_path), errno.EINVAL) self.assertFalse(os.path.exists(self.snap_device)) self.assertIsNone(dattobd.info(self.minor))
def test_destroy_unverified_incremental(self): util.unmount(self.mount) self.addCleanup(util.mount, self.device, self.mount) self.assertEqual( elastio_snap.reload_incremental(self.minor, self.device, self.cow_reload_path), 0) self.assertEqual(elastio_snap.destroy(self.minor), 0) self.assertFalse(os.path.exists(self.snap_device)) self.assertIsNone(elastio_snap.info(self.minor))
def test_destroy_unverified_snapshot(self): util.unmount(self.mount) self.addCleanup(util.mount, self.device, self.mount) self.assertEqual( dattobd.reload_snapshot(self.minor, self.device, self.cow_reload_path), 0) self.assertEqual(dattobd.destroy(self.minor), 0) self.assertFalse(os.path.exists(self.snap_device)) self.assertIsNone(dattobd.info(self.minor))
def test_destroy_dormant_snapshot(self): self.assertEqual( elastio_snap.setup(self.minor, self.device, self.cow_full_path), 0) util.unmount(self.mount) self.addCleanup(os.remove, self.cow_full_path) self.addCleanup(util.mount, self.device, self.mount) self.assertEqual(elastio_snap.destroy(self.minor), 0) self.assertFalse(os.path.exists(self.snap_device)) self.assertIsNone(elastio_snap.info(self.minor))
def test_destroy_dormant_incremental(self): self.assertEqual( dattobd.setup(self.minor, self.device, self.cow_full_path), 0) self.assertEqual(dattobd.transition_to_incremental(self.minor), 0) util.unmount(self.mount) self.addCleanup(os.remove, self.cow_full_path) self.addCleanup(util.mount, self.device, self.mount) self.assertEqual(dattobd.destroy(self.minor), 0) self.assertFalse(os.path.exists(self.snap_device)) self.assertIsNone(dattobd.info(self.minor))
def tearDownClass(cls): util.unmount(cls.mount) if hasattr(cls, "backing_store"): util.loop_destroy(cls.device) os.unlink(cls.backing_store) cls.kmod.unload()