]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: test for prevent negative subvolume size
authorJos Collin <jcollin@redhat.com>
Fri, 6 Sep 2019 06:10:17 +0000 (11:40 +0530)
committerRamana Raja <rraja@redhat.com>
Fri, 20 Sep 2019 09:36:24 +0000 (15:06 +0530)
Fixes: https://tracker.ceph.com/issues/41617
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit 9c6be9586166c3092aabefbfcd3f48e81e3d32af)

qa/tasks/cephfs/test_volumes.py

index 36d3ac10112cb0e67f1b5e8ab7719946461268cc..98fd17b478d61c42c3cff48ca886cb0c9dff224a 100644 (file)
@@ -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"