From f38dd48893a58eb11391dfb08544c61256f5285e Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 17 Aug 2012 15:44:37 -0700 Subject: [PATCH] test_rbd.py: actually make unprotect_with_children work, and clean up --- src/test/pybind/test_rbd.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 3459b137567f1..2f15c7eacb65a 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -8,7 +8,7 @@ from nose.tools import eq_ as eq, assert_raises from rados import Rados from rbd import (RBD, Image, ImageNotFound, InvalidArgument, ImageExists, ImageBusy, ImageHasSnapshots, ReadOnlyImage, - RBD_FEATURE_LAYERING) + FunctionNotSupported, RBD_FEATURE_LAYERING) rados = None @@ -452,20 +452,19 @@ class TestClone(object): eq(image, IMG_NAME) eq(snap, 'snap1') - # close and remove this pool's clone - self.clone.close() - self.rbd.remove(ioctx, 'clone') - - # check that we cannot yet remove the parent snap + # 2 children, check that cannot remove the parent snap assert_raises(ImageBusy, self.image.remove_snap, 'snap1') # close and remove other pool's clone self.other_clone.close() self.rbd.remove(other_ioctx, 'other_clone') - # now removing the parent snap should succeed + # check that we cannot yet remove the parent snap assert_raises(ImageBusy, self.image.remove_snap, 'snap1') + other_ioctx.close() + rados.delete_pool('rbd2') + # unprotect, remove parent snap happen in cleanup, and should succeed def test_stat(self): -- 2.39.5