From: Yuval Lifshitz Date: Thu, 15 Aug 2024 14:34:57 +0000 (+0000) Subject: test/rgw/notification: use real ip address instead of localhost X-Git-Tag: v18.2.5~154^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85c8b6c8654e709b1e33f757011043d74d17ddeb;p=ceph.git test/rgw/notification: use real ip address instead of localhost based on that comment: https://tracker.ceph.com/issues/67206#note-6 the address used by the endpoint is taken as the real IP address of the host where the test script is running and not localhost. we also changed the rabbitmq-server conf to allow "guest" user to connect over non localhost address Fixes: https://tracker.ceph.com/issues/67206 Signed-off-by: Yuval Lifshitz (cherry picked from commit cdd75b499f7fe944906d863b9933e8d3aff95e5f) Conflicts: qa/tasks/rabbitmq.py src/test/rgw/bucket_notification/test_bn.py --- diff --git a/qa/tasks/rabbitmq.py b/qa/tasks/rabbitmq.py index c78ac1e568f..ddd4a9d5126 100644 --- a/qa/tasks/rabbitmq.py +++ b/qa/tasks/rabbitmq.py @@ -73,6 +73,11 @@ def run_rabbitmq(ctx, config): 'sudo', 'chkconfig', 'rabbitmq-server', 'on' ], ) + + ctx.cluster.only(client).run(args=[ + 'echo', 'loopback_users.guest = false', run.Raw('|'), 'sudo', 'tee', '-a', '/etc/rabbitmq/rabbitmq.conf' + ], + ) ctx.cluster.only(client).run(args=[ 'sudo', '/sbin/service', 'rabbitmq-server', 'start' diff --git a/src/test/rgw/bucket_notification/test_bn.py b/src/test/rgw/bucket_notification/test_bn.py index ee89d326d43..4ec084985d9 100644 --- a/src/test/rgw/bucket_notification/test_bn.py +++ b/src/test/rgw/bucket_notification/test_bn.py @@ -486,10 +486,6 @@ def stop_kafka_receiver(receiver, task): def get_ip(): - return 'localhost' - - -def get_ip_http(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: # address should not be reachable @@ -3600,7 +3596,7 @@ def persistent_notification(endpoint_type): host = get_ip() if endpoint_type == 'http': # create random port for the http server - host = get_ip_http() + host = get_ip() port = random.randint(10000, 20000) # start an http server in a separate thread receiver = StreamingHTTPServer(host, port, num_workers=10)