Commit e79e9a13 authored by QM's avatar QM Committed by 33cn

test-rpc.sh add NODE3 parameter

parent e4a5b320
...@@ -6,6 +6,7 @@ DAPP_TEST_COMMON=dapp-test-common.sh ...@@ -6,6 +6,7 @@ DAPP_TEST_COMMON=dapp-test-common.sh
function dapp_test_rpc() { function dapp_test_rpc() {
local ip=$1 local ip=$1
local node3=$2
echo "============ # dapp rpc test begin =============" echo "============ # dapp rpc test begin ============="
if [ -d dapptest ]; then if [ -d dapptest ]; then
cp "$DAPP_TEST_COMMON" dapptest/ cp "$DAPP_TEST_COMMON" dapptest/
...@@ -16,7 +17,7 @@ function dapp_test_rpc() { ...@@ -16,7 +17,7 @@ function dapp_test_rpc() {
dapps=$(find . -maxdepth 1 -type d ! -name dapptest ! -name autonomy ! -name . | sed 's/^\.\///' | sort) dapps=$(find . -maxdepth 1 -type d ! -name dapptest ! -name autonomy ! -name . | sed 's/^\.\///' | sort)
echo "dapps list: $dapps" echo "dapps list: $dapps"
set +e set +e
parallel -k --jobs 40 --results outdir --joblog ./jobs.log ./{}/"${RPC_TESTFILE}" "$ip" ::: "$dapps" parallel -k --jobs 40 --results outdir --joblog ./jobs.log ./{}/"${RPC_TESTFILE}" "$ip" "$node3" ::: "$dapps"
local ret=$? local ret=$?
if [ $ret -ne 0 ]; then if [ $ret -ne 0 ]; then
wrongdapps=$(awk '{print $7,$9 }' jobs.log | grep -a 1 | awk -F '/' '{print $2}') wrongdapps=$(awk '{print $7,$9 }' jobs.log | grep -a 1 | awk -F '/' '{print $2}')
......
...@@ -469,7 +469,7 @@ function rpc_test() { ...@@ -469,7 +469,7 @@ function rpc_test() {
if [ "$DAPP" == "" ]; then if [ "$DAPP" == "" ]; then
system_test_rpc "http://${1}:8801" system_test_rpc "http://${1}:8801"
dapp_test_address "${CLI}" dapp_test_address "${CLI}"
dapp_test_rpc "http://${1}:8801" dapp_test_rpc "http://${1}:8801" "${NODE3}"
fi fi
if [ "$DAPP" == "paracross" ]; then if [ "$DAPP" == "paracross" ]; then
system_test_rpc "http://${1}:8901" system_test_rpc "http://${1}:8901"
......
...@@ -8,6 +8,7 @@ source "../x2ethereum/publicTest.sh" ...@@ -8,6 +8,7 @@ source "../x2ethereum/publicTest.sh"
sendAddress="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv" sendAddress="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
sendPriKey="0x4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01" sendPriKey="0x4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01"
MAIN_HTTP="" MAIN_HTTP=""
NODE3=""
chain33SenderAddr="14KEKbYtKKQm4wMthSK9J4La4nAiidGozt" chain33SenderAddr="14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
# validatorsAddr=["0x92c8b16afd6d423652559c6e266cbe1c29bfd84f", "0x0df9a824699bc5878232c9e612fe1a5346a5a368", "0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1", "0xd9dab021e74ecf475788ed7b61356056b2095830"] # validatorsAddr=["0x92c8b16afd6d423652559c6e266cbe1c29bfd84f", "0x0df9a824699bc5878232c9e612fe1a5346a5a368", "0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1", "0xd9dab021e74ecf475788ed7b61356056b2095830"]
ethValidatorAddrKeyA="3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e5025dc1e" ethValidatorAddrKeyA="3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e5025dc1e"
...@@ -106,6 +107,7 @@ function updata_relayer_toml_rpc() { ...@@ -106,6 +107,7 @@ function updata_relayer_toml_rpc() {
function copyErrLogs() { function copyErrLogs() {
if [ -n "$CASE_ERR" ]; then if [ -n "$CASE_ERR" ]; then
# /var/lib/jenkins
# shellcheck disable=SC2116 # shellcheck disable=SC2116
dirNameFa=$(echo ~) dirNameFa=$(echo ~)
dirName="$dirNameFa/x2ethereumlogs" dirName="$dirNameFa/x2ethereumlogs"
...@@ -119,18 +121,21 @@ function copyErrLogs() { ...@@ -119,18 +121,21 @@ function copyErrLogs() {
cp "./x2ethereum/$name/ebrelayer.log" "$dirName/rpc_ebrelayer$name.log" cp "./x2ethereum/$name/ebrelayer.log" "$dirName/rpc_ebrelayer$name.log"
done done
oldIFS=$IFS pwd
IFS=// docker cp "${NODE3}":/root/logs/chain33.log "$dirName/rpc_chain33.log"
# shellcheck disable=SC2207
arrpwd=($(pwd)) # oldIFS=$IFS
if [ ${#arrpwd[@]} -ge 3 ]; then # IFS=//
i=$((${#arrpwd[@]} - 3)) # # shellcheck disable=SC2207
# shellcheck disable=SC2116 # arrpwd=($(pwd))
# shellcheck disable=SC2086 # if [ ${#arrpwd[@]} -ge 3 ]; then
dockerName=$(echo ${arrpwd[$i]}) # i=$((${#arrpwd[@]} - 3))
docker cp "${dockerName}_chain33_1":/root/logs/chain33.log "$dirName/rpc_chain33.log" # # shellcheck disable=SC2116
fi # # shellcheck disable=SC2086
IFS=$oldIFS # dockerName=$(echo ${arrpwd[$i]})
# docker cp "${dockerName}_chain33_1":/root/logs/chain33.log "$dirName/rpc_chain33.log"
# fi
# IFS=$oldIFS
fi fi
} }
...@@ -448,7 +453,7 @@ function TestETH2Chain33Erc20() { ...@@ -448,7 +453,7 @@ function TestETH2Chain33Erc20() {
queryRelayerBalance "$req" "100" queryRelayerBalance "$req" "100"
req='{"method":"Manager.GetBalance","params":[{"owner":"'${bridgeBankAddr}'","tokenAddr":"'${tokenAddr}'"}]}' req='{"method":"Manager.GetBalance","params":[{"owner":"'${bridgeBankAddr}'","tokenAddr":"'${tokenAddr}'"}]}'
queryRelayerBalance "$req" "0" queryRelayerBalance "$req" "0.009"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -458,6 +463,7 @@ function rpc_test() { ...@@ -458,6 +463,7 @@ function rpc_test() {
set +e set +e
chain33_RpcTestBegin x2ethereum chain33_RpcTestBegin x2ethereum
MAIN_HTTP="$1" MAIN_HTTP="$1"
NODE3="$2"
echo "main_ip=$MAIN_HTTP" echo "main_ip=$MAIN_HTTP"
ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")') ispara=$(echo '"'"${MAIN_HTTP}"'"' | jq '.|contains("8901")')
...@@ -475,4 +481,4 @@ function rpc_test() { ...@@ -475,4 +481,4 @@ function rpc_test() {
chain33_RpcTestRst x2ethereum "$CASE_ERR" chain33_RpcTestRst x2ethereum "$CASE_ERR"
} }
chain33_debug_function rpc_test "$1" chain33_debug_function rpc_test "$1" "$2"
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