Skip to content

Commit 4bd1a7d

Browse files
committed
feat: add dns log statements
Signed-off-by: ehila <[email protected]>
1 parent a630342 commit 4bd1a7d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/e2e/upgrade/dns/dns.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,28 @@ func (t *UpgradeTest) validateDNSResults(f *framework.Framework) {
132132

133133
failureCount := 0.0
134134
successCount := 0.0
135+
totalLineCount := 0
135136
scan := bufio.NewScanner(r)
137+
var ipParseErrors []string
136138
for scan.Scan() {
137139
line := scan.Text()
140+
totalLineCount++
138141
if strings.Contains(line, "fail") {
139142
failureCount++
140143
} else if ip := net.ParseIP(line); ip != nil {
141144
successCount++
145+
} else {
146+
ipParseErrors = append(ipParseErrors, fmt.Sprintf("line (%s) was not parsable by net.ParseIP", line))
142147
}
143148
}
149+
if ipParseErrors != nil {
150+
ginkgo.By(fmt.Sprintf("Found IP Parse Errors %s", ipParseErrors))
151+
}
152+
framework.ExpectNoError(scan.Err())
153+
successRate := (successCount / (successCount + failureCount)) * 100
154+
ginkgo.By(fmt.Sprintf("SuccessRate: %f SuccessCount: %f, FailureCount: %f | TotalLineCount: %d", successRate, successCount, failureCount, totalLineCount))
144155

145-
if successRate := (successCount / (successCount + failureCount)) * 100; successRate < 99 {
156+
if successRate < 99 {
146157
err = fmt.Errorf("success rate is less than 99%% on the node %s: [%0.2f]", pod.Spec.NodeName, successRate)
147158
} else {
148159
err = nil

0 commit comments

Comments
 (0)