mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Merge pull request #54035 from xiangpengzhao/combine-e2e-test
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Combine downward api e2e test cases. **What this PR does / why we need it**: This will reduce one loop of create/delete pod. Hope it can save some test time. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
28e45f2895
3
test/conformance/testdata/conformance.txt
vendored
3
test/conformance/testdata/conformance.txt
vendored
@ -26,8 +26,7 @@ test/e2e/common/docker_containers.go: "should use the image defaults if command
|
||||
test/e2e/common/docker_containers.go: "should be able to override the image's default arguments (docker cmd) "
|
||||
test/e2e/common/docker_containers.go: "should be able to override the image's default commmand (docker entrypoint) "
|
||||
test/e2e/common/docker_containers.go: "should be able to override the image's default command and arguments "
|
||||
test/e2e/common/downward_api.go: "should provide pod name and namespace as env vars "
|
||||
test/e2e/common/downward_api.go: "should provide pod IP as an env var "
|
||||
test/e2e/common/downward_api.go: "should provide pod name, namespace and IP address as env vars "
|
||||
test/e2e/common/downward_api.go: "should provide host IP as an env var "
|
||||
test/e2e/common/downward_api.go: "should provide container's limits.cpu/memory and requests.cpu/memory as env vars "
|
||||
test/e2e/common/downward_api.go: "should provide default limits.cpu/memory from node allocatable "
|
||||
|
@ -38,11 +38,11 @@ var _ = Describe("[sig-api-machinery] Downward API", func() {
|
||||
f := framework.NewDefaultFramework("downward-api")
|
||||
|
||||
/*
|
||||
Testname: downwardapi-env-name-namespace
|
||||
Description: Ensure that downward API can provide pod's name and
|
||||
namespaces as environment variables.
|
||||
Testname: downwardapi-env-name-namespace-podip
|
||||
Description: Ensure that downward API can provide pod's name, namespace
|
||||
and IP address as environment variables.
|
||||
*/
|
||||
framework.ConformanceIt("should provide pod name and namespace as env vars ", func() {
|
||||
framework.ConformanceIt("should provide pod name, namespace and IP address as env vars ", func() {
|
||||
podName := "downward-api-" + string(uuid.NewUUID())
|
||||
env := []v1.EnvVar{
|
||||
{
|
||||
@ -63,24 +63,6 @@ var _ = Describe("[sig-api-machinery] Downward API", func() {
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
expectations := []string{
|
||||
fmt.Sprintf("POD_NAME=%v", podName),
|
||||
fmt.Sprintf("POD_NAMESPACE=%v", f.Namespace.Name),
|
||||
}
|
||||
|
||||
testDownwardAPI(f, podName, env, expectations)
|
||||
})
|
||||
|
||||
/*
|
||||
Testname: downwardapi-env-pod-ip
|
||||
Description: Ensure that downward API can provide an IP address for
|
||||
pod as an environment variable.
|
||||
*/
|
||||
framework.ConformanceIt("should provide pod IP as an env var ", func() {
|
||||
podName := "downward-api-" + string(uuid.NewUUID())
|
||||
env := []v1.EnvVar{
|
||||
{
|
||||
Name: "POD_IP",
|
||||
ValueFrom: &v1.EnvVarSource{
|
||||
@ -93,6 +75,8 @@ var _ = Describe("[sig-api-machinery] Downward API", func() {
|
||||
}
|
||||
|
||||
expectations := []string{
|
||||
fmt.Sprintf("POD_NAME=%v", podName),
|
||||
fmt.Sprintf("POD_NAMESPACE=%v", f.Namespace.Name),
|
||||
"POD_IP=(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)",
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user