Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3405 from GabyCT/updatek8stable
Browse files Browse the repository at this point in the history
backport: Fixes for k8s tests for stable-2.0
  • Loading branch information
GabyCT authored Apr 8, 2021
2 parents 77962ac + 5e181fc commit 9a38394
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions .ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-attach-handlers.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions integration/kubernetes/k8s-copy-file.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-cpu-ns.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-custom-dns.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-empty-dirs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions integration/kubernetes/k8s-liveness-probes.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-memory.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-parallel.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-pid-ns.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-projected-volume.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-security-context.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions integration/kubernetes/k8s-shared-volume.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/kubernetes/k8s-sysctls.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9a38394

Please sign in to comment.