]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw/notification: use real ip address instead of localhost 59239/head
authorYuval Lifshitz <ylifshit@ibm.com>
Thu, 15 Aug 2024 14:34:57 +0000 (14:34 +0000)
committerYuval Lifshitz <ylifshit@redhat.com>
Fri, 16 Aug 2024 11:36:17 +0000 (14:36 +0300)
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 <ylifshit@ibm.com>
qa/tasks/rabbitmq.py
src/test/rgw/bucket_notification/test_bn.py

index 944233d9775dfe0156976825eac210b6d401bc49..e9e39cfdf4a2292c8cf999dd6a635c0834c4581e 100644 (file)
@@ -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'
                 ],
             )
 
index bdb302511f472654fe6fe0ecb8f23f045af2f2c1..52b7c793d4663df5a639efacf19d29753caae4f0 100644 (file)
@@ -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))