diff --git a/.ci/lib.sh b/.ci/lib.sh index b6b82bacd..0c6a508dd 100755 --- a/.ci/lib.sh +++ b/.ci/lib.sh @@ -16,6 +16,7 @@ export kata_repo="github.com/kata-containers/kata-containers" export kata_repo_dir="${GOPATH}/src/${kata_repo}" export ghprbTargetBranch=${ghprbTargetBranch:-} export kata_default_branch="${kata_default_branch:-$ghprbTargetBranch}" +export timeout="60s" # Name of systemd service for the throttler KATA_KSM_THROTTLER_JOB="kata-ksm-throttler" diff --git a/integration/kubernetes/k8s-attach-handlers.bats b/integration/kubernetes/k8s-attach-handlers.bats index 3dcfeb62b..c06ec339d 100644 --- a/integration/kubernetes/k8s-attach-handlers.bats +++ b/integration/kubernetes/k8s-attach-handlers.bats @@ -28,7 +28,7 @@ setup() { kubectl create -f "${pod_config_dir}/test-lifecycle-events.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name # Check postStart message display_message="cat /usr/share/message" diff --git a/integration/kubernetes/k8s-copy-file.bats b/integration/kubernetes/k8s-copy-file.bats index 837ac3c81..e47245034 100644 --- a/integration/kubernetes/k8s-copy-file.bats +++ b/integration/kubernetes/k8s-copy-file.bats @@ -31,7 +31,7 @@ setup() { kubectl create -f "${pod_config}" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name # Create a file echo "$content" > "$file_name" @@ -57,7 +57,7 @@ setup() { kubectl create -f "${pod_config}" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name kubectl logs "$pod_name" || true kubectl describe pod "$pod_name" || true diff --git a/integration/kubernetes/k8s-cpu-ns.bats b/integration/kubernetes/k8s-cpu-ns.bats index 8f0b58b4d..893a2e920 100644 --- a/integration/kubernetes/k8s-cpu-ns.bats +++ b/integration/kubernetes/k8s-cpu-ns.bats @@ -27,7 +27,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-cpu.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" retries="10" diff --git a/integration/kubernetes/k8s-custom-dns.bats b/integration/kubernetes/k8s-custom-dns.bats index afdeb52c9..77e620578 100644 --- a/integration/kubernetes/k8s-custom-dns.bats +++ b/integration/kubernetes/k8s-custom-dns.bats @@ -20,7 +20,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-custom-dns.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name # Check dns config at /etc/resolv.conf kubectl exec "$pod_name" -- cat "$file_name" | grep -q "nameserver 1.2.3.4" diff --git a/integration/kubernetes/k8s-empty-dirs.bats b/integration/kubernetes/k8s-empty-dirs.bats index 146b84b54..3074f283f 100644 --- a/integration/kubernetes/k8s-empty-dirs.bats +++ b/integration/kubernetes/k8s-empty-dirs.bats @@ -19,7 +19,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-empty-dir.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" # Check volume mounts cmd="mount | grep cache" diff --git a/integration/kubernetes/k8s-liveness-probes.bats b/integration/kubernetes/k8s-liveness-probes.bats index 9fca4fc89..bda3f8ca6 100644 --- a/integration/kubernetes/k8s-liveness-probes.bats +++ b/integration/kubernetes/k8s-liveness-probes.bats @@ -25,7 +25,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-liveness.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" # Check liveness probe returns a success code kubectl describe pod "$pod_name" | grep -E "Liveness|#success=1" @@ -43,7 +43,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-http-liveness.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" # Check liveness probe returns a success code kubectl describe pod "$pod_name" | grep -E "Liveness|#success=1" @@ -62,7 +62,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-tcp-liveness.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" # Check liveness probe returns a success code kubectl describe pod "$pod_name" | grep -E "Liveness|#success=1" diff --git a/integration/kubernetes/k8s-memory.bats b/integration/kubernetes/k8s-memory.bats index e6796117f..d61fc840b 100644 --- a/integration/kubernetes/k8s-memory.bats +++ b/integration/kubernetes/k8s-memory.bats @@ -43,7 +43,7 @@ setup() { kubectl create -f "${pod_config_dir}/test_within_memory.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" rm -f "${pod_config_dir}/test_within_memory.yaml" kubectl delete pod "$pod_name" diff --git a/integration/kubernetes/k8s-parallel.bats b/integration/kubernetes/k8s-parallel.bats index 5b420e216..de1a2f06c 100644 --- a/integration/kubernetes/k8s-parallel.bats +++ b/integration/kubernetes/k8s-parallel.bats @@ -30,7 +30,7 @@ setup() { kubectl get jobs -l jobgroup=${job_name} # Check the pods - kubectl wait --for=condition=Ready pod -l jobgroup=${job_name} + kubectl wait --for=condition=Ready --timeout=$timeout pod -l jobgroup=${job_name} # Check output of the jobs for i in $(kubectl get pods -l jobgroup=${job_name} -o name); do diff --git a/integration/kubernetes/k8s-pid-ns.bats b/integration/kubernetes/k8s-pid-ns.bats index 9617acff9..3ff32ec82 100644 --- a/integration/kubernetes/k8s-pid-ns.bats +++ b/integration/kubernetes/k8s-pid-ns.bats @@ -22,7 +22,7 @@ setup() { kubectl create -f "${pod_config_dir}/busybox-pod.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name # Check PID from first container first_pid_container=$(kubectl exec $pod_name -c $first_container_name ps | grep "/pause") diff --git a/integration/kubernetes/k8s-projected-volume.bats b/integration/kubernetes/k8s-projected-volume.bats index 17d47cf52..ae9c1394c 100644 --- a/integration/kubernetes/k8s-projected-volume.bats +++ b/integration/kubernetes/k8s-projected-volume.bats @@ -33,7 +33,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-projected-volume.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" # Check that the projected sources exists cmd="ls /projected-volume | grep username" diff --git a/integration/kubernetes/k8s-security-context.bats b/integration/kubernetes/k8s-security-context.bats index 67a1ba961..aad86a4cc 100644 --- a/integration/kubernetes/k8s-security-context.bats +++ b/integration/kubernetes/k8s-security-context.bats @@ -20,7 +20,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-security-context.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" # Check user cmd="ps --user 1000 -f" diff --git a/integration/kubernetes/k8s-shared-volume.bats b/integration/kubernetes/k8s-shared-volume.bats index 526bd6539..033633a67 100644 --- a/integration/kubernetes/k8s-shared-volume.bats +++ b/integration/kubernetes/k8s-shared-volume.bats @@ -22,7 +22,7 @@ setup() { kubectl create -f "${pod_config_dir}/pod-shared-volume.yaml" # Check pods - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name # Communicate containers cmd="cat /tmp/pod-data" @@ -38,7 +38,7 @@ setup() { kubectl create -f "${pod_config_dir}/initContainer-shared-volume.yaml" # Check pods - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name cmd='test $(cat /volume/initContainer) -lt $(cat /volume/container)' kubectl exec "$pod_name" -c "$last_container" -- sh -c "$cmd" diff --git a/integration/kubernetes/k8s-sysctls.bats b/integration/kubernetes/k8s-sysctls.bats index 2f92c2846..22f6b636e 100644 --- a/integration/kubernetes/k8s-sysctls.bats +++ b/integration/kubernetes/k8s-sysctls.bats @@ -20,7 +20,7 @@ setup() { kubectl apply -f "${pod_config_dir}/pod-sysctl.yaml" # Check pod creation - kubectl wait --for=condition=Ready pod "$pod_name" + kubectl wait --for=condition=Ready --timeout=$timeout pod $pod_name # Check sysctl configuration cmd="cat /proc/sys/kernel/shm_rmid_forced"