lab7: топология RabbitMQ у оператора (import_definitions), relay — только publish; диагностика ротации, логи приложений в доказательствах
This commit is contained in:
@@ -353,7 +353,20 @@ def scenario_rotation(c):
|
||||
time.sleep(35) # pgx health check (30 s) выбрасывает разорванные соединения
|
||||
res['db_old_password'] = probe('db', '-user', 'app_api', '-stdin', stdin=old_pw).get('connect')
|
||||
check(denied(res['db_old_password']), 'old db password still works')
|
||||
res['api_after_db_rotation'] = c.call('GET', '/api/v1/chats', actor=alice)['status']
|
||||
tries = []
|
||||
for _ in range(12):
|
||||
try:
|
||||
tries.append(c.call('GET', '/api/v1/chats', (200, 503), actor=alice)['status'])
|
||||
except Failure as e:
|
||||
tries.append(str(e)[-40:])
|
||||
if tries[-1] == 200:
|
||||
break
|
||||
time.sleep(5)
|
||||
res['api_after_db_rotation_attempts'] = tries
|
||||
if tries[-1] != 200:
|
||||
res['api_secret_events'] = [l[-220:] for l in compose('logs', '--no-color', '--since', '5m', 'api').stdout.splitlines()
|
||||
if 'secrets.' in l or 'postgres' in l.lower()][-15:]
|
||||
check(tries[-1] == 200, 'API did not recover after DB password rotation: %s' % res)
|
||||
# 2) ключ S3 worker: загрузка после ротации обрабатывается
|
||||
bootstrap('rotate-s3', 'worker')
|
||||
time.sleep(35)
|
||||
|
||||
Reference in New Issue
Block a user