diff --git a/testcases/cli-test/osc/oe_test_osc_01.sh b/testcases/cli-test/osc/oe_test_osc_01.sh index d713da62661c2f408d63f222d4da78ef8c46a932..87911dee98e94a6d14b8c2656502a5c6270555dc 100644 --- a/testcases/cli-test/osc/oe_test_osc_01.sh +++ b/testcases/cli-test/osc/oe_test_osc_01.sh @@ -15,7 +15,7 @@ #@License : Mulan PSL v2 #@Desc : OSC is a command line tool based on OBS, which is equivalent to the interface of OBS. ##################################### - +# shellcheck disable=SC1091,SC2154 source "common/common_osc.sh" function config_params() { @@ -32,19 +32,17 @@ function pre_test() { function run_test() { LOG_INFO "Start to run test." - osc --help | grep 'Usage' - CHECK_RESULT $? - osc --version | grep [0-9] + osc --help | grep -i 'Usage' CHECK_RESULT $? - osc man | grep 'man page' + osc version | grep "[0-9]" CHECK_RESULT $? osc list | grep 'openEuler' CHECK_RESULT $? - osc api http://117.78.1.88 | grep 'Open Build Service API' + osc api https://build.openeuler.openatom.cn/ | grep 'Open Build Service API' CHECK_RESULT $? - osc checkout $branches_path | grep 'revision' + osc checkout "$branches_path" | grep 'revision' CHECK_RESULT $? - osc cat $branches_path/zjl/last_file.txt | grep 'momohao' + osc cat "$branches_path"/zjl/last_file.txt | grep 'momohao' CHECK_RESULT $? LOG_INFO "End to run test." } diff --git a/testcases/cli-test/osc/oe_test_osc_05.sh b/testcases/cli-test/osc/oe_test_osc_05.sh index 8bf1cc3710ae81fddad4b0d775fe1e9a0d3b509a..88979b4f38bb94095350d4609d62e5431d4172ef 100644 --- a/testcases/cli-test/osc/oe_test_osc_05.sh +++ b/testcases/cli-test/osc/oe_test_osc_05.sh @@ -15,7 +15,7 @@ #@License : Mulan PSL v2 #@Desc : OSC is a command line tool based on OBS, which is equivalent to the interface of OBS. ##################################### - +# shellcheck disable=SC1091,SC2154 source "common/common_osc.sh" function config_params() { @@ -27,8 +27,8 @@ function config_params() { function pre_test() { LOG_INFO "Start to prepare the test environment." DNF_INSTALL osc - osc checkout $branches_path | grep 'revision' - cd $branches_path/zjl || exit 1 + osc checkout "$branches_path" | grep 'revision' + cd "$branches_path"/zjl || exit 1 touch {1..3}.txt LOG_INFO "End to prepare the test environment." } @@ -51,13 +51,13 @@ function run_test() { CHECK_RESULT $? osc commit -n | grep 'Committed revision' CHECK_RESULT $? - osc lock $branches_path zjl | grep 'Sending' + osc lock "$branches_path" zjl CHECK_RESULT $? echo 'good boy' >3.txt CHECK_RESULT $? osc commit -n CHECK_RESULT $? 1 0 'Package locked failed' - osc unlock $branches_path zjl -m "Package unlock" + osc unlock "$branches_path" zjl -m "Package unlock" CHECK_RESULT $? osc commit -n | grep 'Committed revision' CHECK_RESULT $? diff --git a/testcases/cli-test/osc/oe_test_osc_06.sh b/testcases/cli-test/osc/oe_test_osc_06.sh index b48e8b406e2d87dae005bafbe4352fa368c408df..2ec9d1c1e61f2dcd0aedcc5602a43b609574c31b 100644 --- a/testcases/cli-test/osc/oe_test_osc_06.sh +++ b/testcases/cli-test/osc/oe_test_osc_06.sh @@ -15,7 +15,7 @@ #@License : Mulan PSL v2 #@Desc : OSC is a command line tool based on OBS, which is equivalent to the interface of OBS. ##################################### - +# shellcheck disable=SC1091,SC2035,SC2154 source "common/common_osc.sh" function config_params() { @@ -27,8 +27,8 @@ function config_params() { function pre_test() { LOG_INFO "Start to prepare the test environment." DNF_INSTALL osc - osc checkout $branches_path | grep 'revision' - cd $branches_path/zjl || exit 1 + osc checkout "$branches_path" | grep 'revision' + cd "$branches_path"/zjl || exit 1 LOG_INFO "End to prepare the test environment." } @@ -39,13 +39,13 @@ function run_test() { CHECK_RESULT $? osc info | grep 'Project name' CHECK_RESULT $? - osc config section --dump-full | grep 'passx' + osc config section --dump-full | grep 'user' CHECK_RESULT $? - osc config section --dump | grep 'plaintext_passwd' + osc config section --dump | grep 'user' CHECK_RESULT $? osc clean . | grep 'Removing: osc.log' CHECK_RESULT $? - osc comment list package $branches_path zjl + osc comment list package "$branches_path" zjl CHECK_RESULT $? touch 4.txt osc add * | grep 'A' | grep '4.txt'