safety by default

This commit is contained in:
Christien Rioux 2023-11-05 18:38:05 -05:00
parent 88389a1b78
commit ee375ad430
22 changed files with 1406 additions and 1593 deletions

View file

@ -22,7 +22,7 @@ async def test_routing_contexts(api_connection: veilid.VeilidAPI):
rc = await api_connection.new_routing_context()
async with rc:
rcp = await rc.with_privacy(release=False)
rcp = await rc.with_default_safety(release=False)
async with rcp:
pass
@ -32,15 +32,15 @@ async def test_routing_contexts(api_connection: veilid.VeilidAPI):
async with rc:
pass
rc = await (await api_connection.new_routing_context()).with_custom_privacy(
rc = await (await api_connection.new_routing_context()).with_safety(
veilid.SafetySelection.safe(
veilid.SafetySpec(None, 2, veilid.Stability.RELIABLE, veilid.Sequencing.ENSURE_ORDERED)
veilid.SafetySpec(None, 2, veilid.Stability.LOW_LATENCY, veilid.Sequencing.NO_PREFERENCE)
)
)
await rc.release()
rc = await (await api_connection.new_routing_context()).with_custom_privacy(
veilid.SafetySelection.unsafe(veilid.Sequencing.ENSURE_ORDERED)
rc = await (await api_connection.new_routing_context()).with_safety(
veilid.SafetySelection.unsafe(veilid.Sequencing.PREFER_ORDERED)
)
await rc.release()
@ -65,7 +65,7 @@ async def test_routing_context_app_message_loopback():
await api.debug("purge routes")
# make a routing context that uses a safety route
rc = await (await api.new_routing_context()).with_privacy()
rc = await api.new_routing_context()
async with rc:
# make a new local private route
prl, blob = await api.new_private_route()
@ -105,7 +105,7 @@ async def test_routing_context_app_call_loopback():
await api.debug("purge routes")
# make a routing context that uses a safety route
rc = await (await (await api.new_routing_context()).with_privacy()).with_sequencing(
rc = await (await api.new_routing_context()).with_sequencing(
veilid.Sequencing.ENSURE_ORDERED
)
async with rc:
@ -160,7 +160,7 @@ async def test_routing_context_app_message_loopback_big_packets():
await api.debug("purge routes")
# make a routing context that uses a safety route
rc = await (await (await api.new_routing_context()).with_privacy()).with_sequencing(
rc = await (await api.new_routing_context()).with_sequencing(
veilid.Sequencing.ENSURE_ORDERED
)
async with rc:
@ -225,7 +225,7 @@ async def test_routing_context_app_call_loopback_big_packets():
app_call_task = asyncio.create_task(app_call_queue_task_handler(api), name="app call task")
# make a routing context that uses a safety route
rc = await (await (await api.new_routing_context()).with_privacy()).with_sequencing(
rc = await (await api.new_routing_context()).with_sequencing(
veilid.Sequencing.ENSURE_ORDERED
)
async with rc:
@ -269,8 +269,8 @@ async def test_routing_context_app_message_loopback_bandwidth():
await api.debug("purge routes")
# make a routing context that uses a safety route
# rc = await (await (await api.new_routing_context()).with_privacy()).with_sequencing(veilid.Sequencing.ENSURE_ORDERED)
# rc = await (await api.new_routing_context()).with_privacy()
# rc = await (await api.new_routing_context()).with_sequencing(veilid.Sequencing.ENSURE_ORDERED)
# rc = await api.new_routing_context()
rc = await api.new_routing_context()
async with rc:
# make a new local private route