@@ -19,8 +19,8 @@ limitations under the License.
19
19
package azure
20
20
21
21
import (
22
- "testing"
23
22
"strconv"
23
+ "testing"
24
24
25
25
"github.com/stretchr/testify/assert"
26
26
@@ -261,13 +261,13 @@ func TestGetLoadBalancingRuleName(t *testing.T) {
261
261
262
262
svc := & v1.Service {
263
263
ObjectMeta : meta.ObjectMeta {
264
- Annotations : map [string ]string { },
265
- UID : "257b9655-5137-4ad2-b091-ef3f07043ad3" ,
264
+ Annotations : map [string ]string {},
265
+ UID : "257b9655-5137-4ad2-b091-ef3f07043ad3" ,
266
266
},
267
267
}
268
268
269
269
cases := []struct {
270
- description string
270
+ description string
271
271
subnetName string
272
272
isInternal bool
273
273
useStandardLB bool
@@ -276,49 +276,49 @@ func TestGetLoadBalancingRuleName(t *testing.T) {
276
276
expected string
277
277
}{
278
278
{
279
- description : "internal lb should have subnet name on the rule name" ,
280
- subnetName : "shortsubnet" ,
281
- isInternal : true ,
282
- useStandardLB : true ,
283
- protocol : v1 .ProtocolTCP ,
284
- port : 9000 ,
285
- expected : "a257b965551374ad2b091ef3f07043ad-shortsubnet-TCP-9000" ,
279
+ description : "internal lb should have subnet name on the rule name" ,
280
+ subnetName : "shortsubnet" ,
281
+ isInternal : true ,
282
+ useStandardLB : true ,
283
+ protocol : v1 .ProtocolTCP ,
284
+ port : 9000 ,
285
+ expected : "a257b965551374ad2b091ef3f07043ad-shortsubnet-TCP-9000" ,
286
286
},
287
287
{
288
- description : "internal standard lb should have subnet name on the rule name but truncated to 80 charactors " ,
289
- subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
290
- isInternal : true ,
291
- useStandardLB : true ,
292
- protocol : v1 .ProtocolTCP ,
293
- port : 9000 ,
294
- expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnngg-TCP-9000" ,
288
+ description : "internal standard lb should have subnet name on the rule name but truncated to 80 characters " ,
289
+ subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
290
+ isInternal : true ,
291
+ useStandardLB : true ,
292
+ protocol : v1 .ProtocolTCP ,
293
+ port : 9000 ,
294
+ expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnngg-TCP-9000" ,
295
295
},
296
296
{
297
- description : "internal basic lb should have subnet name on the rule name but truncated to 80 charactors " ,
298
- subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
299
- isInternal : true ,
300
- useStandardLB : false ,
301
- protocol : v1 .ProtocolTCP ,
302
- port : 9000 ,
303
- expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnngg-TCP-9000" ,
297
+ description : "internal basic lb should have subnet name on the rule name but truncated to 80 characters " ,
298
+ subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
299
+ isInternal : true ,
300
+ useStandardLB : false ,
301
+ protocol : v1 .ProtocolTCP ,
302
+ port : 9000 ,
303
+ expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnngg-TCP-9000" ,
304
304
},
305
305
{
306
- description : "external standard lb should not have subnet name on the rule name" ,
307
- subnetName : "shortsubnet" ,
308
- isInternal : false ,
309
- useStandardLB : true ,
310
- protocol : v1 .ProtocolTCP ,
311
- port : 9000 ,
312
- expected : "a257b965551374ad2b091ef3f07043ad-TCP-9000" ,
306
+ description : "external standard lb should not have subnet name on the rule name" ,
307
+ subnetName : "shortsubnet" ,
308
+ isInternal : false ,
309
+ useStandardLB : true ,
310
+ protocol : v1 .ProtocolTCP ,
311
+ port : 9000 ,
312
+ expected : "a257b965551374ad2b091ef3f07043ad-TCP-9000" ,
313
313
},
314
314
{
315
- description : "external basic lb should not have subnet name on the rule name" ,
316
- subnetName : "shortsubnet" ,
317
- isInternal : false ,
318
- useStandardLB : false ,
319
- protocol : v1 .ProtocolTCP ,
320
- port : 9000 ,
321
- expected : "a257b965551374ad2b091ef3f07043ad-TCP-9000" ,
315
+ description : "external basic lb should not have subnet name on the rule name" ,
316
+ subnetName : "shortsubnet" ,
317
+ isInternal : false ,
318
+ useStandardLB : false ,
319
+ protocol : v1 .ProtocolTCP ,
320
+ port : 9000 ,
321
+ expected : "a257b965551374ad2b091ef3f07043ad-TCP-9000" ,
322
322
},
323
323
}
324
324
@@ -351,46 +351,46 @@ func TestGetFrontendIPConfigName(t *testing.T) {
351
351
}
352
352
353
353
cases := []struct {
354
- description string
354
+ description string
355
355
subnetName string
356
356
isInternal bool
357
357
useStandardLB bool
358
358
expected string
359
359
}{
360
360
{
361
- description : "internal lb should have subnet name on the frontend ip configuration name" ,
362
- subnetName : "shortsubnet" ,
363
- isInternal : true ,
364
- useStandardLB : true ,
365
- expected : "a257b965551374ad2b091ef3f07043ad-shortsubnet" ,
361
+ description : "internal lb should have subnet name on the frontend ip configuration name" ,
362
+ subnetName : "shortsubnet" ,
363
+ isInternal : true ,
364
+ useStandardLB : true ,
365
+ expected : "a257b965551374ad2b091ef3f07043ad-shortsubnet" ,
366
366
},
367
367
{
368
- description : "internal standard lb should have subnet name on the frontend ip configuration name but truncated to 80 charactors " ,
369
- subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
370
- isInternal : true ,
371
- useStandardLB : true ,
372
- expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnnggggggggggg" ,
368
+ description : "internal standard lb should have subnet name on the frontend ip configuration name but truncated to 80 characters " ,
369
+ subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
370
+ isInternal : true ,
371
+ useStandardLB : true ,
372
+ expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnnggggggggggg" ,
373
373
},
374
374
{
375
- description : "internal basic lb should have subnet name on the frontend ip configuration name but truncated to 80 charactors " ,
376
- subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
377
- isInternal : true ,
378
- useStandardLB : false ,
379
- expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnnggggggggggg" ,
375
+ description : "internal basic lb should have subnet name on the frontend ip configuration name but truncated to 80 characters " ,
376
+ subnetName : "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet" ,
377
+ isInternal : true ,
378
+ useStandardLB : false ,
379
+ expected : "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnnggggggggggg" ,
380
380
},
381
381
{
382
- description : "external standard lb should not have subnet name on the frontend ip configuration name" ,
383
- subnetName : "shortsubnet" ,
384
- isInternal : false ,
385
- useStandardLB : true ,
386
- expected : "a257b965551374ad2b091ef3f07043ad" ,
382
+ description : "external standard lb should not have subnet name on the frontend ip configuration name" ,
383
+ subnetName : "shortsubnet" ,
384
+ isInternal : false ,
385
+ useStandardLB : true ,
386
+ expected : "a257b965551374ad2b091ef3f07043ad" ,
387
387
},
388
388
{
389
- description : "external basic lb should not have subnet name on the frontend ip configuration name" ,
390
- subnetName : "shortsubnet" ,
391
- isInternal : false ,
392
- useStandardLB : false ,
393
- expected : "a257b965551374ad2b091ef3f07043ad" ,
389
+ description : "external basic lb should not have subnet name on the frontend ip configuration name" ,
390
+ subnetName : "shortsubnet" ,
391
+ isInternal : false ,
392
+ useStandardLB : false ,
393
+ expected : "a257b965551374ad2b091ef3f07043ad" ,
394
394
},
395
395
}
396
396
0 commit comments