From cdd75b499f7fe944906d863b9933e8d3aff95e5f Mon Sep 17 00:00:00 2001 From: Yuval Lifshitz Date: Thu, 15 Aug 2024 14:34:57 +0000 Subject: [PATCH] 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 --- qa/tasks/rabbitmq.py | 15 +++++++++------ src/test/rgw/bucket_notification/test_bn.py | 8 ++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/qa/tasks/rabbitmq.py b/qa/tasks/rabbitmq.py index 944233d9775df..e9e39cfdf4a22 100644 --- a/qa/tasks/rabbitmq.py +++ b/qa/tasks/rabbitmq.py @@ -70,22 +70,25 @@ def run_rabbitmq(ctx, config): (remote,) = ctx.cluster.only(client).remotes.keys() ctx.cluster.only(client).run(args=[ - 'sudo', 'systemctl', 'enable', 'rabbitmq-server.service' + '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' + 'sudo', 'systemctl', 'enable', 'rabbitmq-server' + ], + ) + + ctx.cluster.only(client).run(args=[ + 'sudo', 'systemctl', 'start', 'rabbitmq-server' ], ) - ''' # To check whether rabbitmq-server is running or not ctx.cluster.only(client).run(args=[ - 'sudo', '/sbin/service', 'rabbitmq-server', 'status' + 'sudo', 'systemctl', 'status', 'rabbitmq-server' ], ) - ''' try: yield @@ -96,7 +99,7 @@ def run_rabbitmq(ctx, config): (remote,) = ctx.cluster.only(client).remotes.keys() ctx.cluster.only(client).run(args=[ - 'sudo', '/sbin/service', 'rabbitmq-server', 'stop' + 'sudo', 'systemctl', 'stop', 'rabbitmq-server' ], ) diff --git a/src/test/rgw/bucket_notification/test_bn.py b/src/test/rgw/bucket_notification/test_bn.py index bdb302511f472..52b7c793d4663 100644 --- a/src/test/rgw/bucket_notification/test_bn.py +++ b/src/test/rgw/bucket_notification/test_bn.py @@ -487,10 +487,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 @@ -1297,7 +1293,7 @@ def notification_push(endpoint_type, conn, account=None, cloudevents=False): task = None 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 = HTTPServerWithEvents((host, port), cloudevents=cloudevents) @@ -3833,7 +3829,7 @@ def persistent_notification(endpoint_type, conn, account=None): task = None 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 = HTTPServerWithEvents((host, port)) -- 2.39.5