mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #70242 from bclau/fixes-dns-false-positives
tests: Fixes DNS tests false positives
This commit is contained in:
commit
f9c744acb8
@ -457,10 +457,10 @@ func createProbeCommand(namesToResolve []string, hostEntries []string, ptrLookup
|
|||||||
}
|
}
|
||||||
fileName := fmt.Sprintf("%s_udp@%s", fileNamePrefix, name)
|
fileName := fmt.Sprintf("%s_udp@%s", fileNamePrefix, name)
|
||||||
fileNames = append(fileNames, fileName)
|
fileNames = append(fileNames, fileName)
|
||||||
probeCmd += fmt.Sprintf(`test -n "$$(dig +notcp +noall +answer +search %s %s)" && echo OK > /results/%s;`, name, lookup, fileName)
|
probeCmd += fmt.Sprintf(`check="$$(dig +notcp +noall +answer +search %s %s)" && test -n "$$check" && echo OK > /results/%s;`, name, lookup, fileName)
|
||||||
fileName = fmt.Sprintf("%s_tcp@%s", fileNamePrefix, name)
|
fileName = fmt.Sprintf("%s_tcp@%s", fileNamePrefix, name)
|
||||||
fileNames = append(fileNames, fileName)
|
fileNames = append(fileNames, fileName)
|
||||||
probeCmd += fmt.Sprintf(`test -n "$$(dig +tcp +noall +answer +search %s %s)" && echo OK > /results/%s;`, name, lookup, fileName)
|
probeCmd += fmt.Sprintf(`check="$$(dig +tcp +noall +answer +search %s %s)" && test -n "$$check" && echo OK > /results/%s;`, name, lookup, fileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, name := range hostEntries {
|
for _, name := range hostEntries {
|
||||||
@ -472,8 +472,8 @@ func createProbeCommand(namesToResolve []string, hostEntries []string, ptrLookup
|
|||||||
podARecByUDPFileName := fmt.Sprintf("%s_udp@PodARecord", fileNamePrefix)
|
podARecByUDPFileName := fmt.Sprintf("%s_udp@PodARecord", fileNamePrefix)
|
||||||
podARecByTCPFileName := fmt.Sprintf("%s_tcp@PodARecord", fileNamePrefix)
|
podARecByTCPFileName := fmt.Sprintf("%s_tcp@PodARecord", fileNamePrefix)
|
||||||
probeCmd += fmt.Sprintf(`podARec=$$(hostname -i| awk -F. '{print $$1"-"$$2"-"$$3"-"$$4".%s.pod.cluster.local"}');`, namespace)
|
probeCmd += fmt.Sprintf(`podARec=$$(hostname -i| awk -F. '{print $$1"-"$$2"-"$$3"-"$$4".%s.pod.cluster.local"}');`, namespace)
|
||||||
probeCmd += fmt.Sprintf(`test -n "$$(dig +notcp +noall +answer +search $${podARec} A)" && echo OK > /results/%s;`, podARecByUDPFileName)
|
probeCmd += fmt.Sprintf(`check="$$(dig +notcp +noall +answer +search $${podARec} A)" && test -n "$$check" && echo OK > /results/%s;`, podARecByUDPFileName)
|
||||||
probeCmd += fmt.Sprintf(`test -n "$$(dig +tcp +noall +answer +search $${podARec} A)" && echo OK > /results/%s;`, podARecByTCPFileName)
|
probeCmd += fmt.Sprintf(`check="$$(dig +tcp +noall +answer +search $${podARec} A)" && test -n "$$check" && echo OK > /results/%s;`, podARecByTCPFileName)
|
||||||
fileNames = append(fileNames, podARecByUDPFileName)
|
fileNames = append(fileNames, podARecByUDPFileName)
|
||||||
fileNames = append(fileNames, podARecByTCPFileName)
|
fileNames = append(fileNames, podARecByTCPFileName)
|
||||||
|
|
||||||
@ -481,8 +481,8 @@ func createProbeCommand(namesToResolve []string, hostEntries []string, ptrLookup
|
|||||||
ptrLookup := fmt.Sprintf("%s.in-addr.arpa.", strings.Join(reverseArray(strings.Split(ptrLookupIP, ".")), "."))
|
ptrLookup := fmt.Sprintf("%s.in-addr.arpa.", strings.Join(reverseArray(strings.Split(ptrLookupIP, ".")), "."))
|
||||||
ptrRecByUDPFileName := fmt.Sprintf("%s_udp@PTR", ptrLookupIP)
|
ptrRecByUDPFileName := fmt.Sprintf("%s_udp@PTR", ptrLookupIP)
|
||||||
ptrRecByTCPFileName := fmt.Sprintf("%s_tcp@PTR", ptrLookupIP)
|
ptrRecByTCPFileName := fmt.Sprintf("%s_tcp@PTR", ptrLookupIP)
|
||||||
probeCmd += fmt.Sprintf(`test -n "$$(dig +notcp +noall +answer +search %s PTR)" && echo OK > /results/%s;`, ptrLookup, ptrRecByUDPFileName)
|
probeCmd += fmt.Sprintf(`check="$$(dig +notcp +noall +answer +search %s PTR)" && test -n "$$check" && echo OK > /results/%s;`, ptrLookup, ptrRecByUDPFileName)
|
||||||
probeCmd += fmt.Sprintf(`test -n "$$(dig +tcp +noall +answer +search %s PTR)" && echo OK > /results/%s;`, ptrLookup, ptrRecByTCPFileName)
|
probeCmd += fmt.Sprintf(`check="$$(dig +tcp +noall +answer +search %s PTR)" && test -n "$$check" && echo OK > /results/%s;`, ptrLookup, ptrRecByTCPFileName)
|
||||||
fileNames = append(fileNames, ptrRecByUDPFileName)
|
fileNames = append(fileNames, ptrRecByUDPFileName)
|
||||||
fileNames = append(fileNames, ptrRecByTCPFileName)
|
fileNames = append(fileNames, ptrRecByTCPFileName)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user