mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Add e2e tests for events command (#111855)
* Add e2e tests for events command * Run events tests as normal e2e instead conformance Conformance tests are only for GA features. Since `kubectl events` currently is in alpha stage, e2e tests for this command should be run as standard e2e.
This commit is contained in:
parent
cac53883f4
commit
0303535506
@ -1939,6 +1939,34 @@ metadata:
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Describe("Kubectl events", func() {
|
||||
ginkgo.It("should show event when pod is created ", func() {
|
||||
podName := "e2e-test-httpd-pod"
|
||||
ginkgo.By("running the image " + httpdImage)
|
||||
framework.RunKubectlOrDie(ns, "run", podName, "--image="+httpdImage, podRunningTimeoutArg, "--labels=run="+podName)
|
||||
|
||||
ginkgo.By("verifying the pod " + podName + " is running")
|
||||
label := labels.SelectorFromSet(map[string]string{"run": podName})
|
||||
err := testutils.WaitForPodsWithLabelRunning(c, ns, label)
|
||||
if err != nil {
|
||||
framework.Failf("Failed getting pod %s: %v", podName, err)
|
||||
}
|
||||
|
||||
ginkgo.By("show started event for this pod")
|
||||
events := framework.RunKubectlOrDie(ns, "alpha", "events", "--for=pod/"+podName)
|
||||
|
||||
if !strings.Contains(events, fmt.Sprintf("Normal Scheduled Pod/%s", podName)) {
|
||||
framework.Failf("failed to list expected event")
|
||||
}
|
||||
|
||||
ginkgo.By("expect not showing any WARNING message")
|
||||
events = framework.RunKubectlOrDie(ns, "alpha", "events", "--types=WARNING", "--for=pod/"+podName)
|
||||
if events != "" {
|
||||
framework.Failf("unexpected WARNING event fired")
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.Describe("Kubectl create quota", func() {
|
||||
ginkgo.It("should create a quota without scopes", func() {
|
||||
quotaName := "million"
|
||||
|
Loading…
Reference in New Issue
Block a user