From bb4a6911035c9c7ddf59ce26433c1c9ae3bafe49 Mon Sep 17 00:00:00 2001 From: fupan Date: Thu, 8 Jun 2023 13:31:37 +0800 Subject: [PATCH] temp: just a debug of devmapper test issues Fixes:#00000000 Signed-off-by: fupan --- integration/kubernetes/k8s-configmap.bats | 2 ++ integration/kubernetes/k8s-copy-file.bats | 7 +++++++ integration/kubernetes/k8s-cpu-ns.bats | 1 + integration/kubernetes/k8s-pid-ns.bats | 9 +++++++-- integration/kubernetes/tests_common.sh | 4 ++-- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/integration/kubernetes/k8s-configmap.bats b/integration/kubernetes/k8s-configmap.bats index b49ed5ab8..0ad0ad030 100644 --- a/integration/kubernetes/k8s-configmap.bats +++ b/integration/kubernetes/k8s-configmap.bats @@ -25,8 +25,10 @@ setup() { # Create a pod that consumes the ConfigMap kubectl create -f "${pod_config_dir}/pod-configmap.yaml" + date >&3 # Check pod creation kubectl wait --for=condition=Ready --timeout=$timeout pod "$pod_name" + date >&3 # Check env cmd="env" diff --git a/integration/kubernetes/k8s-copy-file.bats b/integration/kubernetes/k8s-copy-file.bats index c7a6bb4a4..351e730b9 100644 --- a/integration/kubernetes/k8s-copy-file.bats +++ b/integration/kubernetes/k8s-copy-file.bats @@ -65,9 +65,16 @@ setup() { kubectl describe pod "$pod_name" || true kubectl get pods --all-namespaces + + date >&3 # Copy file from pod to host kubectl cp "$pod_name":/tmp/"$file_name" "$file_name" + date >&3 + echo "# ===============cat $file_name =========" >&3 + ls -al >&3 + cat $file_name >&3 + echo "# ============end" >&3 # Verify content cat "$file_name" | grep "$content" } diff --git a/integration/kubernetes/k8s-cpu-ns.bats b/integration/kubernetes/k8s-cpu-ns.bats index 3b91bbb25..fc0126757 100644 --- a/integration/kubernetes/k8s-cpu-ns.bats +++ b/integration/kubernetes/k8s-cpu-ns.bats @@ -61,6 +61,7 @@ setup() { total_cpu_period=$(kubectl exec $pod_name -c $container_name \ -- sh -c "cat $periodsyspath") + echo "==========total_cpu_quota=$total_cpu_quota total_cpu_period=$total_cpu_period=======" >&3 division_quota_period=$(echo $((total_cpu_quota/total_cpu_period))) [ "$division_quota_period" -eq "$total_cpu_container" ] diff --git a/integration/kubernetes/k8s-pid-ns.bats b/integration/kubernetes/k8s-pid-ns.bats index 965693ea2..8efe35a4f 100644 --- a/integration/kubernetes/k8s-pid-ns.bats +++ b/integration/kubernetes/k8s-pid-ns.bats @@ -25,17 +25,22 @@ setup() { # Check PID from first container first_pid_container=$(kubectl exec $pod_name -c $first_container_name \ - -- ps | grep "/pause") + -- ps | grep "/pause") || echo "#=========first_pid_container=$first_pid_container" >&3 + # Verify that is not empty check_first_pid=$(echo $first_pid_container | wc -l) [ "$check_first_pid" == "1" ] + tmp=$(kubectl exec $pod_name -c $second_container_name -- ps) + echo "#----------$tmp" >&3 # Check PID from second container second_pid_container=$(kubectl exec $pod_name -c $second_container_name \ - -- ps | grep "/pause") + -- ps | grep "/pause") || echo "#========second_pid_container=$second_pid_container" >&3 + # Verify that is not empty check_second_pid=$(echo $second_pid_container | wc -l) [ "$check_second_pid" == "1" ] + [ "$first_pid_container" == "$second_pid_container" ] } diff --git a/integration/kubernetes/tests_common.sh b/integration/kubernetes/tests_common.sh index 2736866d3..5a1e33799 100644 --- a/integration/kubernetes/tests_common.sh +++ b/integration/kubernetes/tests_common.sh @@ -11,12 +11,12 @@ # Timeout options, mainly for use with waitForProcess(). Use them unless the # operation needs to wait longer. -wait_time=90 +wait_time=180 sleep_time=3 # Timeout for use with `kubectl wait`, unless it needs to wait longer. # Note: try to keep timeout and wait_time equal. -timeout=90s +timeout=180s # issues that can't test yet. fc_limitations="https://github.com/kata-containers/documentation/issues/351"