diff --git a/suite2cases/log4cplus.json b/suite2cases/log4cplus.json new file mode 100644 index 0000000000000000000000000000000000000000..682cdd682099399dd0743820ebec51af49e10117 --- /dev/null +++ b/suite2cases/log4cplus.json @@ -0,0 +1,9 @@ +{ + "path": "$OET_PATH/testcases/cli-test/log4cplus", + "cases": [ + { + "name": "oe_test_log4cplus" + } + + ] +} diff --git a/testcases/cli-test/fakechroot/oe_test_fakechroot_chroot.sh b/testcases/cli-test/fakechroot/oe_test_fakechroot_chroot.sh index 7e1ebbfe2965cda97312cd404226e64f234aea59..254818ad459109cc297d4d562e4dd68061b179ac 100644 --- a/testcases/cli-test/fakechroot/oe_test_fakechroot_chroot.sh +++ b/testcases/cli-test/fakechroot/oe_test_fakechroot_chroot.sh @@ -16,12 +16,12 @@ # @License : Mulan PSL v2 # @Desc : verify the uasge of fakechroot command # ############################################ +# shellcheck disable=SC1091 -source ${OET_PATH}/libs/locallibs/common_lib.sh +source "${OET_PATH}"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start environmental preparation." - DNF_INSTALL fakechroot cp ./common/hello.sh ./ chmod 777 hello.sh LOG_INFO "End of environmental preparation!" @@ -36,7 +36,7 @@ function run_test() { chroot --userspec=root:root --skip-chdir / ./hello.sh | grep "hello world!" CHECK_RESULT $? 0 0 "Check chroot --userspec --skip-chdir failed" - chroot --help | fgrep "Usage: chroot [OPTION]" + chroot --help | grep -F "Usage: chroot [OPTION]" CHECK_RESULT $? 0 0 "Check chroot --help failed" chroot --version | grep "chroot (GNU coreutils) [[:digit:]]" @@ -47,7 +47,6 @@ function run_test() { function post_test() { LOG_INFO "Start to restore the test environment." - DNF_REMOVE rm -rf hello.sh test LOG_INFO "Finish restore the test environment." } diff --git a/testcases/cli-test/fakechroot/oe_test_fakechroot_env_01.sh b/testcases/cli-test/fakechroot/oe_test_fakechroot_env_01.sh index bb59d183b48951e85337c01b9a3c3bee2dd99d25..8091645e64b13044e41cec21e2156e1ac3bcc626 100644 --- a/testcases/cli-test/fakechroot/oe_test_fakechroot_env_01.sh +++ b/testcases/cli-test/fakechroot/oe_test_fakechroot_env_01.sh @@ -16,12 +16,12 @@ # @License : Mulan PSL v2 # @Desc : verify the uasge of fakechroot command # ############################################ +# shellcheck disable=SC1091 -source ${OET_PATH}/libs/locallibs/common_lib.sh +source "${OET_PATH}"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start environmental preparation." - DNF_INSTALL fakechroot cp ./common/hello.sh ./ chmod 777 hello.sh mkdir test @@ -68,7 +68,6 @@ function run_test() { function post_test() { LOG_INFO "Start to restore the test environment." - DNF_REMOVE rm -rf hello.sh test LOG_INFO "Finish restore the test environment." } diff --git a/testcases/cli-test/fakechroot/oe_test_fakechroot_env_02.sh b/testcases/cli-test/fakechroot/oe_test_fakechroot_env_02.sh index fc2cee94cec55c7f0fab4621e37ce905c0bd6adc..968d7772f11b3e8548f0c65ffafae7a806b1ad94 100644 --- a/testcases/cli-test/fakechroot/oe_test_fakechroot_env_02.sh +++ b/testcases/cli-test/fakechroot/oe_test_fakechroot_env_02.sh @@ -16,12 +16,12 @@ # @License : Mulan PSL v2 # @Desc : verify the uasge of fakechroot command # ############################################ +# shellcheck disable=SC1091 -source ${OET_PATH}/libs/locallibs/common_lib.sh +source "${OET_PATH}"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start environmental preparation." - DNF_INSTALL fakechroot cp ./common/hello.sh ./ chmod 777 hello.sh LOG_INFO "End of environmental preparation!" @@ -48,7 +48,7 @@ function run_test() { env --debug | grep "USER=" CHECK_RESULT $? 0 0 "Check env --debug failed" - env --help | fgrep "Usage: env [OPTION]" + env --help | grep -F "Usage: env [OPTION]" CHECK_RESULT $? 0 0 "Check env --help failed" env --version | grep "env (GNU coreutils) [[:digit:]]" @@ -59,7 +59,6 @@ function run_test() { function post_test() { LOG_INFO "Start to restore the test environment." - DNF_REMOVE rm -rf hello.sh LOG_INFO "Finish restore the test environment." } diff --git a/testcases/cli-test/libosinfo/oe_test_osinfo-db-import/oe_test_osinfo-db-import.sh b/testcases/cli-test/libosinfo/oe_test_osinfo-db-import/oe_test_osinfo-db-import.sh index 900c7986f666bd038a96844f2b2d52917703ea5c..67b4ac9eddfea197689f760a30df8437ccb9ab20 100644 --- a/testcases/cli-test/libosinfo/oe_test_osinfo-db-import/oe_test_osinfo-db-import.sh +++ b/testcases/cli-test/libosinfo/oe_test_osinfo-db-import/oe_test_osinfo-db-import.sh @@ -22,7 +22,7 @@ source "$OET_PATH/libs/locallibs/common_lib.sh" function pre_test() { LOG_INFO "Start to prepare the test environment." DNF_INSTALL "osinfo-db-tools" - pwd=`pwd` + pwd=$(pwd) LOG_INFO "Finish preparing the test environment." } @@ -32,19 +32,19 @@ function run_test() { osinfo-db-import --local osinfo-db-20230308.tar.xz CHECK_RESULT $? 0 0 "Failed to import data" mkdir testdir - cd testdir + cd testdir || exit osinfo-db-export CHECK_RESULT $? 0 0 "Failed to export data" - test -e osinfo-db-20230331.tar.xz + test -e osinfo-db-20230308.tar.xz CHECK_RESULT $? 0 0 "Export file does not exist" LOG_INFO "End of the test." } function post_test() { LOG_INFO "Start to restore the test environment." - cd $pwd + cd "$pwd" || exit rm -rf testdir osinfo-db-20230308.tar.xz - DNF_REMOVE + DNF_REMOVE "$@" LOG_INFO "Finish restoring the test environment." } diff --git a/testcases/cli-test/nototools/oe_test_nototools_0.2.17_notodiff/oe_test_nototools_0.2.17_notodiff.sh b/testcases/cli-test/nototools/oe_test_nototools_0.2.17_notodiff/oe_test_nototools_0.2.17_notodiff.sh index 2b8665d8a1cc7b9425f73d167cabcef6a77ac1f0..5c99e9bbd6c2ebbb3c5c0cf2c9aa9ccdd91c2da4 100644 --- a/testcases/cli-test/nototools/oe_test_nototools_0.2.17_notodiff/oe_test_nototools_0.2.17_notodiff.sh +++ b/testcases/cli-test/nototools/oe_test_nototools_0.2.17_notodiff/oe_test_nototools_0.2.17_notodiff.sh @@ -17,8 +17,10 @@ # @License : Mulan PSL v2 # @Desc : TEST notodiff in nototools options # ############################################# +# shellcheck disable=SC1091 -source ${OET_PATH}/libs/locallibs/common_lib.sh +source "${OET_PATH}"/libs/locallibs/common_lib.sh +source ../common/common.sh # Preloaded data, parameter configuration function config_params() { @@ -53,60 +55,60 @@ function run_test() { CHECK_RESULT $? 0 0 "option: --help error" #Test the --before,--after parameter - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --before,--after error" #Test the -t parameter - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -t area | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -t area | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: -t area error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --diff-type shape | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --diff-type shape | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --diff-type shape error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -t area-shape-product | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -t area-shape-product | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: -t area-shape-product error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --diff-type rendered | grep -q "3 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --diff-type rendered | grep -q "3 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --diff-type rendered error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -t gsub | grep -q "9 differences in GSUB rules" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -t gsub | grep -q "9 differences in GSUB rules" CHECK_RESULT $? 0 0 "option: -t gsub error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --diff-type gpos | grep -qE "115 differences in mark-to-mark positioning rule coverage|0 differences in mark-to-mark positioning rule values" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --diff-type gpos | grep -qE "115 differences in mark-to-mark positioning rule coverage|0 differences in mark-to-mark positioning rule values" CHECK_RESULT $? 0 0 "option: --diff-type gpos error" #Test the -m parameter - notodiff --before test_input/test_input_1 --after test_input/test_input_2 -m *.ttf | grep -q "17 differences in glyph shape" + notodiff -- *glob* test_input/test_input_1 test_input/test_input_2 -m *.ttf | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: -m error" - notodiff --before test_input/test_input_1 --after test_input/test_input_2 --match *.ttf | grep -q "17 differences in glyph shape" + notodiff -- *glob* test_input/test_input_1 test_input/test_input_2 --match *.ttf | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --match error" #Test the -l parameter - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -l 10 | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -l 10 | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: -l error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --out-lines 10 | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --out-lines 10 | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --out-lines error" #Test the -w parameter - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -w ${MISS_LIST} | grep -q "15 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -w "${MISS_LIST}" | grep -q "15 differences in glyph shape" CHECK_RESULT $? 0 0 "option: -w error" - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --allowlist ${MISS_LIST} | grep -q "15 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --allowlist "${MISS_LIST}" | grep -q "15 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --allowlist error" #Test the --font-size parameter for i in "64" "128" do - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -t rendered --font-size ${i} | grep -q "3 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -t rendered --font-size ${i} | grep -q "3 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --font-size ${i} error" done #Test the --render-path parameter - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} -t rendered --render-path ${TMP_DIR} | grep -q "3 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" -t rendered --render-path "${TMP_DIR}" | grep -q "3 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --render-path error" #Test the --diff-threshold parameter - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --diff-threshold 1 | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --diff-threshold 1 | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --diff-threshold error" #Test the --verbose parameter for i in "debug" "info" "warning" "critical" "error" do - notodiff --before test_input/test_input_1/${TEST_FILE_1} --after test_input/test_input_1/${TEST_FILE_2} --verbose ${i} | grep -q "17 differences in glyph shape" + notodiff --before test_input/test_input_1/"${TEST_FILE_1}" --after test_input/test_input_1/"${TEST_FILE_2}" --verbose ${i} | grep -q "17 differences in glyph shape" CHECK_RESULT $? 0 0 "option: --verbose ${i} error" done @@ -117,7 +119,7 @@ function run_test() { function post_test() { LOG_INFO "Start to restore the test environment." - rm -rf ${TMP_DIR} + rm -rf "${TMP_DIR}" common_post LOG_INFO "End to restore the test environment." diff --git a/testcases/cli-test/pyyaml/oe_test_pyyaml.sh b/testcases/cli-test/pyyaml/oe_test_pyyaml.sh index 823d802626481474fdc17d8d1993c78cb6a58bdd..00ffbd46c0e4b25ba23062c95200031edcc5de45 100644 --- a/testcases/cli-test/pyyaml/oe_test_pyyaml.sh +++ b/testcases/cli-test/pyyaml/oe_test_pyyaml.sh @@ -17,7 +17,7 @@ # @Desc : pyyaml function verification # ############################################ -source ${OET_PATH}/libs/locallibs/common_lib.sh +source "${OET_PATH}"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." DNF_INSTALL "python3-pyyaml" @@ -39,7 +39,7 @@ function run_test() { function post_test() { LOG_INFO "Start to restore the test environment." - DNF_REMOVE + DNF_REMOVE "$@" rm -f generate.yaml LOG_INFO "End to restore the test environment." } diff --git a/testcases/cli-test/strongswan/oe_test_service_strongswan-swanctl.sh b/testcases/cli-test/strongswan/oe_test_service_strongswan-swanctl.sh index 219faaaddb95a917974460735a6a449eff7c7418..ea136aa42bc9a1d09d744c3ea35a02f04785acf6 100644 --- a/testcases/cli-test/strongswan/oe_test_service_strongswan-swanctl.sh +++ b/testcases/cli-test/strongswan/oe_test_service_strongswan-swanctl.sh @@ -17,7 +17,7 @@ # @Desc : Test strongswan-swanctl.service restart # ############################################# -source "../common/common_lib.sh" +source "$OET_PATH"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start environmental preparation." @@ -46,7 +46,7 @@ function post_test() { systemctl reload strongswan-swanctl.service rm -rf /etc/strongswan/ipsec.d/triplets.dat /etc/tnc_config systemctl stop strongswan-swanctl.service - DNF_REMOVE + DNF_REMOVE "$@" LOG_INFO "Finish environment cleanup!" } main "$@" diff --git a/testcases/cli-test/strongswan/oe_test_service_strongswan.sh b/testcases/cli-test/strongswan/oe_test_service_strongswan.sh index 8dec653e3db19f97c48c7fd85fb9a1178d9fcaf4..d66d79d71144a1023536f56cb55649e3201cd500 100644 --- a/testcases/cli-test/strongswan/oe_test_service_strongswan.sh +++ b/testcases/cli-test/strongswan/oe_test_service_strongswan.sh @@ -17,7 +17,7 @@ # @Desc : Test strongswan.service restart # ############################################# -source "../common/common_lib.sh" +source "$OET_PATH"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start environmental preparation." @@ -38,10 +38,10 @@ function run_test() { systemctl status "${service}" | grep "Active" | grep "active (running)" CHECK_RESULT $? 0 0 "${service} start failed" symlink_file=$(systemctl enable "${service}" 2>&1 | awk '{print $3}') - find ${symlink_file} + find "${symlink_file}" CHECK_RESULT $? 0 0 "${service} enable failed" systemctl disable "${service}" - find ${symlink_file} + find "${symlink_file}" CHECK_RESULT $? 0 1 "${service} disable failed" journalctl --since "${log_time}" -u "${service}" | grep -i "fail\|error" | grep -v -i "DEBUG\|INFO\|WARNING" | grep -v "/etc/strongswan/ipsec.d/triplets.dat" | grep -v "/etc/tnc_config" CHECK_RESULT $? 0 1 "There is an error message for the log of ${service}" @@ -52,7 +52,7 @@ function run_test() { function post_test() { LOG_INFO "start environment cleanup." systemctl stop "${service}" - DNF_REMOVE + DNF_REMOVE "$@" LOG_INFO "Finish environment cleanup!" } diff --git a/testcases/cli-test/strongswan/oe_test_service_strongswan_01.sh b/testcases/cli-test/strongswan/oe_test_service_strongswan_01.sh index 20d9527e5e7263a322d54097691485850e1c6ce8..55c849cbe036e1039c1897fe6bdf80b0bd222b10 100755 --- a/testcases/cli-test/strongswan/oe_test_service_strongswan_01.sh +++ b/testcases/cli-test/strongswan/oe_test_service_strongswan_01.sh @@ -16,8 +16,10 @@ # @License : Mulan PSL v2 # @Desc : Test strongswan command # ############################################# +# shellcheck disable=SC2046 +# shellcheck disable=SC1083 -source "../common/common_lib.sh" +source "$OET_PATH"/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." @@ -29,7 +31,7 @@ function pre_test() { podman run -itd --name vpn --env-file ./test_file/vpn.env -p 700:700/udp -p 4700:4700/udp -d --privileged docker.io/hwdsl2/ipsec-vpn-server:latest pgrep -f "strongswan" && strongswan stop SLEEP_WAIT 3 "rm -rf strongswan_test*.log" - log_time=$(date '+%Y-%m-%d %T') + # log_time=$(date '+%Y-%m-%d %T') grep "shared" /etc/strongswan/ipsec.conf || cat ./test_file/ipsec_add.conf >> /etc/strongswan/ipsec.conf LOG_INFO "End to prepare the test environment." } @@ -58,18 +60,18 @@ function run_test() { grep "Reloading strongSwan IPsec configuration" strongswan_test_reload.log CHECK_RESULT $? 0 0 "Failed to check the reload" SLEEP_WAIT 3 - connectionname=`strongswan statusall|grep "Connections" -A 1|tail -n 1|awk -F: {'print $1'}` - strongswan up $connectionname & + connectionname=$(strongswan statusall|grep "Connections" -A 1|tail -n 1|awk -F: {'print $1'}) + strongswan up "$connectionname" & pgrep -f "strongswan up" CHECK_RESULT $? 0 0 "Failed to check the up" SLEEP_WAIT 3 strongswan down shared>strongswan_test_down.log grep "closed successfully" strongswan_test_down.log CHECK_RESULT $? 0 0 "Failed to check the down" - strongswan route $connectionname >strongswan_test_route.log + strongswan route "$connectionname" >strongswan_test_route.log grep "'shared' routed" strongswan_test_route.log CHECK_RESULT $? 0 0 "Failed to check the route" - strongswan unroute $connectionname >strongswan_test_unroute.log + strongswan unroute "$connectionname" >strongswan_test_unroute.log grep "trap policy 'shared' unrouted" strongswan_test_unroute.log CHECK_RESULT $? 0 0 "Failed to check the unroute" LOG_INFO "End to run test." @@ -81,7 +83,7 @@ function post_test() { pgrep -f "starter" && strongswan stop SLEEP_WAIT 3 "podman stop -all" podman rm -f $(podman ps -qa) - DNF_REMOVE + DNF_REMOVE "$@" LOG_INFO "Finish environment cleanup!" } diff --git a/testcases/embedded-test/version_basic_tests/oe_test_version_posix_suite_test_001/oe_test_version_posix_suite_test_001.sh b/testcases/embedded-test/version_basic_tests/oe_test_version_posix_suite_test_001/oe_test_version_posix_suite_test_001.sh index 2b10f7d018cd2e28cfce7dea9629466e4f57858c..20d8ce563b54f300b2c1925a2197af051a9dfffb 100644 --- a/testcases/embedded-test/version_basic_tests/oe_test_version_posix_suite_test_001/oe_test_version_posix_suite_test_001.sh +++ b/testcases/embedded-test/version_basic_tests/oe_test_version_posix_suite_test_001/oe_test_version_posix_suite_test_001.sh @@ -15,23 +15,24 @@ #@License : Mulan PSL v2 #@Desc : run posix test suite ##################################### +# shellcheck disable=SC1091 -source ../comm_lib.sh +source ../../common_libs/comm_lib.sh -CUR_DATE=`date +'%Y-%m-%d %H:%M:%S'` +CUR_DATE=$(date +'%Y-%m-%d %H:%M:%S') # 测试对象、测试需要的工具等安装准备 function pre_test() { LOG_INFO "Start to prepare the test environment." - EXECUTE_T="180m" + # EXECUTE_T="180m" MAKEDIR=$(cd .. && pwd) - chmod 777 ${MAKEDIR}/make + chmod 777 "${MAKEDIR}"/make MAKE=${MAKEDIR}/make - timestap=`stat -c %Y tmp_test/build.log` - formart_date=`date '+%Y-%m-%d %H:%M:%S' -d @$timestap` + timestap=$(stat -c %Y tmp_test/build.log) + formart_date=$(date '+%Y-%m-%d %H:%M:%S' -d @"$timestap") date -s "$formart_date" LOG_INFO "End to prepare the test environment." @@ -41,26 +42,26 @@ function pre_test() { function run_test() { LOG_INFO "Start to run test." - pushd tmp_test/ - pushd posixtestsuite/ + pushd tmp_test/ || exit + pushd posixtestsuite/ || exit POSIX_TARGET=./ ${MAKE} run-tests > ../run.log 2>&1 - popd + popd || exit awk -F': ' '{if(($2=="build" && $3!="PASS") || ($2=="link" && $3!="PASS") || (($2=="execution" && $3=="PASS"))) print $1}' build.log > skip.name cat ../ignore.out >> skip.name awk -F': ' '{if($2=="execution" && $3!="PASS") print $1}' run.log > fail.name - while read line || [[ -n $line ]]; do - grep -q $line skip.name - if [ $? -eq 0 ]; then + while read -r line || [[ -n $line ]]; do + grep -q "$line" skip.name + if mycmd; then continue fi # 单独再执行一次 - ./posixtestsuite/$line.test + ./posixtestsuite/"$line".test CHECK_RESULT $? 0 0 "run posix testcase fail case name: $line" done < fail.name - popd + popd || exit LOG_INFO "End to run test." }