]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: add test inputs verifying count & count-per-host >= 1 44267/head
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 10 Dec 2021 13:19:59 +0000 (08:19 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 10 Dec 2021 17:18:49 +0000 (12:18 -0500)
This adds unit new test inputs, local to python-common that verify the
correct error messages are raised when count == 0 and count_per_host ==
0.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/python-common/ceph/tests/test_service_spec.py

index 3678585b84e3658b71fb490247be307867d94524..04225e2e1a231ae1b4db91fcc73a27a135eb6a0c 100644 (file)
@@ -549,6 +549,18 @@ service_id: foo
 placement:
   count: 7.36
 """, "num/count must be an integer value",),
+    ("""
+service_type: rgw
+service_id: foo
+placement:
+  count: 0
+""", "num/count must be >= 1",),
+    ("""
+service_type: rgw
+service_id: foo
+placement:
+  count_per_host: 0
+""", "count-per-host must be >= 1",),
     ])
 def test_service_spec_validation_error(y, error_match):
     data = yaml.safe_load(y)