Commit 3aa89eb0 authored by vipwzw's avatar vipwzw

auto ci

parent deea0c8f
......@@ -57,7 +57,7 @@ if [ -n "${DAPP}" ]; then
fi
if [ -z $DAPP ];then
if [ -z $DAPP ]; then
source system-test-rpc.sh
fi
......@@ -327,7 +327,7 @@ function base_config() {
# transfer "${CLI4}"
}
function base_test(){
function base_test() {
if [ "$DAPP" == "" ]; then
system_test_rpc "${1}"
fi
......@@ -353,7 +353,7 @@ function main() {
dapp_run config
### test cases ###
ip=$(${CLI} net info|jq -r ".externalAddr[0:10]")
ip=$(${CLI} net info | jq -r ".externalAddr[0:10]")
base_test "${ip}"
dapp_run test "${ip}"
......
......@@ -2,31 +2,30 @@
MAIN_HTTP=""
# $2=0 means true, other false
echo_rst(){
if [ "$2" -eq 0 ];then
echo_rst() {
if [ "$2" -eq 0 ]; then
echo "$1 ok"
else
echo "$1 err"
fi
}
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")
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" == true ]
rst=$?
echo_rst $FUNCNAME $rst
}
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")
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" == true ]
rst=$?
echo_rst $FUNCNAME $rst
}
function system_test_rpc(){
function system_test_rpc() {
local ip=$1
MAIN_HTTP="http://$ip:8801"
echo "=========== # system rpc test ============="
......@@ -36,4 +35,3 @@ function system_test_rpc(){
}
#system_rpc_test
......@@ -3,29 +3,29 @@
MAIN_HTTP=""
# $2=0 means true, other false
echo_rst(){
if [ "$2" -eq 0 ];then
echo_rst() {
if [ "$2" -eq 0 ]; then
echo "$1 ok"
else
echo "$1 err"
fi
}
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")
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" == true ]
rst=$?
echo_rst $FUNCNAME $rst
}
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")
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" == true ]
rst=$?
echo_rst $FUNCNAME $rst
}
function dapp_rpc_test(){
function dapp_rpc_test() {
local ip=$1
MAIN_HTTP="http://$ip:8901"
echo "=========== # paracross rpc test ============="
......@@ -35,4 +35,3 @@ function dapp_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