]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: unit test updates for cluster-network handling
authorPaul Cuzner <pcuzner@redhat.com>
Sun, 17 Jan 2021 23:24:16 +0000 (12:24 +1300)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 10 Feb 2021 12:26:25 +0000 (13:26 +0100)
Tests updated to handle comma separated subnet lists

Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
(cherry picked from commit bbe4fd83c556efb35c16f6da0bf2b00e11a2b3c9)

src/cephadm/tests/test_cephadm.py

index f0c496092d185e42f4f48fa1b5f22a4c1cf9382a..e608097efe451378106633b17a05313c1d4bcb3d 100644 (file)
@@ -654,11 +654,23 @@ iMN28C2bKGao5UHvdER1rGy7
 
     def test_ipv4_subnet(self):
         rc, v, msg = cd.check_subnet('192.168.1.0/24')
-        assert rc == 0 and v == 4
+        assert rc == 0 and v[0] == 4
     
+    def test_ipv4_subnet_list(self):
+        rc, v, msg = cd.check_subnet('192.168.1.0/24,10.90.90.0/24')
+        assert rc == 0 and not msg
+    
+    def test_ipv4_subnet_badlist(self):
+        rc, v, msg = cd.check_subnet('192.168.1.0/24,192.168.1.1')
+        assert rc == 1 and msg
+
+    def test_ipv4_subnet_mixed(self):
+        rc, v, msg = cd.check_subnet('192.168.100.0/24,fe80::/64')
+        assert rc == 0 and v == [4,6]
+
     def test_ipv6_subnet(self):
         rc, v, msg = cd.check_subnet('fe80::/64')
-        assert rc == 0 and v == 6
+        assert rc == 0 and v[0] == 6
     
     def test_subnet_mask_missing(self):
         rc, v, msg = cd.check_subnet('192.168.1.58')