From: Kefu Chai Date: Tue, 24 Sep 2019 07:13:51 +0000 (+0800) Subject: test/pybind/test_ceph_argparse.py: add a test for "osd pool create" X-Git-Tag: v15.1.0~1406^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30538%2Fhead;p=ceph.git test/pybind/test_ceph_argparse.py: add a test for "osd pool create" Signed-off-by: Kefu Chai --- diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index c7d3022e58a..21df4bee049 100755 --- a/src/test/pybind/test_ceph_argparse.py +++ b/src/test/pybind/test_ceph_argparse.py @@ -1068,6 +1068,15 @@ class TestOSD(TestArgparse): 'erasure', 'A-Za-z0-9-_.', 'ruleset^^']) self.assert_valid_command(['osd', 'pool', 'create', 'poolname']) assert_equal({}, validate_command(sigdict, ['osd', 'pool', 'create'])) + # invalid pg_num and pgp_num, like "-1", could spill over to + # erasure_code_profile and rule as they are valid profile and rule + # names, so validate_commands() cannot identify such cases. + # but if they are matched by profile and rule, the "rule" argument + # won't get a chance to be matched anymore. + assert_equal({}, validate_command(sigdict, ['osd', 'pool', 'create', + 'poolname', + '-1', '-1', + 'ruleset'])) assert_equal({}, validate_command(sigdict, ['osd', 'pool', 'create', 'poolname', '128', '128',