Fix/dns initialization (#954)

The systemd HostManagers require valid, initialized network interface
This commit is contained in:
Zoltan Papp
2023-06-15 12:25:18 +02:00
committed by GitHub
parent 042f124702
commit f1b38dbe80
4 changed files with 37 additions and 25 deletions

View File

@@ -225,6 +225,10 @@ func TestUpdateDNSServer(t *testing.T) {
if err != nil {
t.Fatal(err)
}
err = dnsServer.Initialize()
if err != nil {
t.Fatal(err)
}
defer func() {
err = dnsServer.hostManager.restoreHostDNS()
if err != nil {
@@ -291,7 +295,7 @@ func TestDNSServerStartStop(t *testing.T) {
dnsServer := getDefaultServerWithNoHostManager(t, testCase.addrPort)
dnsServer.hostManager = newNoopHostMocker()
dnsServer.Start()
dnsServer.listen()
time.Sleep(100 * time.Millisecond)
if !dnsServer.listenerIsRunning {
t.Fatal("dns server listener is not running")