def test_remove_bitmap_failed(monkeypatch, tmp_mount, vol_chain): bitmap = 'bitmap' # Add new bitmap to base parent volume op = qemuimg.bitmap_add(vol_chain.top_vol, bitmap) op.run() monkeypatch.setattr(qemuimg, "bitmap_remove", qemuimg_failure) with pytest.raises(exception.RemoveBitmapError): bitmaps.remove_bitmap(vol_chain.top_vol, bitmap)
def test_remove_non_existing_bitmap_succeed(tmp_mount, vol_chain): # try to remove a non-existing bitmap from top_vol bitmaps.remove_bitmap(vol_chain.top_vol, 'bitmap')
def _run(self): with guarded.context(self._vol_info.locks): self._validate() with self._vol_info.prepare(): with self._vol_info.volume_operation(): bitmaps.remove_bitmap(self._vol_info.path, self.bitmap)