From 9c6be9586166c3092aabefbfcd3f48e81e3d32af Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Fri, 6 Sep 2019 11:40:17 +0530 Subject: [PATCH] qa/tasks: test for prevent negative subvolume size Fixes: https://tracker.ceph.com/issues/41617 Signed-off-by: Jos Collin --- qa/tasks/cephfs/test_volumes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 36d3ac10112cb..98fd17b478d61 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" -- 2.39.5