mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
tests: Add a password to TLS configurations (#1603)
Add a password to TLS configurations
This commit is contained in:
parent
3ed0bb480f
commit
4c85d5825d
2 changed files with 12 additions and 5 deletions
|
@ -439,17 +439,21 @@ async def test_large_cmd(async_client: aioredis.Redis):
|
|||
@pytest.mark.asyncio
|
||||
async def test_reject_non_tls_connections_on_tls(with_tls_server_args, df_local_factory):
|
||||
server = df_local_factory.create(
|
||||
no_tls_on_admin_port="true", admin_port=1111, port=1211, **with_tls_server_args
|
||||
no_tls_on_admin_port="true",
|
||||
admin_port=1111,
|
||||
port=1211,
|
||||
requirepass="XXX",
|
||||
**with_tls_server_args,
|
||||
)
|
||||
server.start()
|
||||
|
||||
client = aioredis.Redis(port=server.port)
|
||||
client = aioredis.Redis(port=server.port, password="XXX")
|
||||
try:
|
||||
await client.execute_command("DBSIZE")
|
||||
except redis_conn_error:
|
||||
pass
|
||||
|
||||
client = aioredis.Redis(port=server.admin_port)
|
||||
client = aioredis.Redis(port=server.admin_port, password="XXX")
|
||||
assert await client.dbsize() == 0
|
||||
await client.close()
|
||||
|
||||
|
|
|
@ -1274,10 +1274,11 @@ async def test_no_tls_on_admin_port(
|
|||
admin_port=ADMIN_PORT,
|
||||
**with_tls_server_args,
|
||||
port=BASE_PORT,
|
||||
requirepass="XXX",
|
||||
proactor_threads=t_master,
|
||||
)
|
||||
master.start()
|
||||
c_master = aioredis.Redis(port=master.admin_port)
|
||||
c_master = aioredis.Redis(port=master.admin_port, password="XXX")
|
||||
await c_master.execute_command("DEBUG POPULATE 100")
|
||||
db_size = await c_master.execute_command("DBSIZE")
|
||||
assert 100 == db_size
|
||||
|
@ -1289,9 +1290,11 @@ async def test_no_tls_on_admin_port(
|
|||
**with_tls_server_args,
|
||||
port=BASE_PORT + 1,
|
||||
proactor_threads=t_replica,
|
||||
requirepass="XXX",
|
||||
masterauth="XXX",
|
||||
)
|
||||
replica.start()
|
||||
c_replica = aioredis.Redis(port=replica.admin_port)
|
||||
c_replica = aioredis.Redis(port=replica.admin_port, password="XXX")
|
||||
res = await c_replica.execute_command("REPLICAOF localhost " + str(master.admin_port))
|
||||
assert b"OK" == res
|
||||
await check_all_replicas_finished([c_replica], c_master)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue