From: Jos Collin Date: Fri, 6 Sep 2019 06:10:17 +0000 (+0530) Subject: qa/tasks: test for prevent negative subvolume size X-Git-Tag: v15.1.0~1535^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30058%2Fhead;p=ceph.git qa/tasks: test for prevent negative subvolume size Fixes: https://tracker.ceph.com/issues/41617 Signed-off-by: Jos Collin --- diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 36d3ac10112c..98fd17b478d6 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -162,6 +162,17 @@ class TestVolumes(CephFSTestCase): else: raise + def test_subvolume_create_with_invalid_size(self): + # create subvolume with an invalid size -1 + subvolume = self._generate_random_subvolume_name() + try: + self._fs_cmd("subvolume", "create", self.volname, subvolume, "--size", "-1") + except CommandFailedError as ce: + if ce.exitstatus != errno.EINVAL: + raise + else: + raise RuntimeError("expected the 'fs subvolume create' command to fail") + def test_nonexistent_subvolume_rm(self): # remove non-existing subvolume subvolume = "non_existent_subvolume"