Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lahabana committed Sep 13, 2021
1 parent 21c2d8d commit 19bbd74
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions app/kuma-dp/pkg/dataplane/dnsserver/dnsserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ var _ = Describe("DNS Server", func() {
// and
Expect(string(actual)).To(Equal(`.:16001 {
forward . 127.0.0.1:16002
# We want all requests to be sent to the Envoy DNS Filter, unsuccessful responses should be forwarded to the original DNS server.
# For example: requests other than A, AAAA and SRV will return NOTIMP when hitting the envoy filter and should be sent to the original DNS server.
# Codes from: https://github.com/miekg/dns/blob/master/msg.go#L138
alternate NOTIMP,FORMERR,NXDOMAIN,SERVFAIL,REFUSED . /etc/resolv.conf
prometheus localhost:16003
errors
Expand Down
16 changes: 12 additions & 4 deletions app/kuma-dp/pkg/dataplane/envoy/envoy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -116,10 +117,17 @@ var _ = Describe("Envoy", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(strings.TrimSpace(buf.String())).To(Equal(
fmt.Sprintf("--config-path %s --drain-time-s 15 --disable-hot-restart --log-level off --bootstrap-version 2 --cpuset-threads",
expectedConfigFile)),
)
if runtime.GOOS == "linux" {
Expect(strings.TrimSpace(buf.String())).To(Equal(
fmt.Sprintf("--config-path %s --drain-time-s 15 --disable-hot-restart --log-level off --bootstrap-version 2 --cpuset-threads",
expectedConfigFile)),
)
} else {
Expect(strings.TrimSpace(buf.String())).To(Equal(
fmt.Sprintf("--config-path %s --drain-time-s 15 --disable-hot-restart --log-level off --bootstrap-version 2",
expectedConfigFile)),
)
}

By("verifying the contents Envoy config file")
// when
Expand Down
2 changes: 1 addition & 1 deletion pkg/xds/cache/cla/testdata/cla.get.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion pkg/xds/cache/cla/testdata/cla.get.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
]
}
]
}
}

0 comments on commit 19bbd74

Please sign in to comment.