修复了近期社区若干个issue

This commit is contained in:
YunYou
2024-01-04 12:12:14 +00:00
committed by Gitee
parent c8e9a044ee
commit 4d748f941c
9 changed files with 18 additions and 5 deletions

View File

@@ -69,6 +69,9 @@ def check_testcase():
suitecase_list = os.listdir(os.path.join(curr_path, suitecase_path))
ret = 0
for one_suite in suitecase_list:
if not os.path.isfile(os.path.join(curr_path, suitecase_path, one_suite)):
# 处理路径是目录的情况
continue
with open(os.path.join(curr_path, suitecase_path, one_suite), "r") as f:
case_info = json.load(f)
case_path = os.path.join(curr_path, "/".join(case_info["path"].split("/")[1:]))

View File

@@ -1,5 +1,6 @@
{
"path": "\"${OET_PATH}\"/testcases/cli-test/keepalived-cli",
"machine num": 2,
"cases": [
{
"name": "oe_test_keepalived_cli"

View File

@@ -19,6 +19,9 @@
source "${OET_PATH}"/libs/locallibs/common_lib.sh
function pre_test() {
DNF_INSTALL gcc
}
function run_test() {
LOG_INFO "Start to run test."
@@ -32,7 +35,7 @@ EOF
CHECK_RESULT $? 0 0 "Error, Fail to create test.c"
gcc test.c -o test
CHECK_RESULT $? 0 0 "Error,Check if gcc is installed "
./test
./test &
PID=$(pgrep test |awk '{print $1}')
CHECK_RESULT $? 0 0 "Error, Fail to get PID"
pwdx "$PID"
@@ -44,6 +47,7 @@ function post_test() {
LOG_INFO "Start to restore the test environment."
rm -rf test.c test
kill -9 "$PID"
DNF_REMOVE
LOG_INFO "End to restore the test environment."
}

View File

@@ -22,6 +22,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh
function pre_test() {
LOG_INFO "Start to prepare the test environment."
pwd=`pwd`
DNF_INSTALL gcc
mkdir c_stat_test && cd c_stat_test
LOG_INFO "End to prepare the test environment."
}
@@ -67,6 +68,7 @@ EOF
function post_test() {
LOG_INFO "Start to restore the test environment."
cd $pwd && rm -rf c_stat_test/
DNF_REMOVE
LOG_INFO "End to restore the test environment."
}

View File

@@ -21,7 +21,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh
function pre_test() {
LOG_INFO "Start to prepare the test environment."
DNF_INSTALL "cairo-devel"
DNF_INSTALL "cairo-devel gcc"
pwd=`pwd`
mkdir cairo_test/ && cd cairo_test/
LOG_INFO "End to prepare the test environment."

View File

@@ -23,6 +23,7 @@ function pre_test() {
LOG_INFO "Start to prepare the test environment."
pwd=`pwd`
mkdir glibc_test && cd glibc_test
DNF_INSTALL gcc
LOG_INFO "End to prepare the test environment."
}
@@ -51,6 +52,7 @@ EOF
function post_test() {
LOG_INFO "Start to restore the test environment."
cd $pwd && rm -rf glibc_test/
DNF_REMOVE
LOG_INFO "End to restore the test environment."
}

View File

@@ -19,7 +19,7 @@ source "$OET_PATH/libs/locallibs/common_lib.sh"
function pre_test() {
LOG_INFO "Start to prepare the test environment."
DNF_INSTALL libidn*
DNF_INSTALL "libidn* gcc"
LOG_INFO "End to prepare the test environment."
}

View File

@@ -20,7 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh
function pre_test() {
LOG_INFO "Start to prepare the test environment."
DNF_INSTALL "libunistring libunistring-devel gc"
DNF_INSTALL "libunistring libunistring-devel gc gcc"
ls ./a.out && rm -rf ./a.out
LOG_INFO "End to prepare the test environment."
}

View File

@@ -23,7 +23,7 @@ function pre_test() {
LOG_INFO "Start to prepare the test environment."
OLD_LANG=$LANG
export LANG=en_US.UTF-8
DNF_INSTALL "pcre pcre-devel"
DNF_INSTALL "pcre pcre-devel gcc"
LOG_INFO "End to prepare the test environment."
}
@@ -54,6 +54,7 @@ function post_test() {
sed '2,$d' /etc/ld.so.conf
rm -f $(realpath pcre.c) && rm -f $(realpath a.out)
export LANG=${OLD_LANG}
DNF_REMOVE
LOG_INFO "End to clean the test environment."
}