Commit 6fa4f8c2 authored by mdj33's avatar mdj33 Committed by vipwzw

fix linter

parent 49b19fdd
...@@ -57,7 +57,8 @@ if [ -n "${DAPP}" ]; then ...@@ -57,7 +57,8 @@ if [ -n "${DAPP}" ]; then
fi fi
if [ -z $DAPP ]; then if [ -z "$DAPP" ]; then
# shellcheck source=/dev/null
source system-test-rpc.sh source system-test-rpc.sh
fi fi
......
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2128
MAIN_HTTP=""
MAIN_HTTP="" MAIN_HTTP=""
CASE_ERR="" CASE_ERR=""
...@@ -16,19 +15,18 @@ echo_rst() { ...@@ -16,19 +15,18 @@ echo_rst() {
} }
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() {
...@@ -36,9 +34,13 @@ function system_test_rpc() { ...@@ -36,9 +34,13 @@ function system_test_rpc() {
MAIN_HTTP="http://$ip:8801" MAIN_HTTP="http://$ip:8801"
echo "=========== # system rpc test =============" echo "=========== # system rpc test ============="
echo "ip=$MAIN_HTTP" echo "ip=$MAIN_HTTP"
chain33_lock chain33_lock
chain33_unlock chain33_unlock
if [ -n "$CASE_ERR" ]; then if [ -n "$CASE_ERR" ]; then
echo "there some case error" echo "there some case error"
exit 1 exit 1
......
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2128
MAIN_HTTP="" MAIN_HTTP=""
PARA_HTTP=""
CASE_ERR="" CASE_ERR=""
# $2=0 means true, other false # $2=0 means true, other false
...@@ -15,35 +17,39 @@ echo_rst() { ...@@ -15,35 +17,39 @@ echo_rst() {
} }
paracross_GetBlock2MainInfo() { paracross_GetBlock2MainInfo() {
height=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"paracross.GetBlock2MainInfo","params":[{"start":1,"end":3}]}' -H 'content-type:text/plain;' ${MAIN_HTTP} | jq -r ".result.items[1].height") height=$(curl -s --data-binary '{"jsonrpc":"2.0","id":2,"method":"paracross.GetBlock2MainInfo","params":[{"start":1,"end":3}]}' -H 'content-type:text/plain;' ${PARA_HTTP} | jq -r ".result.items[1].height")
[ "$height" -eq 2 ] [ "$height" -eq 2 ]
rst=$? rst=$?
echo_rst $FUNCNAME $rst echo_rst "$FUNCNAME" "$rst"
} }
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:8801"
PARA_HTTP="http://$ip:8901"
echo "=========== # paracross rpc test =============" echo "=========== # paracross rpc test ============="
echo "ip=$MAIN_HTTP" echo "main_ip=$MAIN_HTTP,para_ip=$PARA_HTTP"
chain33_lock chain33_lock
chain33_unlock chain33_unlock
paracross_GetBlock2MainInfo paracross_GetBlock2MainInfo
if [ -n "$CASE_ERR" ]; then if [ -n "$CASE_ERR" ]; then
echo "paracross there some case error" echo "paracross there some case error"
exit 1 exit 1
......
...@@ -14,6 +14,7 @@ if [ "$(uname)" == "Darwin" ]; then ...@@ -14,6 +14,7 @@ if [ "$(uname)" == "Darwin" ]; then
xsedfix=".bak" xsedfix=".bak"
fi fi
# shellcheck source=/dev/null
source test-rpc.sh source test-rpc.sh
function para_init() { function para_init() {
......
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