mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-18 21:11:50 +03:00
Pull request 1971: fix hosts windows
Merge in DNS/adguard-home from fix-hosts-windows to master Squashed commit of the following: commit 8e080ade8980f73006eb33de930749b91d203915 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Aug 22 17:49:23 2023 +0300 aghnet: fix src path
This commit is contained in:
parent
cb6d4620c5
commit
2bfc9fcb12
1 changed files with 25 additions and 22 deletions
|
@ -3,6 +3,7 @@ package aghnet_test
|
||||||
import (
|
import (
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"testing"
|
"testing"
|
||||||
"testing/fstest"
|
"testing/fstest"
|
||||||
|
@ -42,109 +43,111 @@ var (
|
||||||
addr13 = netip.MustParseAddr("::13")
|
addr13 = netip.MustParseAddr("::13")
|
||||||
addr31 = netip.MustParseAddr("::31")
|
addr31 = netip.MustParseAddr("::31")
|
||||||
|
|
||||||
|
hostsSrc = "./" + filepath.Join("./testdata", "etc_hosts")
|
||||||
|
|
||||||
testHosts = map[netip.Addr][]*hostsfile.Record{
|
testHosts = map[netip.Addr][]*hostsfile.Record{
|
||||||
addr1000: {{
|
addr1000: {{
|
||||||
Addr: addr1000,
|
Addr: addr1000,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"hello", "hello.world"},
|
Names: []string{"hello", "hello.world"},
|
||||||
}, {
|
}, {
|
||||||
Addr: addr1000,
|
Addr: addr1000,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"hello.world.again"},
|
Names: []string{"hello.world.again"},
|
||||||
}, {
|
}, {
|
||||||
Addr: addr1000,
|
Addr: addr1000,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"hello.world"},
|
Names: []string{"hello.world"},
|
||||||
}},
|
}},
|
||||||
addr1001: {{
|
addr1001: {{
|
||||||
Addr: addr1001,
|
Addr: addr1001,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"simplehost"},
|
Names: []string{"simplehost"},
|
||||||
}, {
|
}, {
|
||||||
Addr: addr1001,
|
Addr: addr1001,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"simplehost"},
|
Names: []string{"simplehost"},
|
||||||
}},
|
}},
|
||||||
addr1002: {{
|
addr1002: {{
|
||||||
Addr: addr1002,
|
Addr: addr1002,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"a.whole", "lot.of", "aliases", "for.testing"},
|
Names: []string{"a.whole", "lot.of", "aliases", "for.testing"},
|
||||||
}},
|
}},
|
||||||
addr1003: {{
|
addr1003: {{
|
||||||
Addr: addr1003,
|
Addr: addr1003,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"*"},
|
Names: []string{"*"},
|
||||||
}},
|
}},
|
||||||
addr1004: {{
|
addr1004: {{
|
||||||
Addr: addr1004,
|
Addr: addr1004,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"*.com"},
|
Names: []string{"*.com"},
|
||||||
}},
|
}},
|
||||||
addr1357: {{
|
addr1357: {{
|
||||||
Addr: addr1357,
|
Addr: addr1357,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"domain4", "domain4.alias"},
|
Names: []string{"domain4", "domain4.alias"},
|
||||||
}},
|
}},
|
||||||
addr7531: {{
|
addr7531: {{
|
||||||
Addr: addr7531,
|
Addr: addr7531,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"domain4.alias", "domain4"},
|
Names: []string{"domain4.alias", "domain4"},
|
||||||
}},
|
}},
|
||||||
addr4216: {{
|
addr4216: {{
|
||||||
Addr: addr4216,
|
Addr: addr4216,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"domain", "domain.alias"},
|
Names: []string{"domain", "domain.alias"},
|
||||||
}},
|
}},
|
||||||
addr0: {{
|
addr0: {{
|
||||||
Addr: addr0,
|
Addr: addr0,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"hello", "hello.world"},
|
Names: []string{"hello", "hello.world"},
|
||||||
}, {
|
}, {
|
||||||
Addr: addr0,
|
Addr: addr0,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"hello.world.again"},
|
Names: []string{"hello.world.again"},
|
||||||
}, {
|
}, {
|
||||||
Addr: addr0,
|
Addr: addr0,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"hello.world"},
|
Names: []string{"hello.world"},
|
||||||
}},
|
}},
|
||||||
addr1: {{
|
addr1: {{
|
||||||
Addr: addr1,
|
Addr: addr1,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"simplehost"},
|
Names: []string{"simplehost"},
|
||||||
}, {
|
}, {
|
||||||
Addr: addr1,
|
Addr: addr1,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"simplehost"},
|
Names: []string{"simplehost"},
|
||||||
}},
|
}},
|
||||||
addr2: {{
|
addr2: {{
|
||||||
Addr: addr2,
|
Addr: addr2,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"a.whole", "lot.of", "aliases", "for.testing"},
|
Names: []string{"a.whole", "lot.of", "aliases", "for.testing"},
|
||||||
}},
|
}},
|
||||||
addr3: {{
|
addr3: {{
|
||||||
Addr: addr3,
|
Addr: addr3,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"*"},
|
Names: []string{"*"},
|
||||||
}},
|
}},
|
||||||
addr4: {{
|
addr4: {{
|
||||||
Addr: addr4,
|
Addr: addr4,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"*.com"},
|
Names: []string{"*.com"},
|
||||||
}},
|
}},
|
||||||
addr42: {{
|
addr42: {{
|
||||||
Addr: addr42,
|
Addr: addr42,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"domain.alias", "domain"},
|
Names: []string{"domain.alias", "domain"},
|
||||||
}},
|
}},
|
||||||
addr13: {{
|
addr13: {{
|
||||||
Addr: addr13,
|
Addr: addr13,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"domain6", "domain6.alias"},
|
Names: []string{"domain6", "domain6.alias"},
|
||||||
}},
|
}},
|
||||||
addr31: {{
|
addr31: {{
|
||||||
Addr: addr31,
|
Addr: addr31,
|
||||||
Source: "./testdata/etc_hosts",
|
Source: hostsSrc,
|
||||||
Names: []string{"domain6.alias", "domain6"},
|
Names: []string{"domain6.alias", "domain6"},
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue