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: v14.2.5~258^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=82f4633f72bceaf1f9ed1b00106083703f4e6ecd;p=ceph.git qa/tasks: test for prevent negative subvolume size Fixes: https://tracker.ceph.com/issues/41617 Signed-off-by: Jos Collin (cherry picked from commit 9c6be9586166c3092aabefbfcd3f48e81e3d32af) --- 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"