提交 7590c33b 编写于 作者: Z zhangtaibo

atune-adm script added to master

上级 d3db871c
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm check cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm check cmd test"
# Check cmd function
atune-adm check > temp.log
check_result $? 0
grep "FAILED" temp.log
check_result $? 1
# Help info
atune-adm check -h > temp.log
grep "check system basic information" temp.log
check_result $? 0
# Extra input
atune-adm check extra_input > temp.log
grep "Incorrect Usage." temp.log
check_result $? 0
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm help cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm help cmd test"
array=("help" "--help" "-h" "")
for ((i=0;i<${#array[@]};i++));do
atune-adm ${array[i]} > temp.log
check_result $? 0
grep "atune-adm - atune-adm is a command line client for atuned AI tuning system" temp.log
check_result $? 0
done
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm info cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm info cmd test"
# Check all the supported workload
for ((i=0;i<${#ARRAY_WORKLOADTYPE[@]};i++));do
atune-adm info ${ARRAY_WORKLOADTYPE[i]} > temp.log
check_result $? 0
grep ".*A-Tune configuration" temp.log
check_result $? 0
done
# Help info
atune-adm info -h > temp.log
grep "display profile info corresponding to WORKLOAD_TYPE" temp.log
check_result $? 0
# The value of the Workload name is special character and ultra long character
array=("$SPECIAL_CHARACTERS" "$ULTRA_LONG_CHARACTERS")
for ((i=0;i<${#array[@]};i++));do
atune-adm info ${array[i]} >& temp.log
check_result $? 1
grep ".* is not exist in the class_profile table" temp.log
check_result $? 0
done
# Workload name is null
atune-adm info > temp.log
grep "Incorrect Usage." temp.log
check_result $? 0
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm list cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm list cmd test"
# Check all supported workload were listed
atune-adm list > temp.log
for ((i=0;i<${#ARRAY_WORKLOADTYPE[@]};i++));do
grep "${ARRAY_WORKLOADTYPE[i]}" temp.log
check_result $? 0
done
# Help info
atune-adm list -h > temp.log
grep "list current support workload type" temp.log
check_result $? 0
# Extra input
atune-adm list extra_input > temp.log
grep "Incorrect Usage." temp.log
check_result $? 0
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm profile cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm profile cmd test"
# Check all the supported workload
for ((i=0;i<${#ARRAY_WORKLOADTYPE[@]};i++));do
atune-adm profile ${ARRAY_WORKLOADTYPE[i]} >& temp.log
check_result $? 0
grep "FAILED" temp.log
check_result $? 1
atune-adm list > temp.log
grep ${ARRAY_WORKLOADTYPE[i]} temp.log | grep true
check_result $? 0
done
# Help info
atune-adm profile -h > temp.log
grep "active the specified workload_type,for example,avtive the idle workload type." temp.log
check_result $? 0
# The value of the Workload name is special character and ultra long character
array=("$SPECIAL_CHARACTERS" "$ULTRA_LONG_CHARACTERS")
for ((i=0;i<${#array[@]};i++));do
atune-adm profile ${array[i]} >& temp.log
check_result $? 1
grep "load profile .* Faild" temp.log
check_result $? 0
done
# Workload name is null
atune-adm profile > temp.log
grep "Incorrect Usage." temp.log
check_result $? 0
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm rollback cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm rollback cmd test"
# Check rollback function
atune-adm rollback
check_result $? 0
# There is no activated profile
atune-adm list > temp.log
cat temp.log | awk -F '|' '{print $4}' | grep true
check_result $? 1
# Help info
atune-adm rollback -h > temp.log
grep "rollback the system config to the init state" temp.log
check_result $? 0
# Extra input
atune-adm rollback extra_input > temp.log
grep "Incorrect Usage." temp.log
check_result $? 0
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
#
# A-Tune is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
# THIS SOFTWARE 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 v1 for more details.
# Create: 2020-01-09
# Author: zhangtaibo <sonice1755@163.com>
export TCID="atune-adm version cmd test"
. ./test_lib.sh
init()
{
echo "init the sysytem"
}
cleanup()
{
echo "===================="
echo "Clean the System"
echo "===================="
rm -rf temp.log
}
test01()
{
tst_resm TINFO "atune-adm version cmd test"
array=("--version" "-v")
for ((i=0;i<${#array[@]};i++));do
atune-adm ${array[i]} > temp.log
check_result $? 0
grep "atune-adm version *" temp.log
check_result $? 0
done
if [ $EXIT_FLAG -ne 0 ];then
tst_resm TFAIL
else
tst_resm TPASS
fi
}
TST_CLEANUP=cleanup
init
test01
tst_exit
......@@ -25,6 +25,8 @@ SPECIAL_CHARACTERS="~\!@#%^*"
# 4096 CHARACTERS
ULTRA_LONG_CHARACTERS="0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
ARRAY_WORKLOADTYPE=("default" "webserver" "big_database" "big_data" "in-memory_computing" "in-memory_database" "single_computer_intensive_jobs" "communication" "idle")
tst_resm()
{
......@@ -82,7 +84,7 @@ function change_conf_value()
echo "You have to input a key name"
return 1
fi
local value=$2
local value=`echo ${@:2}`
local curr_value=$(get_conf_value $key)
if [ "x$curr_value" == "x$value" ];then
echo "The $key's value had already been set to $value"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册