Skip to content

Commit

Permalink
Add invalid addr dht bootstrap test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Warehime committed Sep 5, 2023
1 parent fa24be2 commit 9481a1f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions network/p2p/dht/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,23 @@ func TestGetBootstrapPeersFailure(t *testing.T) {
partitiontest.PartitionTest(t)

cfg := config.GetDefaultLocal()
cfg.DNSSecurityFlags = 0
cfg.DNSBootstrapID = "non-existent.algodev.network"

addrs := getBootstrapPeersFunc(cfg, "test")()

require.Equal(t, 0, len(addrs))
}

func TestGetBootstrapPeersInvalidAddr(t *testing.T) {
t.Parallel()
partitiontest.PartitionTest(t)

cfg := config.GetDefaultLocal()
cfg.DNSSecurityFlags = 0
cfg.DNSBootstrapID = "<network>.algodev.network"

addrs := getBootstrapPeersFunc(cfg, "testInvalidAddr")()

require.Equal(t, 0, len(addrs))
}

0 comments on commit 9481a1f

Please sign in to comment.