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
f114b71d
Commit
f114b71d
authored
Jun 22, 2019
by
yukang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize para rpc test case
parent
bf9bfa8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
test-rpc.sh
plugin/dapp/paracross/cmd/test/test-rpc.sh
+13
-10
No files found.
plugin/dapp/paracross/cmd/test/test-rpc.sh
View file @
f114b71d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
CASE_ERR
=
""
CASE_ERR
=
""
UNIT_HTTP
=
""
UNIT_HTTP
=
""
# shellcheck source=/dev/null
source
../dapp-test-common.sh
source
../dapp-test-common.sh
...
@@ -74,7 +75,7 @@ function paracross_Transfer_Withdraw() {
...
@@ -74,7 +75,7 @@ function paracross_Transfer_Withdraw() {
#withdraw_should 应取款金额
#withdraw_should 应取款金额
local
withdraw_should
=
13000000
local
withdraw_should
=
13000000
#fee 交易费
#fee 交易费
local
fee
=
1000000
#
local fee=1000000
#转移前余额
#转移前余额
local
para_balance_before
local
para_balance_before
#转移后余额
#转移后余额
...
@@ -122,7 +123,7 @@ function paracross_Transfer_Withdraw() {
...
@@ -122,7 +123,7 @@ function paracross_Transfer_Withdraw() {
fi
fi
else
else
#echo "para_cross_transfer_withdraw success"
#echo "para_cross_transfer_withdraw success"
let
count+
=
1
count
=
`
expr
$count
+ 1
`
;
break
break
fi
fi
done
done
...
@@ -151,7 +152,7 @@ function paracross_Transfer_Withdraw() {
...
@@ -151,7 +152,7 @@ function paracross_Transfer_Withdraw() {
fi
fi
else
else
#echo "para_cross_transfer_withdraw success"
#echo "para_cross_transfer_withdraw success"
let
count+
=
1
count
=
`
expr
$count
+ 1
`
;
break
break
fi
fi
done
done
...
@@ -178,7 +179,7 @@ function paracross_ListTitles() {
...
@@ -178,7 +179,7 @@ function paracross_ListTitles() {
local
ok
local
ok
resp
=
$(
curl
-ksd
'{"method":"paracross.ListTitles","params":[]}'
${
UNIT_HTTP
})
resp
=
$(
curl
-ksd
'{"method":"paracross.ListTitles","params":[]}'
${
UNIT_HTTP
})
echo
$resp
#
echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("titles"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("titles"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
local
rst
=
$?
local
rst
=
$?
...
@@ -190,7 +191,7 @@ function paracross_GetHeight() {
...
@@ -190,7 +191,7 @@ function paracross_GetHeight() {
local
ok
local
ok
resp
=
$(
curl
-ksd
'{"method":"paracross.GetHeight","params":[]}'
${
UNIT_HTTP
})
resp
=
$(
curl
-ksd
'{"method":"paracross.GetHeight","params":[]}'
${
UNIT_HTTP
})
echo
$resp
#
echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("consensHeight"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("consensHeight"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
local
rst
=
$?
local
rst
=
$?
...
@@ -202,7 +203,7 @@ function paracross_GetNodeGroupAddrs() {
...
@@ -202,7 +203,7 @@ function paracross_GetNodeGroupAddrs() {
local
ok
local
ok
resp
=
$(
curl
-ksd
'{"method":"paracross.GetNodeGroupAddrs","params":[{"title":"user.p.para."}]}'
${
UNIT_HTTP
})
resp
=
$(
curl
-ksd
'{"method":"paracross.GetNodeGroupAddrs","params":[{"title":"user.p.para."}]}'
${
UNIT_HTTP
})
echo
$resp
#
echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("key","value"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("key","value"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
local
rst
=
$?
local
rst
=
$?
...
@@ -214,7 +215,7 @@ function paracross_GetNodeGroupStatus() {
...
@@ -214,7 +215,7 @@ function paracross_GetNodeGroupStatus() {
local
ok
local
ok
resp
=
$(
curl
-ksd
'{"method":"paracross.GetNodeGroupStatus","params":[{"title":"user.p.para."}]}'
${
UNIT_HTTP
})
resp
=
$(
curl
-ksd
'{"method":"paracross.GetNodeGroupStatus","params":[{"title":"user.p.para."}]}'
${
UNIT_HTTP
})
echo
$resp
#
echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
local
rst
=
$?
local
rst
=
$?
...
@@ -226,7 +227,7 @@ function paracross_ListNodeGroupStatus() {
...
@@ -226,7 +227,7 @@ function paracross_ListNodeGroupStatus() {
local
ok
local
ok
resp
=
$(
curl
-ksd
'{"method":"paracross.ListNodeGroupStatus","params":[{"title":"user.p.para.","status":2}]}'
${
UNIT_HTTP
})
resp
=
$(
curl
-ksd
'{"method":"paracross.ListNodeGroupStatus","params":[{"title":"user.p.para.","status":2}]}'
${
UNIT_HTTP
})
echo
$resp
#
echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
local
rst
=
$?
local
rst
=
$?
...
@@ -238,7 +239,7 @@ function paracross_ListNodeStatus() {
...
@@ -238,7 +239,7 @@ function paracross_ListNodeStatus() {
local
ok
local
ok
resp
=
$(
curl
-ksd
'{"method":"paracross.ListNodeStatus","params":[{"title":"user.p.para.","status":4}]}'
${
UNIT_HTTP
})
resp
=
$(
curl
-ksd
'{"method":"paracross.ListNodeStatus","params":[{"title":"user.p.para.","status":4}]}'
${
UNIT_HTTP
})
echo
$resp
#
echo $resp
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result| [has("status"),true])'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
local
rst
=
$?
local
rst
=
$?
...
@@ -246,11 +247,13 @@ function paracross_ListNodeStatus() {
...
@@ -246,11 +247,13 @@ function paracross_ListNodeStatus() {
}
}
function
run_testcases
()
{
function
run_testcases
()
{
local
ispara
chain33_lock
chain33_lock
chain33_unlock
chain33_unlock
paracross_GetBlock2MainInfo
paracross_GetBlock2MainInfo
local
ispara
=
$(
echo
'"'
"
${
UNIT_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
ispara
=
$(
echo
'"'
"
${
UNIT_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
if
[
"
$ispara
"
==
true
]
;
then
if
[
"
$ispara
"
==
true
]
;
then
paracross_IsSync
paracross_IsSync
paracross_GetHeight
paracross_GetHeight
...
...
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