From: John Mulligan Date: Wed, 12 Jul 2023 14:18:49 +0000 (-0400) Subject: pybind/mgr/cephadm: extend haproxy protocol test case X-Git-Tag: v19.0.0~674^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1e960026d01a94d97ab960c820227fd5fa4157fa;p=ceph.git pybind/mgr/cephadm: extend haproxy protocol test case Extend that haproxy protocol test case so that for host1 we exercise the new logic for gathering known-good IPs for the host and add those to the ganesha config. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 25e557631e118..e8f74c6e668ec 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -2213,7 +2213,7 @@ class TestIngressService: ' Enable_RQUOTA = false;\n' ' Protocols = 4;\n' ' NFS_Port = 2049;\n' - ' HAProxy_Hosts = 192.168.122.111, 192.168.122.222;\n' + ' HAProxy_Hosts = 192.168.122.111, 10.10.2.20, 192.168.122.222;\n' '}\n' '\n' 'NFSv4 {\n' @@ -2286,6 +2286,31 @@ class TestIngressService: ingress_svc = cephadm_module.cephadm_services['ingress'] nfs_svc = cephadm_module.cephadm_services['nfs'] + # add host network info to one host to test the behavior of + # adding all known-good addresses of the host to the list. + cephadm_module.cache.update_host_networks('host1', { + # this one is additional + '10.10.2.0/24': { + 'eth1': ['10.10.2.20'] + }, + # this is redundant and will be skipped + '192.168.122.0/24': { + 'eth0': ['192.168.122.111'] + }, + # this is a link-local address and will be ignored + "fe80::/64": { + "veth0": [ + "fe80::8cf5:25ff:fe1c:d963" + ], + "eth0": [ + "fe80::c7b:cbff:fef6:7370" + ], + "eth1": [ + "fe80::7201:25a7:390b:d9a7" + ] + }, + }) + haproxy_generated_conf, _ = ingress_svc.haproxy_generate_config( CephadmDaemonDeploySpec( host='host1',