@@ -91,14 +91,14 @@ func TestNewProtocolSelector(t *testing.T) {
9191 },
9292 {
9393 name : "named tunnel quic and http2 disabled" ,
94- protocol : "auto" ,
94+ protocol : AutoSelectFlag ,
9595 expectedProtocol : H2mux ,
9696 fetchFunc : mockFetcher (false , edgediscovery.ProtocolPercent {Protocol : "http2" , Percentage : - 1 }, edgediscovery.ProtocolPercent {Protocol : "quic" , Percentage : - 1 }),
9797 namedTunnelConfig : testNamedTunnelProperties ,
9898 },
9999 {
100100 name : "named tunnel quic disabled" ,
101- protocol : "auto" ,
101+ protocol : AutoSelectFlag ,
102102 expectedProtocol : HTTP2 ,
103103 // Hasfallback true is because if http2 fails, then we further fallback to h2mux.
104104 hasFallback : true ,
@@ -108,21 +108,21 @@ func TestNewProtocolSelector(t *testing.T) {
108108 },
109109 {
110110 name : "named tunnel auto all http2 disabled" ,
111- protocol : "auto" ,
111+ protocol : AutoSelectFlag ,
112112 expectedProtocol : H2mux ,
113113 fetchFunc : mockFetcher (false , edgediscovery.ProtocolPercent {Protocol : "http2" , Percentage : - 1 }),
114114 namedTunnelConfig : testNamedTunnelProperties ,
115115 },
116116 {
117117 name : "named tunnel auto to h2mux" ,
118- protocol : "auto" ,
118+ protocol : AutoSelectFlag ,
119119 expectedProtocol : H2mux ,
120120 fetchFunc : mockFetcher (false , edgediscovery.ProtocolPercent {Protocol : "http2" , Percentage : 0 }),
121121 namedTunnelConfig : testNamedTunnelProperties ,
122122 },
123123 {
124124 name : "named tunnel auto to http2" ,
125- protocol : "auto" ,
125+ protocol : AutoSelectFlag ,
126126 expectedProtocol : HTTP2 ,
127127 hasFallback : true ,
128128 expectedFallback : H2mux ,
@@ -131,7 +131,7 @@ func TestNewProtocolSelector(t *testing.T) {
131131 },
132132 {
133133 name : "named tunnel auto to quic" ,
134- protocol : "auto" ,
134+ protocol : AutoSelectFlag ,
135135 expectedProtocol : QUIC ,
136136 hasFallback : true ,
137137 expectedFallback : HTTP2 ,
@@ -167,7 +167,7 @@ func TestNewProtocolSelector(t *testing.T) {
167167 },
168168 {
169169 name : "warp routing quic" ,
170- protocol : "auto" ,
170+ protocol : AutoSelectFlag ,
171171 expectedProtocol : QUICWarp ,
172172 hasFallback : true ,
173173 expectedFallback : HTTP2Warp ,
@@ -177,7 +177,7 @@ func TestNewProtocolSelector(t *testing.T) {
177177 },
178178 {
179179 name : "warp routing auto" ,
180- protocol : "auto" ,
180+ protocol : AutoSelectFlag ,
181181 expectedProtocol : HTTP2Warp ,
182182 hasFallback : false ,
183183 fetchFunc : mockFetcher (false , edgediscovery.ProtocolPercent {Protocol : "http2" , Percentage : 100 }),
@@ -186,7 +186,7 @@ func TestNewProtocolSelector(t *testing.T) {
186186 },
187187 {
188188 name : "warp routing auto- quic" ,
189- protocol : "auto" ,
189+ protocol : AutoSelectFlag ,
190190 expectedProtocol : QUICWarp ,
191191 hasFallback : true ,
192192 expectedFallback : HTTP2Warp ,
@@ -209,7 +209,7 @@ func TestNewProtocolSelector(t *testing.T) {
209209 },
210210 {
211211 name : "named tunnel fetch error" ,
212- protocol : "auto" ,
212+ protocol : AutoSelectFlag ,
213213 fetchFunc : mockFetcher (true ),
214214 namedTunnelConfig : testNamedTunnelProperties ,
215215 expectedProtocol : HTTP2 ,
@@ -237,7 +237,7 @@ func TestNewProtocolSelector(t *testing.T) {
237237
238238func TestAutoProtocolSelectorRefresh (t * testing.T ) {
239239 fetcher := dynamicMockFetcher {}
240- selector , err := NewProtocolSelector ("auto" , noWarpRoutingEnabled , testNamedTunnelProperties , fetcher .fetch (), testNoTTL , & log )
240+ selector , err := NewProtocolSelector (AutoSelectFlag , noWarpRoutingEnabled , testNamedTunnelProperties , fetcher .fetch (), testNoTTL , & log )
241241 assert .NoError (t , err )
242242 assert .Equal (t , H2mux , selector .Current ())
243243
@@ -297,7 +297,7 @@ func TestHTTP2ProtocolSelectorRefresh(t *testing.T) {
297297func TestProtocolSelectorRefreshTTL (t * testing.T ) {
298298 fetcher := dynamicMockFetcher {}
299299 fetcher .protocolPercents = edgediscovery.ProtocolPercents {edgediscovery.ProtocolPercent {Protocol : "quic" , Percentage : 100 }}
300- selector , err := NewProtocolSelector ("auto" , noWarpRoutingEnabled , testNamedTunnelProperties , fetcher .fetch (), time .Hour , & log )
300+ selector , err := NewProtocolSelector (AutoSelectFlag , noWarpRoutingEnabled , testNamedTunnelProperties , fetcher .fetch (), time .Hour , & log )
301301 assert .NoError (t , err )
302302 assert .Equal (t , QUIC , selector .Current ())
303303
0 commit comments