mirror of
https://github.com/safing/portmaster
synced 2025-09-01 10:09:11 +00:00
Fix tests
This commit is contained in:
parent
efdc0b7849
commit
81fb67bb48
4 changed files with 12 additions and 7 deletions
|
@ -379,12 +379,11 @@ func TestEndpointMatching(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
testEndpointMatch(t, ep, (&intel.Entity{
|
entity = &intel.Entity{}
|
||||||
IP: net.ParseIP("192.168.0.1"),
|
entity.SetIP(net.ParseIP("192.168.0.1"))
|
||||||
}).Init(), Permitted)
|
testEndpointMatch(t, ep, entity, Permitted)
|
||||||
testEndpointMatch(t, ep, (&intel.Entity{
|
entity.SetIP(net.ParseIP("151.101.1.164")) // nytimes.com
|
||||||
IP: net.ParseIP("151.101.1.164"), // nytimes.com
|
testEndpointMatch(t, ep, entity, NoMatch)
|
||||||
}).Init(), NoMatch)
|
|
||||||
|
|
||||||
// Lists
|
// Lists
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@ func TestNameRecordStorage(t *testing.T) {
|
||||||
testNameRecord := &NameRecord{
|
testNameRecord := &NameRecord{
|
||||||
Domain: testDomain,
|
Domain: testDomain,
|
||||||
Question: testQuestion,
|
Question: testQuestion,
|
||||||
|
Resolver: &ResolverInfo{
|
||||||
|
Type: "dns",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := testNameRecord.Save()
|
err := testNameRecord.Save()
|
||||||
|
|
|
@ -33,5 +33,5 @@ func TestResolveIPAndValidate(t *testing.T) {
|
||||||
testReverse(t, "2606:4700:4700::1111", "one.one.one.one.", "")
|
testReverse(t, "2606:4700:4700::1111", "one.one.one.one.", "")
|
||||||
|
|
||||||
testReverse(t, "93.184.216.34", "example.com.", "record could not be found: 34.216.184.93.in-addr.arpa.PTR")
|
testReverse(t, "93.184.216.34", "example.com.", "record could not be found: 34.216.184.93.in-addr.arpa.PTR")
|
||||||
testReverse(t, "185.199.109.153", "sites.github.io.", "record could not be found: 153.109.199.185.in-addr.arpa.PTR")
|
testReverse(t, "185.199.109.153", "cdn-185-199-109-153.github.com.", "record could not be found: 153.109.199.185.in-addr.arpa.PTR")
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,9 @@ func TestCaching(t *testing.T) {
|
||||||
testNameRecord := &NameRecord{
|
testNameRecord := &NameRecord{
|
||||||
Domain: testDomain,
|
Domain: testDomain,
|
||||||
Question: testQuestion,
|
Question: testQuestion,
|
||||||
|
Resolver: &ResolverInfo{
|
||||||
|
Type: "dns",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := testNameRecord.Save()
|
err := testNameRecord.Save()
|
||||||
|
|
Loading…
Add table
Reference in a new issue