88from tests .utils .bindings import (
99 default_features ,
1010 EndpointProvider ,
11- FeatureInterfaceHealth ,
1211 FeatureLinkDetection ,
13- FeatureWireguard ,
14- FeaturePersistentKeepalive ,
15- FeaturePolling ,
1612 LinkState ,
1713 NodeState ,
1814 PathType ,
4137IDLE_TIMEOUT_S = round ((LINK_STATE_TIMEOUT_S + POSSIBLE_DOWN_DELAY ) * TOLERANCE ) # 21s
4238
4339
44- def long_persistent_keepalive_periods () -> FeatureWireguard :
45- return FeatureWireguard (
46- persistent_keepalive = FeaturePersistentKeepalive (
47- proxying = 3600 , direct = 3600 , vpn = 3600 , stun = 3600
48- ),
49- polling = FeaturePolling (
50- wireguard_polling_period = 1000 ,
51- wireguard_polling_period_after_state_change = 50 ,
52- ),
53- interface_health = FeatureInterfaceHealth (
54- transient_failure_separation_threshold = 10 ,
55- uapi_poll_suspension_threshold = 5 ,
56- ),
57- enable_dynamic_wg_nt_control = False ,
58- skt_buffer_size = None ,
59- inter_thread_channel_size = None ,
60- max_inter_thread_batched_pkts = None ,
61- )
62-
63-
6440def _generate_setup_parameter_pair (
6541 cfg : List [Tuple [ConnectionTag , TelioAdapterType ]],
6642 direct : bool = False ,
@@ -70,22 +46,12 @@ def _generate_setup_parameter_pair(
7046 features .link_detection = FeatureLinkDetection (
7147 rtt_seconds = MAX_RTT_ALLOWED_S , use_for_downgrade = False
7248 )
73- features_default_wg_persistent_keepalive = features .wireguard .persistent_keepalive
7449
7550 if direct and features .direct :
7651 features .direct .providers = [EndpointProvider .STUN ]
77- # Required to trigger direct connection renewal after network switch
78- features .wireguard .persistent_keepalive .direct = (
79- features_default_wg_persistent_keepalive .direct
80- )
8152 elif vpn :
8253 # TODO: Remove this if you're adding a "vpn with mesh" test
8354 assert len (cfg ) == 1
84- features .wireguard .persistent_keepalive .vpn = (
85- features_default_wg_persistent_keepalive .vpn
86- )
87- else :
88- features .wireguard = long_persistent_keepalive_periods ()
8955
9056 return [
9157 SetupParameters (
0 commit comments