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
deea0c8f
Commit
deea0c8f
authored
May 07, 2019
by
mdj33
Committed by
vipwzw
May 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rpc test
parent
47e16411
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
3 deletions
+95
-3
Makefile
Makefile
+1
-1
docker-compose.sh
build/docker-compose.sh
+14
-2
system-test-rpc.sh
build/system-test-rpc.sh
+39
-0
test-rpc.sh
plugin/dapp/paracross/cmd/build/test-rpc.sh
+38
-0
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+3
-0
No files found.
Makefile
View file @
deea0c8f
...
...
@@ -122,7 +122,7 @@ docker-compose: ## build docker-compose for chain33 run
@
cd
build
&&
if
!
[
-d
ci
]
;
then
\
make
-C
../
;
\
fi
;
\
./docker-compose-pre.sh modify
&&
cp
chain33
*
Dockerfile docker-compose
*
ci/
&&
cd
ci/
&&
./docker-compose-pre.sh run
$(proj)
$(dapp)
&&
cd
../..
./docker-compose-pre.sh modify
&&
cp
chain33
*
Dockerfile docker-compose
.yml
*
.sh
ci/
&&
cd
ci/
&&
./docker-compose-pre.sh run
$(proj)
$(dapp)
&&
cd
../..
docker-compose-down
:
##
build docker-compose for chain33 run
@
cd
build
&&
if
[
-d
ci
]
;
then
\
...
...
build/docker-compose.sh
View file @
deea0c8f
...
...
@@ -57,6 +57,10 @@ if [ -n "${DAPP}" ]; then
fi
if
[
-z
$DAPP
]
;
then
source
system-test-rpc.sh
fi
echo
"=========== # env setting ============="
echo
"DAPP=
$DAPP
"
echo
"DAPP_TEST_FILE=
$DAPP_TEST_FILE
"
...
...
@@ -323,9 +327,15 @@ function base_config() {
# transfer "${CLI4}"
}
function
base_test
(){
if
[
"
$DAPP
"
==
""
]
;
then
system_test_rpc
"
${
1
}
"
fi
}
function
dapp_run
()
{
if
[
-e
"
$DAPP_TEST_FILE
"
]
;
then
${
DAPP
}
"
${
CLI
}
"
"
${
1
}
"
${
DAPP
}
"
${
CLI
}
"
"
${
1
}
"
"
${
2
}
"
fi
}
...
...
@@ -343,7 +353,9 @@ function main() {
dapp_run config
### test cases ###
dapp_run
test
ip
=
$(${
CLI
}
net info|jq
-r
".externalAddr[0:10]"
)
base_test
"
${
ip
}
"
dapp_run
test
"
${
ip
}
"
### finish ###
check_docker_container
...
...
build/system-test-rpc.sh
0 → 100755
View file @
deea0c8f
#!/usr/bin/env bash
MAIN_HTTP
=
""
# $2=0 means true, other false
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"
)
[
"
$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"
)
[
"
$ok
"
==
true
]
rst
=
$?
echo_rst
$FUNCNAME
$rst
}
function
system_test_rpc
(){
local
ip
=
$1
MAIN_HTTP
=
"http://
$ip
:8801"
echo
"=========== # system rpc test ============="
echo
"ip=
$MAIN_HTTP
"
chain33_lock
chain33_unlock
}
#system_rpc_test
plugin/dapp/paracross/cmd/build/test-rpc.sh
0 → 100755
View file @
deea0c8f
#!/usr/bin/env bash
MAIN_HTTP
=
""
# $2=0 means true, other false
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"
)
[
"
$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"
)
[
"
$ok
"
==
true
]
rst
=
$?
echo_rst
$FUNCNAME
$rst
}
function
dapp_rpc_test
(){
local
ip
=
$1
MAIN_HTTP
=
"http://
$ip
:8901"
echo
"=========== # paracross rpc test ============="
echo
"ip=
$MAIN_HTTP
"
chain33_lock
chain33_unlock
}
#system_rpc_test
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
deea0c8f
...
...
@@ -14,6 +14,8 @@ if [ "$(uname)" == "Darwin" ]; then
xsedfix
=
".bak"
fi
source
test-rpc.sh
function
para_init
()
{
para_set_toml chain33.para33.toml
para_set_toml chain33.para32.toml
...
...
@@ -584,6 +586,7 @@ function paracross() {
para_set_wallet
elif
[
"
${
2
}
"
==
"test"
]
;
then
para_test
"
${
1
}
"
dapp_rpc_test
"
${
3
}
"
fi
if
[
"
${
2
}
"
==
"forkInit"
]
;
then
...
...
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