mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
24 lines
529 B
Go
24 lines
529 B
Go
package cli
|
|
|
|
import (
|
|
"reflect"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func Test_getDNSBySystemdResolvedFromReader(t *testing.T) {
|
|
r := strings.NewReader(`Link 2 (eth0)
|
|
Current Scopes: DNS
|
|
LLMNR setting: yes
|
|
MulticastDNS setting: no
|
|
DNSSEC setting: no
|
|
DNSSEC supported: no
|
|
DNS Servers: 8.8.8.8
|
|
8.8.4.4`)
|
|
want := []string{"8.8.8.8", "8.8.4.4"}
|
|
ns := getDNSBySystemdResolvedFromReader(r)
|
|
if !reflect.DeepEqual(ns, want) {
|
|
t.Logf("unexpected result, want: %v, got: %v", want, ns)
|
|
}
|
|
}
|