Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
records: unit test: ParseState supplies correct SOA mname
Browse files Browse the repository at this point in the history
  • Loading branch information
James DeFelice authored and jdef committed Jul 12, 2017
1 parent 53189bd commit a32855c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions records/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ func (rg *RecordGenerator) exists(name, host string, kind rrsKind) bool {
return false
}

func TestParseState_SOAMname(t *testing.T) {
rg := &RecordGenerator{}
rg.stateLoader = func(_ []string) (s state.State, err error) {
s.Leader = "foo@123:45" // required or else ParseState bails
return
}
err := rg.ParseState(Config{SOAMname: "jdef123.mesos.", Listener: "4.5.6.7"})
if err != nil {
t.Fatal("unexpected error", err)
}
if !rg.exists("jdef123.mesos.", "4.5.6.7", A) {
t.Fatalf("failed to locate A record for SOAMname, A records: %#v", rg.As)
}
}

func TestMasterRecord(t *testing.T) {
// masterRecord(domain string, masters []string, leader string)
type expectedRR struct {
Expand Down

0 comments on commit a32855c

Please sign in to comment.