Skip to content

Commit 7d2cf2c

Browse files
authored
Merge pull request ceph#59239 from yuvalif/wip-yuval-67513
Reviewed-By: Casey Bodley <[email protected]> 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 <[email protected]>
2 parents 36924ef + cdd75b4 commit 7d2cf2c

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

qa/tasks/rabbitmq.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,25 @@ def run_rabbitmq(ctx, config):
7070
(remote,) = ctx.cluster.only(client).remotes.keys()
7171

7272
ctx.cluster.only(client).run(args=[
73-
'sudo', 'systemctl', 'enable', 'rabbitmq-server.service'
73+
'echo', 'loopback_users.guest = false', run.Raw('|'), 'sudo', 'tee', '-a', '/etc/rabbitmq/rabbitmq.conf'
7474
],
7575
)
7676

7777
ctx.cluster.only(client).run(args=[
78-
'sudo', '/sbin/service', 'rabbitmq-server', 'start'
78+
'sudo', 'systemctl', 'enable', 'rabbitmq-server'
79+
],
80+
)
81+
82+
ctx.cluster.only(client).run(args=[
83+
'sudo', 'systemctl', 'start', 'rabbitmq-server'
7984
],
8085
)
8186

82-
'''
8387
# To check whether rabbitmq-server is running or not
8488
ctx.cluster.only(client).run(args=[
85-
'sudo', '/sbin/service', 'rabbitmq-server', 'status'
89+
'sudo', 'systemctl', 'status', 'rabbitmq-server'
8690
],
8791
)
88-
'''
8992

9093
try:
9194
yield
@@ -96,7 +99,7 @@ def run_rabbitmq(ctx, config):
9699
(remote,) = ctx.cluster.only(client).remotes.keys()
97100

98101
ctx.cluster.only(client).run(args=[
99-
'sudo', '/sbin/service', 'rabbitmq-server', 'stop'
102+
'sudo', 'systemctl', 'stop', 'rabbitmq-server'
100103
],
101104
)
102105

src/test/rgw/bucket_notification/test_bn.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,6 @@ def stop_kafka_receiver(receiver, task):
487487

488488

489489
def get_ip():
490-
return 'localhost'
491-
492-
493-
def get_ip_http():
494490
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
495491
try:
496492
# address should not be reachable
@@ -1323,7 +1319,7 @@ def notification_push(endpoint_type, conn, account=None, cloudevents=False):
13231319
task = None
13241320
if endpoint_type == 'http':
13251321
# create random port for the http server
1326-
host = get_ip_http()
1322+
host = get_ip()
13271323
port = random.randint(10000, 20000)
13281324
# start an http server in a separate thread
13291325
receiver = HTTPServerWithEvents((host, port), cloudevents=cloudevents)
@@ -3859,7 +3855,7 @@ def persistent_notification(endpoint_type, conn, account=None):
38593855
task = None
38603856
if endpoint_type == 'http':
38613857
# create random port for the http server
3862-
host = get_ip_http()
3858+
host = get_ip()
38633859
port = random.randint(10000, 20000)
38643860
# start an http server in a separate thread
38653861
receiver = HTTPServerWithEvents((host, port))

0 commit comments

Comments
 (0)