Skip to content

Commit 06912be

Browse files
committed
chore: replace all domains used in tests via .invalid TLD
1 parent 8ca8ebe commit 06912be

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

internal/designate/provider/provider_test.go

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -272,50 +272,50 @@ func TestDesignateRecords(t *testing.T) {
272272
ctx := context.TODO()
273273

274274
zone1ID := client.AddZone(ctx, zones.Zone{
275-
Name: "example.com.",
275+
Name: "example.invalid.",
276276
Type: "PRIMARY",
277277
Status: "ACTIVE",
278278
})
279279
rs11ID, _ := client.CreateRecordSet(ctx, zone1ID, recordsets.CreateOpts{
280-
Name: "www.example.com.",
280+
Name: "www.example.invalid.",
281281
Type: endpoint.RecordTypeA,
282282
Records: []string{"10.1.1.1"},
283283
})
284284
rs12ID, _ := client.CreateRecordSet(ctx, zone1ID, recordsets.CreateOpts{
285-
Name: "www.example.com.",
285+
Name: "www.example.invalid.",
286286
Type: endpoint.RecordTypeTXT,
287287
Records: []string{"text1"},
288288
})
289289
client.CreateRecordSet(ctx, zone1ID, recordsets.CreateOpts{
290-
Name: "xxx.example.com.",
290+
Name: "xxx.example.invalid.",
291291
Type: "SRV",
292292
Records: []string{"http://test.com:1234"},
293293
})
294294
rs14ID, _ := client.CreateRecordSet(ctx, zone1ID, recordsets.CreateOpts{
295-
Name: "ftp.example.com.",
295+
Name: "ftp.example.invalid.",
296296
Type: endpoint.RecordTypeA,
297297
TTL: 120,
298298
Records: []string{"10.1.1.2"},
299299
})
300300

301301
zone2ID := client.AddZone(ctx, zones.Zone{
302-
Name: "test.net.",
302+
Name: "anotherzone.invalid.",
303303
Type: "PRIMARY",
304304
Status: "ACTIVE",
305305
})
306306
rs21ID, _ := client.CreateRecordSet(ctx, zone2ID, recordsets.CreateOpts{
307-
Name: "srv.test.net.",
307+
Name: "srv.anotherzone.invalid.",
308308
Type: endpoint.RecordTypeA,
309309
Records: []string{"10.2.1.1", "10.2.1.2"},
310310
})
311311
rs22ID, _ := client.CreateRecordSet(ctx, zone2ID, recordsets.CreateOpts{
312-
Name: "db.test.net.",
312+
Name: "db.anotherzone.invalid.",
313313
Type: endpoint.RecordTypeCNAME,
314-
Records: []string{"sql.test.net."},
314+
Records: []string{"sql.anotherzone.invalid."},
315315
})
316316
expected := []*endpoint.Endpoint{
317317
{
318-
DNSName: "www.example.com",
318+
DNSName: "www.example.invalid",
319319
RecordType: endpoint.RecordTypeA,
320320
Targets: endpoint.Targets{"10.1.1.1"},
321321
Labels: map[string]string{
@@ -325,7 +325,7 @@ func TestDesignateRecords(t *testing.T) {
325325
},
326326
},
327327
{
328-
DNSName: "www.example.com",
328+
DNSName: "www.example.invalid",
329329
RecordType: endpoint.RecordTypeTXT,
330330
Targets: endpoint.Targets{"text1"},
331331
Labels: map[string]string{
@@ -335,7 +335,7 @@ func TestDesignateRecords(t *testing.T) {
335335
},
336336
},
337337
{
338-
DNSName: "ftp.example.com",
338+
DNSName: "ftp.example.invalid",
339339
RecordType: endpoint.RecordTypeA,
340340
Targets: endpoint.Targets{"10.1.1.2"},
341341
RecordTTL: 120,
@@ -346,7 +346,7 @@ func TestDesignateRecords(t *testing.T) {
346346
},
347347
},
348348
{
349-
DNSName: "srv.test.net",
349+
DNSName: "srv.anotherzone.invalid.",
350350
RecordType: endpoint.RecordTypeA,
351351
Targets: endpoint.Targets{"10.2.1.1", "10.2.1.2"},
352352
Labels: map[string]string{
@@ -356,13 +356,13 @@ func TestDesignateRecords(t *testing.T) {
356356
},
357357
},
358358
{
359-
DNSName: "db.test.net",
359+
DNSName: "db.anotherzone.invalid.",
360360
RecordType: endpoint.RecordTypeCNAME,
361-
Targets: endpoint.Targets{"sql.test.net"},
361+
Targets: endpoint.Targets{"sql.anotherzone.invalid."},
362362
Labels: map[string]string{
363363
designateRecordSetID: rs22ID,
364364
designateZoneID: zone2ID,
365-
designateOriginalRecords: "sql.test.net.",
365+
designateOriginalRecords: "sql.anotherzone.invalid.",
366366
},
367367
},
368368
}
@@ -393,7 +393,7 @@ func TestDesignateCreateRecords(t *testing.T) {
393393

394394
func testDesignateCreateRecords(t *testing.T, client *fakeDesignateClient) []*recordsets.RecordSet {
395395
ctx := context.TODO()
396-
for i, zoneName := range []string{"example.com.", "test.net."} {
396+
for i, zoneName := range []string{"example.invalid.", "anotherzone.invalid."} {
397397
client.AddZone(ctx, zones.Zone{
398398
ID: fmt.Sprintf("zone-%d", i+1),
399399
Name: zoneName,
@@ -403,7 +403,7 @@ func testDesignateCreateRecords(t *testing.T, client *fakeDesignateClient) []*re
403403
}
404404

405405
_, err := client.CreateRecordSet(ctx, "zone-1", recordsets.CreateOpts{
406-
Name: "www.example.com.",
406+
Name: "www.example.invalid.",
407407
Description: "",
408408
Records: []string{"foo"},
409409
TTL: 60,
@@ -416,73 +416,73 @@ func testDesignateCreateRecords(t *testing.T, client *fakeDesignateClient) []*re
416416

417417
endpoints := []*endpoint.Endpoint{
418418
{
419-
DNSName: "www.example.com",
419+
DNSName: "www.example.invalid",
420420
RecordType: endpoint.RecordTypeA,
421421
Targets: endpoint.Targets{"10.1.1.1"},
422422
Labels: map[string]string{},
423423
},
424424
{
425-
DNSName: "www.example.com",
425+
DNSName: "www.example.invalid",
426426
RecordType: endpoint.RecordTypeTXT,
427427
Targets: endpoint.Targets{"text1"},
428428
Labels: map[string]string{},
429429
},
430430
{
431-
DNSName: "ftp.example.com",
431+
DNSName: "ftp.example.invalid",
432432
RecordType: endpoint.RecordTypeA,
433433
Targets: endpoint.Targets{"10.1.1.2"},
434434
RecordTTL: 120,
435435
Labels: map[string]string{},
436436
},
437437
{
438-
DNSName: "srv.test.net",
438+
DNSName: "srv.anotherzone.invalid.",
439439
RecordType: endpoint.RecordTypeA,
440440
Targets: endpoint.Targets{"10.2.1.1"},
441441
Labels: map[string]string{},
442442
},
443443
{
444-
DNSName: "srv.test.net",
444+
DNSName: "srv.anotherzone.invalid.",
445445
RecordType: endpoint.RecordTypeA,
446446
Targets: endpoint.Targets{"10.2.1.2"},
447447
Labels: map[string]string{},
448448
},
449449
{
450-
DNSName: "db.test.net",
450+
DNSName: "db.anotherzone.invalid.",
451451
RecordType: endpoint.RecordTypeCNAME,
452-
Targets: endpoint.Targets{"sql.test.net"},
452+
Targets: endpoint.Targets{"sql.anotherzone.invalid."},
453453
Labels: map[string]string{},
454454
},
455455
}
456456
expected := []*recordsets.RecordSet{
457457
{
458-
Name: "www.example.com.",
458+
Name: "www.example.invalid.",
459459
Type: endpoint.RecordTypeA,
460460
Records: []string{"10.1.1.1"},
461461
ZoneID: "zone-1",
462462
},
463463
{
464-
Name: "www.example.com.",
464+
Name: "www.example.invalid.",
465465
Type: endpoint.RecordTypeTXT,
466466
Records: []string{"text1"},
467467
ZoneID: "zone-1",
468468
},
469469
{
470-
Name: "ftp.example.com.",
470+
Name: "ftp.example.invalid.",
471471
Type: endpoint.RecordTypeA,
472472
Records: []string{"10.1.1.2"},
473473
TTL: 120,
474474
ZoneID: "zone-1",
475475
},
476476
{
477-
Name: "srv.test.net.",
477+
Name: "srv.anotherzone.invalid.",
478478
Type: endpoint.RecordTypeA,
479479
Records: []string{"10.2.1.1", "10.2.1.2"},
480480
ZoneID: "zone-2",
481481
},
482482
{
483-
Name: "db.test.net.",
483+
Name: "db.anotherzone.invalid.",
484484
Type: endpoint.RecordTypeCNAME,
485-
Records: []string{"sql.test.net."},
485+
Records: []string{"sql.anotherzone.invalid."},
486486
ZoneID: "zone-2",
487487
},
488488
}
@@ -530,7 +530,7 @@ func testDesignateUpdateRecords(t *testing.T, client *fakeDesignateClient) []*re
530530

531531
updatesOld := []*endpoint.Endpoint{
532532
{
533-
DNSName: "ftp.example.com",
533+
DNSName: "ftp.example.invalid",
534534
RecordType: endpoint.RecordTypeA,
535535
Targets: endpoint.Targets{"10.1.1.2"},
536536
RecordTTL: 120,
@@ -541,7 +541,7 @@ func testDesignateUpdateRecords(t *testing.T, client *fakeDesignateClient) []*re
541541
},
542542
},
543543
{
544-
DNSName: "srv.test.net.",
544+
DNSName: "srv.anotherzone.invalid.",
545545
RecordType: endpoint.RecordTypeA,
546546
Targets: endpoint.Targets{"10.2.1.2"},
547547
Labels: map[string]string{
@@ -553,7 +553,7 @@ func testDesignateUpdateRecords(t *testing.T, client *fakeDesignateClient) []*re
553553
}
554554
updatesNew := []*endpoint.Endpoint{
555555
{
556-
DNSName: "ftp.example.com",
556+
DNSName: "ftp.example.invalid",
557557
RecordType: endpoint.RecordTypeA,
558558
Targets: endpoint.Targets{"10.3.3.1"},
559559
RecordTTL: 60,
@@ -564,7 +564,7 @@ func testDesignateUpdateRecords(t *testing.T, client *fakeDesignateClient) []*re
564564
},
565565
},
566566
{
567-
DNSName: "srv.test.net.",
567+
DNSName: "srv.anotherzone.invalid.",
568568
RecordType: endpoint.RecordTypeA,
569569
Targets: endpoint.Targets{"10.3.3.2"},
570570
Labels: map[string]string{
@@ -618,7 +618,7 @@ func testDesignateDeleteRecords(t *testing.T, client *fakeDesignateClient) {
618618

619619
deletes := []*endpoint.Endpoint{
620620
{
621-
DNSName: "www.example.com.",
621+
DNSName: "www.example.invalid.",
622622
RecordType: endpoint.RecordTypeA,
623623
Targets: endpoint.Targets{"10.1.1.1"},
624624
Labels: map[string]string{
@@ -628,7 +628,7 @@ func testDesignateDeleteRecords(t *testing.T, client *fakeDesignateClient) {
628628
},
629629
},
630630
{
631-
DNSName: "srv.test.net.",
631+
DNSName: "srv.anotherzone.invalid.",
632632
RecordType: endpoint.RecordTypeA,
633633
Targets: endpoint.Targets{"10.2.1.1"},
634634
Labels: map[string]string{
@@ -676,38 +676,38 @@ func TestGetHostZoneID(t *testing.T) {
676676
{
677677
name: "no zone",
678678
zones: []string{},
679-
hostname: "example.com.",
679+
hostname: "example.invalid.",
680680
want: "",
681681
},
682682
{
683683
name: "one mismatched zone",
684684
zones: []string{"foo.com."},
685-
hostname: "example.com.",
685+
hostname: "example.invalid.",
686686
want: "",
687687
},
688688
{
689689
name: "one matching zone",
690-
zones: []string{"example.com."},
691-
hostname: "example.com.",
692-
want: "example.com.",
690+
zones: []string{"example.invalid."},
691+
hostname: "example.invalid.",
692+
want: "example.invalid.",
693693
},
694694
{
695695
name: "one matching zone, multiple mismatched ones",
696-
zones: []string{"example.com.", "foo.com.", "bar.com."},
697-
hostname: "example.com.",
698-
want: "example.com.",
696+
zones: []string{"example.invalid.", "foo.com.", "bar.com."},
697+
hostname: "example.invalid.",
698+
want: "example.invalid.",
699699
},
700700
{
701701
name: "should use longer of two matching zones",
702-
zones: []string{"example.com.", "test.example.com."},
703-
hostname: "foo.test.example.com.",
704-
want: "test.example.com.",
702+
zones: []string{"example.invalid.", "test.example.invalid."},
703+
hostname: "foo.test.example.invalid.",
704+
want: "test.example.invalid.",
705705
},
706706
{
707707
name: "should not match on suffix",
708-
zones: []string{"example.com.", "test.example.com."},
709-
hostname: "first-test.example.com.",
710-
want: "example.com.",
708+
zones: []string{"example.invalid.", "test.example.invalid."},
709+
hostname: "first-test.example.invalid.",
710+
want: "example.invalid.",
711711
},
712712
}
713713

0 commit comments

Comments
 (0)