]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/cephadm: extend haproxy protocol test case
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 12 Jul 2023 14:18:49 +0000 (10:18 -0400)
committerAdam King <adking@redhat.com>
Thu, 31 Aug 2023 17:36:15 +0000 (13:36 -0400)
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 <jmulligan@redhat.com>
(cherry picked from commit 1e960026d01a94d97ab960c820227fd5fa4157fa)

src/pybind/mgr/cephadm/tests/test_services.py

index 3350f2951b98a26fcaec887eb183743affe0d8ec..41e89b606b63317200ac1ec1840e94e74cbd137c 100644 (file)
@@ -2252,7 +2252,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'
@@ -2325,6 +2325,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',