diff --git a/test/e2e/framework/deployment_util.go b/test/e2e/framework/deployment_util.go index 62162432816..2a48e68e628 100644 --- a/test/e2e/framework/deployment_util.go +++ b/test/e2e/framework/deployment_util.go @@ -232,7 +232,7 @@ func CreateDeployment(client clientset.Interface, replicas int32, podLabels map[ // name. A slice of BASH commands can be supplied as args to be run by the pod func MakeDeployment(replicas int32, podLabels map[string]string, nodeSelector map[string]string, namespace string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) *apps.Deployment { if len(command) == 0 { - command = "while true; do sleep 1; done" + command = "trap exit TERM; while true; do sleep 1; done" } zero := int64(0) deploymentName := "deployment-" + string(uuid.NewUUID()) diff --git a/test/e2e/framework/pv_util.go b/test/e2e/framework/pv_util.go index 1952d8d8157..131806ad4ee 100644 --- a/test/e2e/framework/pv_util.go +++ b/test/e2e/framework/pv_util.go @@ -815,7 +815,7 @@ func MakeWritePod(ns string, pvc *v1.PersistentVolumeClaim) *v1.Pod { // name. A slice of BASH commands can be supplied as args to be run by the pod func MakePod(ns string, nodeSelector map[string]string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string) *v1.Pod { if len(command) == 0 { - command = "while true; do sleep 1; done" + command = "trap exit TERM; while true; do sleep 1; done" } podSpec := &v1.Pod{ TypeMeta: metav1.TypeMeta{ @@ -902,7 +902,7 @@ func MakeNginxPod(ns string, nodeSelector map[string]string, pvclaims []*v1.Pers // SELinux testing requires to pass HostIPC and HostPID as booleansi arguments. func MakeSecPod(ns string, pvclaims []*v1.PersistentVolumeClaim, isPrivileged bool, command string, hostIPC bool, hostPID bool, seLinuxLabel *v1.SELinuxOptions, fsGroup *int64) *v1.Pod { if len(command) == 0 { - command = "while true; do sleep 1; done" + command = "trap exit TERM; while true; do sleep 1; done" } podName := "security-context-" + string(uuid.NewUUID()) if fsGroup == nil { diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 4373d970701..618a1c6520a 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -3474,7 +3474,7 @@ func newExecPodSpec(ns, generateName string) *v1.Pod { { Name: "exec", Image: BusyBoxImage, - Command: []string{"sh", "-c", "while true; do sleep 5; done"}, + Command: []string{"sh", "-c", "trap exit TERM; while true; do sleep 5; done"}, }, }, },