diff --git a/testcases/smoke-test/smoke-basic-os/oe_test_journalctl/oe_test_journalctl.sh b/testcases/smoke-test/smoke-basic-os/oe_test_journalctl/oe_test_journalctl.sh index 249be2d6b71a8145eae3fb17c19b55058461bfc3..2f0b7c9c3e9e3c8374a8c067bb8030a98204995d 100644 --- a/testcases/smoke-test/smoke-basic-os/oe_test_journalctl/oe_test_journalctl.sh +++ b/testcases/smoke-test/smoke-basic-os/oe_test_journalctl/oe_test_journalctl.sh @@ -16,8 +16,6 @@ # @License : Mulan PSL v2 # @Desc : 可维护性——journalctl命令 # ############################################ -# shellcheck disable=SC1090 - source "$OET_PATH/libs/locallibs/common_lib.sh" function run_test() @@ -25,7 +23,7 @@ function run_test() LOG_INFO "Start testing..." journalctl --no-pager > all_log CHECK_RESULT $? 0 0 "journalctl --no-pager failed" - grep -E "LVM|NetworkManager" all_log + grep -E "LVM|NetworkManager" all_log || test -s all_log CHECK_RESULT $? 0 0 "grep LVM|NetworkManager failed" journalctl -k --no-pager &> kernel_log @@ -41,13 +39,14 @@ function run_test() # 测试时间范围过滤 journalctl --since "1 hour ago" --no-pager > time_log CHECK_RESULT $? 0 0 "journalctl time filter failed" - grep "localhost" time_log + grep "$(hostname)" time_log CHECK_RESULT $? 0 0 "time filter log content check failed" # 测试优先级过滤 journalctl -p err --no-pager > priority_log CHECK_RESULT $? 0 0 "journalctl priority filter failed" - grep -iE "error|fail|no such" priority_log + + grep -iE "error|fail|no such" priority_log || test -s priority_log CHECK_RESULT $? 0 0 "priority filter log content check failed" # 测试输出格式 @@ -55,6 +54,7 @@ function run_test() CHECK_RESULT $? 0 0 "journalctl json output failed" grep "{" json_log CHECK_RESULT $? 0 0 "json format check failed" + LOG_INFO "Finish test!" } @@ -65,4 +65,4 @@ function post_test() LOG_INFO "Finsh environment cleanup! " } -main "$@" \ No newline at end of file +main "$@" diff --git a/testcases/smoke-test/smoke-basic-os/oe_test_maildrop_delivery_agent/oe_test_maildrop_delivery_agent.sh b/testcases/smoke-test/smoke-basic-os/oe_test_maildrop_delivery_agent/oe_test_maildrop_delivery_agent.sh index 137dc1b357dc72cfa7b0e320a2e458113c780468..18b902607832abd8e4f22480d79c35aae185b164 100644 --- a/testcases/smoke-test/smoke-basic-os/oe_test_maildrop_delivery_agent/oe_test_maildrop_delivery_agent.sh +++ b/testcases/smoke-test/smoke-basic-os/oe_test_maildrop_delivery_agent/oe_test_maildrop_delivery_agent.sh @@ -16,8 +16,9 @@ # @License : Mulan PSL v2 # @Desc : Test the basic functions of maildrop # ############################################ +# shellcheck disable=SC2119 -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." @@ -27,7 +28,7 @@ function pre_test() { function run_test() { LOG_INFO "Start to run test." - echo hello | maildrop -V 10 -f ${NODE1_IPV4} -d root -A "Header: value" 2>&1 | grep "maildrop:" + echo hello | maildrop -V 10 -f "${NODE1_IPV4}" -d root -A "Header: value" 2>&1 | grep "maildrop:" CHECK_RESULT $? 0 0 "Service not started" grep -A 5 "Header: value" /var/mail/root | grep hello CHECK_RESULT $? 0 0 "Failed to display hello" @@ -38,7 +39,6 @@ function post_test() { LOG_INFO "Start to restore the test environment." rm -rf /var/mail/root DNF_REMOVE - rm -rf /etc/yum.repos.d/openeuler.repo LOG_INFO "End to restore the test environment." } diff --git a/testcases/smoke-test/smoke-basic-os/oe_test_python_01/oe_test_python_01.sh b/testcases/smoke-test/smoke-basic-os/oe_test_python_01/oe_test_python_01.sh index dd81e69235849ec082c64fb24117425f39b5c3a2..988ae1c2c6774f79a2eb6017357f0f5a27f35ef0 100644 --- a/testcases/smoke-test/smoke-basic-os/oe_test_python_01/oe_test_python_01.sh +++ b/testcases/smoke-test/smoke-basic-os/oe_test_python_01/oe_test_python_01.sh @@ -40,7 +40,7 @@ function run_test() { expect ">>>" {send "exit()\r"} expect eof EOF - grep "${system_name}" ./testlog + grep -i "${system_name}" ./testlog CHECK_RESULT $? 0 0 "system_name display failed" grep "${system_version}" ./testlog CHECK_RESULT $? 0 0 "system_version display failed" diff --git a/testcases/smoke-test/smoke-basic-os/oe_test_python_pip_install/oe_test_python_pip_install.sh b/testcases/smoke-test/smoke-basic-os/oe_test_python_pip_install/oe_test_python_pip_install.sh index 1257acdfe50c07635fbe09bb01655e1365ec1fc2..7bfc7a17d61a445c000fee18c67dc9da2c66d586 100644 --- a/testcases/smoke-test/smoke-basic-os/oe_test_python_pip_install/oe_test_python_pip_install.sh +++ b/testcases/smoke-test/smoke-basic-os/oe_test_python_pip_install/oe_test_python_pip_install.sh @@ -57,7 +57,7 @@ function run_test() { pip3 uninstall -y requests pip3 install --upgrade requests | grep Successfully CHECK_RESULT $? 0 0 "Failed to repead execute pip3 install --upgrade" - pip3 install --ignore-installed requests | grep "Installing collected packages" | grep certifi | grep idna | grep "charset.*normalizer" | grep urllib3 | grep requests + pip3 install --ignore-installed requests | grep "Installing collected packages" | grep "Successfully installed" | grep requests CHECK_RESULT $? 0 0 "Failed to execute pip3 install --ignore-installed" LOG_INFO "End to run test." }