cephadm: unit test updates for cluster-network handling

Tests updated to handle comma separated subnet lists

Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
This commit is contained in:
Paul Cuzner 2021-01-18 12:24:16 +13:00
parent abd9287db0
commit bbe4fd83c5

View 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')