mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
e2e: use framework.ExpectEqual() for test/e2e/node
This commit is contained in:
parent
f978c4cab5
commit
03e4527a87
@ -30,7 +30,6 @@ import (
|
||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
"github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = SIGDescribe("Events", func() {
|
||||
@ -83,7 +82,7 @@ var _ = SIGDescribe("Events", func() {
|
||||
selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value}))
|
||||
options := metav1.ListOptions{LabelSelector: selector.String()}
|
||||
pods, err := podClient.List(options)
|
||||
gomega.Expect(len(pods.Items)).To(gomega.Equal(1))
|
||||
framework.ExpectEqual(len(pods.Items), 1)
|
||||
|
||||
ginkgo.By("retrieving the pod")
|
||||
podWithUID, err := podClient.Get(pod.Name, metav1.GetOptions{})
|
||||
|
@ -172,7 +172,7 @@ var _ = SIGDescribe("Mount propagation", func() {
|
||||
shouldBeVisible := mounts.Has(mountName)
|
||||
if shouldBeVisible {
|
||||
framework.ExpectNoError(err, "%s: failed to run %q", msg, cmd)
|
||||
gomega.Expect(stdout).To(gomega.Equal(mountName), msg)
|
||||
framework.ExpectEqual(stdout, mountName, msg)
|
||||
} else {
|
||||
// We *expect* cat to return error here
|
||||
framework.ExpectError(err, msg)
|
||||
|
@ -67,7 +67,7 @@ var _ = SIGDescribe("NodeProblemDetector [DisabledForLargeClusters]", func() {
|
||||
}
|
||||
}
|
||||
}
|
||||
gomega.Expect(len(hosts)).To(gomega.Equal(len(nodes.Items)))
|
||||
framework.ExpectEqual(len(hosts), len(nodes.Items))
|
||||
|
||||
isStandaloneMode := make(map[string]bool)
|
||||
cpuUsageStats := make(map[string][]float64)
|
||||
|
@ -80,7 +80,7 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
options := metav1.ListOptions{LabelSelector: selector.String()}
|
||||
pods, err := podClient.List(options)
|
||||
framework.ExpectNoError(err, "failed to query for pod")
|
||||
gomega.Expect(len(pods.Items)).To(gomega.Equal(0))
|
||||
framework.ExpectEqual(len(pods.Items), 0)
|
||||
options = metav1.ListOptions{
|
||||
LabelSelector: selector.String(),
|
||||
ResourceVersion: pods.ListMeta.ResourceVersion,
|
||||
@ -94,7 +94,7 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
options = metav1.ListOptions{LabelSelector: selector.String()}
|
||||
pods, err = podClient.List(options)
|
||||
framework.ExpectNoError(err, "failed to query for pod")
|
||||
gomega.Expect(len(pods.Items)).To(gomega.Equal(1))
|
||||
framework.ExpectEqual(len(pods.Items), 1)
|
||||
|
||||
// We need to wait for the pod to be running, otherwise the deletion
|
||||
// may be carried out immediately rather than gracefully.
|
||||
@ -117,7 +117,7 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
output := string(buf[:n])
|
||||
proxyRegexp := regexp.MustCompile("Starting to serve on 127.0.0.1:([0-9]+)")
|
||||
match := proxyRegexp.FindStringSubmatch(output)
|
||||
gomega.Expect(len(match)).To(gomega.Equal(2))
|
||||
framework.ExpectEqual(len(match), 2)
|
||||
port, err := strconv.Atoi(match[1])
|
||||
framework.ExpectNoError(err, "failed to convert port into string")
|
||||
|
||||
@ -169,7 +169,7 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
options = metav1.ListOptions{LabelSelector: selector.String()}
|
||||
pods, err = podClient.List(options)
|
||||
framework.ExpectNoError(err, "failed to query for pods")
|
||||
gomega.Expect(len(pods.Items)).To(gomega.Equal(0))
|
||||
framework.ExpectEqual(len(pods.Items), 0)
|
||||
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user