Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
2684df0c
Commit
2684df0c
authored
Oct 11, 2019
by
mdj33
Committed by
vipwzw
Oct 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add debug info
parent
232e56e2
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
101 additions
and
283 deletions
+101
-283
dapp-test-common.sh
build/dapp-test-common.sh
+15
-2
build.sh
plugin/dapp/autonomy/cmd/build.sh
+1
-5
test-rpc.sh
plugin/dapp/autonomy/cmd/test/test-rpc.sh
+4
-6
build.sh
plugin/dapp/blackwhite/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/blackwhite/cmd/test/test-rpc.sh
+3
-4
build.sh
plugin/dapp/dposvote/cmd/build.sh
+2
-5
test-rpc.sh
plugin/dapp/dposvote/cmd/test/test-rpc.sh
+2
-9
build.sh
plugin/dapp/evm/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/evm/cmd/test/test-rpc.sh
+3
-7
build.sh
plugin/dapp/game/cmd/build.sh
+2
-11
test-rpc.sh
plugin/dapp/game/cmd/test/test-rpc.sh
+2
-10
build.sh
plugin/dapp/guess/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/guess/cmd/test/test-rpc.sh
+2
-9
build.sh
plugin/dapp/hashlock/cmd/build.sh
+1
-7
test-rpc.sh
plugin/dapp/hashlock/cmd/test/test-rpc.sh
+2
-7
build.sh
plugin/dapp/js/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/js/cmd/test/test-rpc.sh
+4
-12
build.sh
plugin/dapp/lottery/cmd/build.sh
+1
-5
test-rpc.sh
plugin/dapp/lottery/cmd/test/test-rpc.sh
+2
-8
build.sh
plugin/dapp/multisig/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/multisig/cmd/test/test-rpc.sh
+2
-9
build.sh
plugin/dapp/oracle/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/oracle/cmd/test/test-rpc.sh
+2
-8
test-rpc.sh
plugin/dapp/paracross/cmd/test/test-rpc.sh
+2
-5
build.sh
plugin/dapp/pokerbull/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/pokerbull/cmd/test/test-rpc.sh
+2
-7
build.sh
plugin/dapp/privacy/cmd/build.sh
+1
-6
fork-test.sh
plugin/dapp/privacy/cmd/test/fork-test.sh
+0
-0
test-rpc.sh
plugin/dapp/privacy/cmd/test/test-rpc.sh
+19
-34
test-rpc.sh
plugin/dapp/relay/cmd/test/test-rpc.sh
+2
-6
build.sh
plugin/dapp/retrieve/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/retrieve/cmd/test/test-rpc.sh
+2
-7
build.sh
plugin/dapp/ticket/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/ticket/cmd/test/test-rpc.sh
+3
-8
build.sh
plugin/dapp/token/cmd/build.sh
+1
-5
test-rpc.sh
plugin/dapp/token/cmd/test/test-rpc.sh
+3
-7
build.sh
plugin/dapp/trade/cmd/build.sh
+1
-6
test-rpc.sh
plugin/dapp/trade/cmd/test/test-rpc.sh
+2
-7
build.sh
plugin/dapp/unfreeze/cmd/build.sh
+1
-1
test-rpc.sh
plugin/dapp/unfreeze/cmd/test/test-rpc.sh
+3
-6
No files found.
build/dapp-test-common.sh
View file @
2684df0c
...
...
@@ -14,8 +14,6 @@ echo_rst() {
echo
-e
"
${
GRE
}
$1
ok
${
NOC
}
"
elif
[
"
$2
"
-eq
2
]
;
then
echo
-e
"
${
GRE
}
$1
not support
${
NOC
}
"
CASE_ERR
=
"err"
echo
$CASE_ERR
else
echo
-e
"
${
RED
}
$1
fail
${
NOC
}
"
CASE_ERR
=
"err"
...
...
@@ -185,6 +183,21 @@ chain33_applyCoins() {
}
chain33_RpcTestBegin
()
{
echo
-e
"
${
GRE
}
======
$1
Rpc Test Begin ===========
${
NOC
}
"
}
chain33_RpcTestRst
()
{
if
[
-n
"
$2
"
]
;
then
echo
-e
"
${
RED
}
======
$1
Rpc Test Fail ===========
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
======
$1
Rpc Test Pass ===========
${
NOC
}
"
fi
}
chain33_debug_function
()
{
set
-x
eval
"
$@
"
...
...
plugin/dapp/autonomy/cmd/build.sh
View file @
2684df0c
...
...
@@ -5,12 +5,8 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
output_dir
}
/
$strapp
"
[
!
-e
"
${
OUT_DIR
}
"
]
&&
mkdir
-p
"
${
OUT_DIR
}
"
# shellcheck disable=SC2086
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test/
*
"
${
OUT_TESTDIR
}
"
plugin/dapp/autonomy/cmd/
build
/test-rpc.sh
→
plugin/dapp/autonomy/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -18,18 +18,16 @@ function debug_function() {
}
function
rpc_test
()
{
chain33_RpcTestBegin autonomy
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
init
run_testcases
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
"=======autonomy rpc test error ==========="
exit
1
else
echo
"====== autonomy rpc test pass ==========="
fi
chain33_RpcTestRst autonomy
"
$CASE_ERR
"
}
debug_function rpc_test
"
$1
"
plugin/dapp/blackwhite/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/blackwhite/cmd/
build
/test-rpc.sh
→
plugin/dapp/blackwhite/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -207,6 +207,7 @@ function run_testcases() {
}
function
main
()
{
chain33_RpcTestBegin blackwhite
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
...
...
@@ -214,10 +215,8 @@ function main() {
run_testcases
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
"paracross there some case error"
exit
1
fi
chain33_RpcTestRst blackwhite
"
$CASE_ERR
"
}
function
debug_function
()
{
...
...
plugin/dapp/dposvote/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,13 +3,10 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
chmod
+x ./build/test-rpc.sh
cp
./build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./test/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/dposvote/cmd/
build
/test-rpc.sh
→
plugin/dapp/dposvote/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -29,21 +29,14 @@ function run_test() {
}
function
main
()
{
chain33_RpcTestBegin dposvote
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
init
echo
"=========== # dposvote rpc test start============="
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Dposvote Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Dposvote Rpc Test Pass==============
${
NOC
}
"
fi
echo
"=========== # dposvote rpc test end============="
chain33_RpcTestRst dposvote
"
$CASE_ERR
"
}
main
"
$1
"
plugin/dapp/evm/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,13 +3,8 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
chmod
+x ./build/test-rpc.sh
cp
./build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./test/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/evm/cmd/
build
/test-rpc.sh
→
plugin/dapp/evm/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -242,20 +242,16 @@ function run_test() {
}
function
main
()
{
chain33_RpcTestBegin evm
local
ip
=
$1
MAIN_HTTP
=
$ip
echo
"=========== # evm rpc test ============="
echo
"main_ip=
$MAIN_HTTP
"
init
run_test
"
$MAIN_HTTP
"
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Evm Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Evm Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst evm
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/game/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,16 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
PARACLI
=
"
${
OUT_DIR
}
/chain33-para-cli"
PARANAME
=
para
SRC_CLI
=
github.com/33cn/plugin/cli
go build
-v
-o
"
${
PARACLI
}
"
-ldflags
"-X
${
SRC_CLI
}
/buildflags.ParaName=user.p.
${
PARANAME
}
. -X
${
SRC_CLI
}
/buildflags.RPCAddr=http://localhost:8901"
"
${
SRC_CLI
}
"
# shellcheck disable=SC2086
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/
*
"
${
OUT_TESTDIR
}
"
cp
./
test
/
*
"
${
OUT_TESTDIR
}
"
plugin/dapp/game/cmd/
build
/test-rpc.sh
→
plugin/dapp/game/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -3,9 +3,6 @@
set
-e
set
-o
pipefail
# shellcheck source=/dev/null
source
../dapp-test-common.sh
MAIN_HTTP
=
""
GAME_ID
=
""
PASSWD
=
"ABCD"
...
...
@@ -215,18 +212,13 @@ function run_test() {
function
main
()
{
local
ip
=
$1
MAIN_HTTP
=
$ip
echo
"=========== # game rpc test ============="
chain33_RpcTestBegin game
echo
"main_ip=
$MAIN_HTTP
"
init
run_test
"
$MAIN_HTTP
"
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============game Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============game Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst game
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/guess/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,13 +3,8 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
chmod
+x ./build/test-rpc.sh
cp
./build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./test/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/guess/cmd/
build
/test-rpc.sh
→
plugin/dapp/guess/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -319,21 +319,14 @@ function run_test() {
}
function
main
()
{
chain33_RpcTestBegin guess
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
init
echo
"=========== # guess rpc test start============="
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Guess Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Guess Rpc Test Pass==============
${
NOC
}
"
fi
echo
"=========== # guess rpc test end============="
chain33_RpcTestRst guess
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/hashlock/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,13 +3,7 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
chmod
+x ./build/test-rpc.sh
cp
./build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./test/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/hashlock/cmd/
build
/test-rpc.sh
→
plugin/dapp/hashlock/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -141,18 +141,13 @@ function run_test() {
function
main
()
{
MAIN_HTTP
=
"
$1
"
echo
"=========== # Hashlock rpc test ============="
chain33_RpcTestBegin hashlock
echo
"ip=
$MAIN_HTTP
"
init
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Hashlock Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Hashlock Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst hashlock
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/js/cmd/build.sh
View file @
2684df0c
...
...
@@ -5,13 +5,8 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
output_dir
}
/
$strapp
"
[
!
-e
"
${
OUT_DIR
}
"
]
&&
mkdir
-p
"
${
OUT_DIR
}
"
# shellcheck disable=SC2086
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
../executor/test.js
"
${
OUT_TESTDIR
}
"
plugin/dapp/js/cmd/
build
/test-rpc.sh
→
plugin/dapp/js/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -94,25 +94,17 @@ function run_testcases() {
queryJS
}
function
debug_function
()
{
set
-x
eval
"
$@
"
set
+x
}
function
rpc_test
()
{
chain33_RpcTestBegin js
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
init
run_testcases
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
"=======js rpc test error ==========="
exit
1
else
echo
"====== js rpc test pass ==========="
fi
chain33_RpcTestRst js
"
$CASE_ERR
"
}
rpc_test
"
$1
"
chain33_debug_function
rpc_test
"
$1
"
plugin/dapp/lottery/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,8 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/lottery/cmd/
build
/test-rpc.sh
→
plugin/dapp/lottery/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -315,17 +315,11 @@ function main() {
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
echo
"=========== # lottery rpc test start============="
chain33_RpcTestBegin lottery
init
run_testcases
if
[[
-n
$CASE_ERR
]]
;
then
echo
-e
"
${
RED
}
=============Lottery Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Lottery Rpc Test Pass==============
${
NOC
}
"
fi
echo
"=========== # lottery rpc test end============="
chain33_RpcTestRst lottery
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/multisig/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/multisig/cmd/
build
/test-rpc.sh
→
plugin/dapp/multisig/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -250,21 +250,14 @@ function run_test() {
}
function
main
()
{
chain33_RpcTestBegin multisi
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
init
echo
"=========== # multisi rpc test start============="
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============multisi Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============multisi Rpc Test Pass==============
${
NOC
}
"
fi
echo
"=========== # multisi rpc test end============="
chain33_RpcTestRst multisi
"
$CASE_ERR
"
}
main
"
$1
"
plugin/dapp/oracle/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,13 +3,8 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
chmod
+x ./build/test-rpc.sh
cp
./build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./test/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/oracle/cmd/
build
/test-rpc.sh
→
plugin/dapp/oracle/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -138,16 +138,10 @@ function main() {
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
echo
"=========== # oracle rpc test start============="
chain33_RpcTestBegin oracle
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Oracle Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Oracle Rpc Test Pass==============
${
NOC
}
"
fi
echo
"=========== # oracle rpc test end============="
chain33_RpcTestRst oracle
"
$CASE_ERR
"
}
main
"
$1
"
plugin/dapp/paracross/cmd/test/test-rpc.sh
View file @
2684df0c
...
...
@@ -372,7 +372,7 @@ function run_testcases() {
}
function
main
()
{
chain33_RpcTestBegin paracross
UNIT_HTTP
=
$1
IS_PARA
=
$(
echo
'"'
"
${
UNIT_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
...
...
@@ -398,10 +398,7 @@ function main() {
fi
fi
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
"paracross there some case errors"
exit
1
fi
chain33_RpcTestRst paracross
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
"
$2
"
"
$3
"
"
$4
"
...
...
plugin/dapp/pokerbull/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/pokerbull/cmd/
build
/test-rpc.sh
→
plugin/dapp/pokerbull/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -159,19 +159,14 @@ function run_test() {
}
function
main
()
{
chain33_RpcTestBegin pokerbull
MAIN_HTTP
=
"
$1
"
echo
"=========== # pokerbull rpc test ============="
echo
"ip=
$MAIN_HTTP
"
init
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Pokerbull Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Pokerbull Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst pokerbull
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/privacy/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/privacy/cmd/
build
/fork-test.sh
→
plugin/dapp/privacy/cmd/
test
/fork-test.sh
View file @
2684df0c
File moved
plugin/dapp/privacy/cmd/
build
/test-rpc.sh
→
plugin/dapp/privacy/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -3,23 +3,11 @@
set
-e
set
-o
pipefail
MAIN_HTTP
=
""
CASE_ERR
=
""
# shellcheck source=/dev/null
source
../dapp-test-common.sh
#color
RED
=
'\033[1;31m'
GRE
=
'\033[1;32m'
NOC
=
'\033[0m'
MAIN_HTTP
=
""
echo_rst
()
{
if
[
"
$2
"
==
true
]
;
then
echo
-e
"
${
GRE
}
$1
ok
${
NOC
}
"
else
echo
-e
"
${
RED
}
$1
fail
${
NOC
}
"
CASE_ERR
=
"FAIL"
fi
}
privacy_CreateRawTransaction
()
{
...
...
@@ -29,7 +17,8 @@ privacy_CreateRawTransaction() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'.error|not'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
}
privacy_GetPrivacyTxByAddr
()
{
...
...
@@ -40,8 +29,8 @@ privacy_GetPrivacyTxByAddr() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'.error|not'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$
ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$
?
"
}
privacy_ShowPrivacyKey
()
{
...
...
@@ -52,8 +41,8 @@ privacy_ShowPrivacyKey() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and .result.showSuccessful and (.result.pubkeypair=="0a9d212b2505aefaa8da370319088bbccfac097b007f52ed71d8133456c8185823c8eac43c5e937953d7b6c8e68b0db1f4f03df4946a29f524875118960a35fb")'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$
ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$
?
"
}
privacy_ShowPrivacyAccountInfo
()
{
...
...
@@ -64,8 +53,8 @@ privacy_ShowPrivacyAccountInfo() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and (.result|[has("utxos", "ftxos", "displaymode"), true] | unique | length == 1)'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$
ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$
?
"
}
privacy_ShowPrivacyAccountSpend
()
{
...
...
@@ -76,8 +65,8 @@ privacy_ShowPrivacyAccountSpend() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and .result.utxoHaveTxHashs'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$
ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$
?
"
}
privacy_RescanUtxos
()
{
...
...
@@ -88,8 +77,8 @@ privacy_RescanUtxos() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and (.result|[has("flag", "repRescanResults"), true] | unique | length == 1)'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$
ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$
?
"
}
privacy_EnablePrivacy
()
{
...
...
@@ -100,7 +89,8 @@ privacy_EnablePrivacy() {
resp
=
$(
curl
-ksd
"{
$req
}"
"
$ip
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and .result.results[0].IsOK'
<<<
"
$resp
"
)
echo_rst
"
$FUNCNAME
"
"
$ok
"
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
}
function
run_test
()
{
...
...
@@ -116,17 +106,12 @@ function run_test() {
}
function
main
()
{
MAIN_HTTP
=
"
$1
"
echo
"=========== # privacy rpc test ============="
chain33_RpcTestBegin privacy
echo
"ip=
$MAIN_HTTP
"
run_test
"
$MAIN_HTTP
"
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Privacy Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Prviacy Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst privacy
"
$CASE_ERR
"
}
main
"
$1
"
plugin/dapp/relay/cmd/test/test-rpc.sh
View file @
2684df0c
...
...
@@ -242,18 +242,14 @@ function run_testcases() {
}
function
rpc_test
()
{
chain33_RpcTestBegin Relay
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
init
run_testcases
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Relay Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Relay Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst Relay
"
$CASE_ERR
"
}
chain33_debug_function rpc_test
"
$1
"
plugin/dapp/retrieve/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/retrieve/cmd/
build
/test-rpc.sh
→
plugin/dapp/retrieve/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -245,18 +245,13 @@ function run_test() {
function
main
()
{
MAIN_HTTP
=
"
$1
"
echo
"=========== # retrieve rpc test ============="
chain33_RpcTestBegin retrieve
echo
"ip=
$MAIN_HTTP
"
init
run_test
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============retrieve Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============retrieve Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst retrieve
"
$CASE_ERR
"
}
set
-x
...
...
plugin/dapp/ticket/cmd/build.sh
View file @
2684df0c
...
...
@@ -4,12 +4,7 @@ strpwd=$(pwd)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/ticket/cmd/
build
/test-rpc.sh
→
plugin/dapp/ticket/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -149,10 +149,11 @@ function run_testcases() {
}
function
main
()
{
chain33_RpcTestBegin Ticket
MAIN_HTTP
=
"
$1
"
echo
"main_ip=
$MAIN_HTTP
"
echo
"=========== # ticket rpc test start============="
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
if
[[
$ispara
==
true
]]
;
then
...
...
@@ -161,13 +162,7 @@ function main() {
run_testcases
fi
if
[[
-n
$CASE_ERR
]]
;
then
echo
-e
"
${
RED
}
=============Ticket Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Ticket Rpc Test Pass==============
${
NOC
}
"
fi
echo
"=========== # ticket rpc test end============="
chain33_RpcTestRst Ticket
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/token/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,12 +3,8 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/token/cmd/
build
/test-rpc.sh
→
plugin/dapp/token/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -276,19 +276,15 @@ function run_test() {
function
main
()
{
local
ip
=
$1
chain33_RpcTestBegin token
MAIN_HTTP
=
$ip
echo
"=========== # token rpc test ============="
echo
"main_ip=
$MAIN_HTTP
"
init
run_test
"
$ip
"
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============Token Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============Token Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst token
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/trade/cmd/build.sh
View file @
2684df0c
...
...
@@ -3,13 +3,8 @@
strpwd
=
$(
pwd
)
strcmd
=
${
strpwd
##*dapp/
}
strapp
=
${
strcmd
%/cmd*
}
OUT_DIR
=
"
${
1
}
/
$strapp
"
#FLAG=$2
mkdir
-p
"
${
OUT_DIR
}
"
cp
./build/
*
"
${
OUT_DIR
}
"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
chmod
+x ./build/test-rpc.sh
cp
./build/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./test/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/trade/cmd/
build
/test-rpc.sh
→
plugin/dapp/trade/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -339,19 +339,14 @@ function run_test() {
function
main
()
{
local
ip
=
$1
chain33_RpcTestBegin trade
MAIN_HTTP
=
$ip
echo
"=========== # trade rpc test ============="
echo
"main_ip=
$MAIN_HTTP
"
init
run_test
"
$MAIN_HTTP
"
if
[
-n
"
$CASE_ERR
"
]
;
then
echo
-e
"
${
RED
}
=============trade Rpc Test Fail=============
${
NOC
}
"
exit
1
else
echo
-e
"
${
GRE
}
=============trade Rpc Test Pass==============
${
NOC
}
"
fi
chain33_RpcTestRst trade
"
$CASE_ERR
"
}
chain33_debug_function main
"
$1
"
plugin/dapp/unfreeze/cmd/build.sh
View file @
2684df0c
...
...
@@ -13,4 +13,4 @@ cp ./build/* "${OUT_DIR}"
OUT_TESTDIR
=
"
${
1
}
/dapptest/
$strapp
"
mkdir
-p
"
${
OUT_TESTDIR
}
"
cp
./
build
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
cp
./
test
/test-rpc.sh
"
${
OUT_TESTDIR
}
"
plugin/dapp/unfreeze/cmd/
build
/test-rpc.sh
→
plugin/dapp/unfreeze/cmd/
test
/test-rpc.sh
View file @
2684df0c
...
...
@@ -149,18 +149,15 @@ function debug_function() {
}
function rpc_test() {
chain33_RpcTestBegin unfreeze
MAIN_HTTP="
$1
"
echo "
main_ip
=
$MAIN_HTTP
"
init
run_testcases
if [ -n "
$CASE_ERR
" ]; then
echo "
=======unfreeze rpc test error ===========
"
exit 1
else
echo "
====== unfreeze rpc test pass ===========
"
fi
chain33_RpcTestRst unfreeze "
$CASE_ERR
"
}
debug_function rpc_test "
$1
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment