diff --git a/suite2cases/automake b/suite2cases/automake new file mode 100644 index 0000000000000000000000000000000000000000..838b47a1eeb87ed7021fa7b4d60180c187f027be --- /dev/null +++ b/suite2cases/automake @@ -0,0 +1 @@ +oe_test_automake \ No newline at end of file diff --git a/suite2cases/maven b/suite2cases/maven new file mode 100644 index 0000000000000000000000000000000000000000..72b1b354dd8c5dd66e3ead38a344baf2e8bf74c1 --- /dev/null +++ b/suite2cases/maven @@ -0,0 +1 @@ +oe_test_maven \ No newline at end of file diff --git a/testcases/cli-test/automake/amhello.tar.gz b/testcases/cli-test/automake/amhello.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..49e7001a594ef229eb427620616b5ea97fb1414e Binary files /dev/null and b/testcases/cli-test/automake/amhello.tar.gz differ diff --git a/testcases/cli-test/automake/oe_test_automake.sh b/testcases/cli-test/automake/oe_test_automake.sh new file mode 100644 index 0000000000000000000000000000000000000000..1bd03494bd89495e55f157a2ed4ebabc40e4b1a5 --- /dev/null +++ b/testcases/cli-test/automake/oe_test_automake.sh @@ -0,0 +1,78 @@ +#!/usr/bin/bash + +# Copyright (c) 2021. Huawei Technologies Co.,Ltd.ALL rights reserved. +# This program is licensed under Mulan PSL v2. +# You can use it according to the terms and conditions of the Mulan PSL v2. +# http://license.coscl.org.cn/MulanPSL2 +# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more details. +#################################### +#@Author : fire-kylin +#@Contact : sugarkylin@foxmail.com +#@Date : 2021-07-23 +#@License : Mulan PSL v2 +#@Version : 1.0 +#@Desc : command test automake +##################################### + +source ${OET_PATH}/libs/locallibs/common_lib.sh + +function pre_test() +{ + LOG_INFO "Start to prepare the test environment." + + DNF_INSTALL "automake" + DNF_INSTALL "autoconf" + + LOG_INFO "End to prepare the test environment." +} + +function run_test() +{ + LOG_INFO "Start to run test." + + automake --help + CHECK_RESULT $? 0 0 "log message: Failed to run command: automake --help" + + automake --version + CHECK_RESULT $? 0 0 "log message: Failed to run command: automake --version" + + tar -zxvf amhello.tar.gz + + cd ./amhello + + # autoreconf is a script that calls autoconf, automake, and a bunch of other commands in the right order. + # This will test the main features of the automake package. + autoreconf --install + CHECK_RESULT $? 0 0 "log message: Failed to run command: autoreconf --install" + + ./configure + CHECK_RESULT $? 0 0 "log message: Failed to run command: ./configure" + + make + CHECK_RESULT $? 0 0 "log message: Failed to run command: make" + + ./src/hello + CHECK_RESULT $? 0 0 "log message: Failed to run command: ./src/hello" + + make distcheck + CHECK_RESULT $? 0 0 "log message: Failed to run command: make distcheck" + + cd .. + + LOG_INFO "End to run test." +} + +function post_test() +{ + LOG_INFO "Start to restore the test environment." + + DNF_REMOVE + rm -rf ./amhello + + LOG_INFO "End to restore the test environment." +} + +main "$@" diff --git a/testcases/cli-test/help2man/oe_test_help2man.sh b/testcases/cli-test/help2man/oe_test_help2man.sh index 836ee03d78fbead009346c0b9388d26477c6f04d..f97d3e06e2395bad4edd2d6ac1369299166b1bdd 100644 --- a/testcases/cli-test/help2man/oe_test_help2man.sh +++ b/testcases/cli-test/help2man/oe_test_help2man.sh @@ -9,7 +9,7 @@ # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. # See the Mulan PSL v2 for more details. #################################### -#@Author : ice-ktlin +#@Author : ice-kylin #@Contact : wminid@yeah.net #@Date : 2021-07-14 23:33:33 #@License : Mulan PSL v2 diff --git a/testcases/cli-test/maven/maven-hello.tar.gz b/testcases/cli-test/maven/maven-hello.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7f2a6d719a822495e50312c57f42e04c55e79b8f Binary files /dev/null and b/testcases/cli-test/maven/maven-hello.tar.gz differ diff --git a/testcases/cli-test/maven/oe_test_maven.sh b/testcases/cli-test/maven/oe_test_maven.sh new file mode 100644 index 0000000000000000000000000000000000000000..39748f742507a4f32ee4bf035ed35f4fba721e9c --- /dev/null +++ b/testcases/cli-test/maven/oe_test_maven.sh @@ -0,0 +1,72 @@ +#!/usr/bin/bash + +# Copyright (c) 2021. Huawei Technologies Co.,Ltd.ALL rights reserved. +# This program is licensed under Mulan PSL v2. +# You can use it according to the terms and conditions of the Mulan PSL v2. +# http://license.coscl.org.cn/MulanPSL2 +# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more details. +#################################### +#@Author : fire-kylin +#@Contact : sugarkylin@foxmail.com +#@Date : 2021-07-23 +#@License : Mulan PSL v2 +#@Version : 1.0 +#@Desc : command test maven +##################################### + +source ${OET_PATH}/libs/locallibs/common_lib.sh + +function pre_test() +{ + LOG_INFO "Start to prepare the test environment." + + if java -version; then + DNF_INSTALL "maven" + else + DNF_INSTALL "maven java-11-openjdk" + fi + + tar -xzvf maven-hello.tar.gz + + LOG_INFO "End to prepare the test environment." +} + +function run_test() +{ + LOG_INFO "Start to run test." + + mvn -v + CHECK_RESULT $? 0 0 "log message: Failed to run command: mvn -v" + + cd ./maven-hello + + mvn clean build + CHECK_RESULT $? 0 0 "log message: Failed to run command: mvn clean build" + + mvn clean + CHECK_RESULT $? 0 0 "log message: Failed to run command: mvn clean" + + mvn clean compile + CHECK_RESULT $? 0 0 "log message: Failed to run command: mvn clean compile" + + mvn clean test + CHECK_RESULT $? 0 0 "log message: Failed to run command: mvn clean test" + + LOG_INFO "End to run test." +} + +function post_test() +{ + LOG_INFO "Start to restore the test environment." + + rm -rf ./maven-hello + + DNF_REMOVE + + LOG_INFO "End to restore the test environment." +} + +main "$@" diff --git a/testcases/cli-test/tpm-quote-tools/oe_test_tpm-quote-tools.sh b/testcases/cli-test/tpm-quote-tools/oe_test_tpm-quote-tools.sh new file mode 100644 index 0000000000000000000000000000000000000000..430978f61080760bfe933e28bdb4837b047e0935 --- /dev/null +++ b/testcases/cli-test/tpm-quote-tools/oe_test_tpm-quote-tools.sh @@ -0,0 +1,49 @@ +#!/usr/bin/bash + +# Copyright (c) 2021. Huawei Technologies Co.,Ltd.ALL rights reserved. +# This program is licensed under Mulan PSL v2. +# You can use it according to the terms and conditions of the Mulan PSL v2. +# http://license.coscl.org.cn/MulanPSL2 +# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more details. +#################################### +#@Author : fire-kylin +#@Contact : sugarkylin@foxmail.com +#@Date : 2021-07-23 +#@License : Mulan PSL v2 +#@Version : 1.0 +#@Desc : command test tpm-quote-tools +##################################### + +source ${OET_PATH}/libs/locallibs/common_lib.sh + +function pre_test() +{ + LOG_INFO "Start to prepare the test environment." + + DNF_INSTALL "tpm-quote-tools" + + LOG_INFO "End to prepare the test environment." +} + +function run_test() +{ + LOG_INFO "Start to run test." + + + + LOG_INFO "End to run test." +} + +function post_test() +{ + LOG_INFO "Start to restore the test environment." + + DNF_REMOVE + + LOG_INFO "End to restore the test environment." +} + +main "$@"