Commit 3aa89eb0 authored by vipwzw's avatar vipwzw

auto ci

parent deea0c8f
...@@ -57,7 +57,7 @@ if [ -n "${DAPP}" ]; then ...@@ -57,7 +57,7 @@ if [ -n "${DAPP}" ]; then
fi fi
if [ -z $DAPP ];then if [ -z $DAPP ]; then
source system-test-rpc.sh source system-test-rpc.sh
fi fi
...@@ -327,8 +327,8 @@ function base_config() { ...@@ -327,8 +327,8 @@ function base_config() {
# transfer "${CLI4}" # transfer "${CLI4}"
} }
function base_test(){ function base_test() {
if [ "$DAPP" == "" ]; then if [ "$DAPP" == "" ]; then
system_test_rpc "${1}" system_test_rpc "${1}"
fi fi
...@@ -353,7 +353,7 @@ function main() { ...@@ -353,7 +353,7 @@ function main() {
dapp_run config dapp_run config
### test cases ### ### test cases ###
ip=$(${CLI} net info|jq -r ".externalAddr[0:10]") ip=$(${CLI} net info | jq -r ".externalAddr[0:10]")
base_test "${ip}" base_test "${ip}"
dapp_run test "${ip}" dapp_run test "${ip}"
......
...@@ -2,31 +2,30 @@ ...@@ -2,31 +2,30 @@
MAIN_HTTP="" MAIN_HTTP=""
# $2=0 means true, other false # $2=0 means true, other false
echo_rst(){ echo_rst() {
if [ "$2" -eq 0 ];then if [ "$2" -eq 0 ]; then
echo "$1 ok" echo "$1 ok"
else else
echo "$1 err" echo "$1 err"
fi fi
} }
chain33_lock(){ chain33_lock() {
ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Lock","params":[]}' -H 'content-type:text/plain;' ${MAIN_HTTP} |jq -r ".result.isOK") ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Lock","params":[]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ] [ "$ok" == true ]
rst=$? rst=$?
echo_rst $FUNCNAME $rst echo_rst $FUNCNAME $rst
} }
chain33_unlock(){ chain33_unlock() {
ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} |jq -r ".result.isOK") ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ] [ "$ok" == true ]
rst=$? rst=$?
echo_rst $FUNCNAME $rst echo_rst $FUNCNAME $rst
} }
function system_test_rpc(){ function system_test_rpc() {
local ip=$1 local ip=$1
MAIN_HTTP="http://$ip:8801" MAIN_HTTP="http://$ip:8801"
echo "=========== # system rpc test =============" echo "=========== # system rpc test ============="
...@@ -36,4 +35,3 @@ function system_test_rpc(){ ...@@ -36,4 +35,3 @@ function system_test_rpc(){
} }
#system_rpc_test #system_rpc_test
...@@ -3,29 +3,29 @@ ...@@ -3,29 +3,29 @@
MAIN_HTTP="" MAIN_HTTP=""
# $2=0 means true, other false # $2=0 means true, other false
echo_rst(){ echo_rst() {
if [ "$2" -eq 0 ];then if [ "$2" -eq 0 ]; then
echo "$1 ok" echo "$1 ok"
else else
echo "$1 err" echo "$1 err"
fi fi
} }
chain33_lock(){ chain33_lock() {
ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Lock","params":[]}' -H 'content-type:text/plain;' ${MAIN_HTTP} |jq -r ".result.isOK") ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.Lock","params":[]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ] [ "$ok" == true ]
rst=$? rst=$?
echo_rst $FUNCNAME $rst echo_rst $FUNCNAME $rst
} }
chain33_unlock(){ chain33_unlock() {
ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} |jq -r ".result.isOK") ok=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.isOK")
[ "$ok" == true ] [ "$ok" == true ]
rst=$? rst=$?
echo_rst $FUNCNAME $rst echo_rst $FUNCNAME $rst
} }
function dapp_rpc_test(){ function dapp_rpc_test() {
local ip=$1 local ip=$1
MAIN_HTTP="http://$ip:8901" MAIN_HTTP="http://$ip:8901"
echo "=========== # paracross rpc test =============" echo "=========== # paracross rpc test ============="
...@@ -35,4 +35,3 @@ function dapp_rpc_test(){ ...@@ -35,4 +35,3 @@ function dapp_rpc_test(){
} }
#system_rpc_test #system_rpc_test
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment