]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind/test_ceph_argparse.py: add a test for "osd pool create" 30538/head
authorKefu Chai <kchai@redhat.com>
Tue, 24 Sep 2019 07:13:51 +0000 (15:13 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 24 Sep 2019 07:13:51 +0000 (15:13 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/pybind/test_ceph_argparse.py

index c7d3022e58a5d7188ad8cf8e5e7928b41db6b167..21df4bee049aa9692f59002c970038478ce66601 100755 (executable)
@@ -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',