iSulad/0013-CI-add-testcase-for-exec-without-pty.patch

107 lines
3.5 KiB
Diff
Raw Normal View History

From 0eedc0354deb5616fe7e3308547d475af01d7cc3 Mon Sep 17 00:00:00 2001
From: Li Feng <lifeng2221dd1@zoho.com.cn>
Date: Wed, 20 Jan 2021 14:50:43 +0800
Subject: [PATCH 13/26] CI: add testcase for exec without pty
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
---
.../container_cases/bigdata_stream.sh | 28 +++++++++++++++++++
.../container_cases/bigdata_stream_runc.sh | 28 +++++++++++++++++++
2 files changed, 56 insertions(+)
diff --git a/CI/test_cases/container_cases/bigdata_stream.sh b/CI/test_cases/container_cases/bigdata_stream.sh
index d7dd2d18..768e9703 100755
--- a/CI/test_cases/container_cases/bigdata_stream.sh
+++ b/CI/test_cases/container_cases/bigdata_stream.sh
@@ -138,6 +138,33 @@ function test_concurrent_bigdata_stream()
return ${ret}
}
+function test_concurrent_bigdata_stream_without_pty()
+{
+ local ret=0
+ local test="test_concurrent_bigdata_stream => (${FUNCNAME[@]})"
+ msg_info "${test} starting..."
+ declare -a pids
+
+ for index in $(seq 1 5); do
+ nohup isula exec $CID cat test_500M > /tmp/iocopy_stream_data_500M_$index &
+ pids[${#pids[@]}]=$!
+ done
+ wait ${pids[*]// /|}
+
+ for index in $(seq 1 5); do
+ ls -l /tmp/iocopy_stream_data_500M_$index
+ total_size=$(stat -c"%s" /tmp/iocopy_stream_data_500M_$index)
+ [[ $total_size -ne 524288000 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - stream iocopy loss data" && ((ret++))
+ rm -f /tmp/iocopy_stream_data_500M_$index
+ done
+
+ check_last_status
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - abnormal status" && ((ret++))
+
+ msg_info "${test} finished with return ${ret}..."
+ return ${ret}
+}
+
function test_more_concurrent_stream()
{
local ret=0
@@ -432,6 +459,7 @@ set_up || ((ans++))
record_origin_status
test_concurrent_bigdata_stream || ((ans++))
+test_concurrent_bigdata_stream_without_pty || ((ans++))
test_more_concurrent_stream || ((ans++))
test_stream_with_stop_client || ((ans++))
test_stream_with_kill_client || ((ans++))
diff --git a/CI/test_cases/container_cases/bigdata_stream_runc.sh b/CI/test_cases/container_cases/bigdata_stream_runc.sh
index 203bdd98..f6c2ee94 100755
--- a/CI/test_cases/container_cases/bigdata_stream_runc.sh
+++ b/CI/test_cases/container_cases/bigdata_stream_runc.sh
@@ -118,6 +118,33 @@ function test_cat_bigdata()
msg_info "${test} starting..."
declare -a pids
+ for index in $(seq 1 5); do
+ nohup isula exec -it $CID cat test_500M > /tmp/iocopy_stream_data_500M_$index &
+ pids[${#pids[@]}]=$!
+ done
+ wait ${pids[*]// /|}
+
+ for index in $(seq 1 5); do
+ ls -l /tmp/iocopy_stream_data_500M_$index
+ total_size=$(stat -c"%s" /tmp/iocopy_stream_data_500M_$index)
+ [[ $total_size -ne 524288000 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - stream iocopy loss data" && ((ret++))
+ rm -f /tmp/iocopy_stream_data_500M_$index
+ done
+
+ check_last_status
+ [[ $? -ne 0 ]] && msg_err "${FUNCNAME[0]}:${LINENO} - abnormal status" && ((ret++))
+
+ msg_info "${test} finished with return ${ret}..."
+ return ${ret}
+}
+
+function test_cat_bigdata_without_pty()
+{
+ local ret=0
+ local test="test_concurrent_bigdata_stream => (${FUNCNAME[@]})"
+ msg_info "${test} starting..."
+ declare -a pids
+
for index in $(seq 1 5); do
nohup isula exec $CID cat test_500M > /tmp/iocopy_stream_data_500M_$index &
pids[${#pids[@]}]=$!
@@ -377,6 +404,7 @@ set_up || ((ans++))
record_origin_status
test_cat_bigdata || ((ans++))
+test_cat_bigdata_without_pty || ((ans++))
test_stream_with_stop_client || ((ans++))
test_stream_with_kill_client || ((ans++))
test_stream_with_stop_attach || ((ans++))
--
2.25.1