-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from dai1975/pr/id-in-config
Change behaviors of create client, connection, and channel commands.
- Loading branch information
Showing
12 changed files
with
486 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/cases/tm2tm/scripts/test-create-channel-fail-already-created
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
RLY_BINARY=${SCRIPT_DIR}/../../../../build/yrly | ||
RLY="${RLY_BINARY} --debug" | ||
|
||
set +e | ||
expect <<EOF | ||
set timeout 5 | ||
set expect_result 0 | ||
spawn $RLY tx channel ibc01 | ||
expect { | ||
"channels are already created" { | ||
set expect_result 1 | ||
exp_continue | ||
} | ||
eof | ||
} | ||
catch wait spawn_result | ||
set ryly_result [lindex \$spawn_result 3] | ||
set r [expr \$ryly_result * 100 + \$expect_result ] | ||
exit \$r | ||
EOF | ||
|
||
r=$? | ||
|
||
if [ $r -eq 1 ]; then | ||
echo "$(basename $0): success" | ||
exit 0 | ||
else | ||
echo "$(basename $0): fail: $r" | ||
exit 1 | ||
fi |
44 changes: 44 additions & 0 deletions
44
tests/cases/tm2tm/scripts/test-create-channel-fail-unexist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
RLY_BINARY=${SCRIPT_DIR}/../../../../build/yrly | ||
RLY="${RLY_BINARY} --debug" | ||
CONFIG=$HOME/.yui-relayer/config/config.json | ||
|
||
cp $CONFIG $CONFIG.tmp | ||
cat $CONFIG.tmp \ | ||
| jq '.paths.ibc01.src["channel-id"] |= "channel-999"' \ | ||
| jq '.paths.ibc01.dst["channel-id"] |= "channel-999"' \ | ||
> $CONFIG | ||
|
||
set +e | ||
expect <<EOF | ||
set timeout 5 | ||
set expect_result 0 | ||
spawn $RLY tx channel ibc01 | ||
expect { | ||
"src channel id is given but that channel does not exist" { | ||
set expect_result 1 | ||
exp_continue | ||
} | ||
eof | ||
} | ||
catch wait spawn_result | ||
set ryly_result [lindex \$spawn_result 3] | ||
set r [expr \$ryly_result * 100 + \$expect_result ] | ||
exit \$r | ||
EOF | ||
|
||
r=$? | ||
|
||
if [ $r -eq 101 ]; then | ||
echo "$(basename $0): success" | ||
cp $CONFIG.tmp $CONFIG | ||
exit 0 | ||
else | ||
echo "$(basename $0): fail: $r" | ||
exit 1 | ||
fi | ||
|
35 changes: 35 additions & 0 deletions
35
tests/cases/tm2tm/scripts/test-create-client-fail-already-created
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
RLY_BINARY=${SCRIPT_DIR}/../../../../build/yrly | ||
RLY="${RLY_BINARY} --debug" | ||
|
||
set +e | ||
expect <<EOF | ||
set timeout 5 | ||
set expect_result 0 | ||
spawn $RLY tx clients --src-height 2 ibc01 | ||
expect { | ||
"clients are already created" { | ||
set expect_result 1 | ||
exp_continue | ||
} | ||
eof | ||
} | ||
catch wait spawn_result | ||
set ryly_result [lindex \$spawn_result 3] | ||
set r [expr \$ryly_result * 100 + \$expect_result ] | ||
exit \$r | ||
EOF | ||
|
||
r=$? | ||
|
||
if [ $r -eq 1 ]; then | ||
echo "$(basename $0): success" | ||
exit 0 | ||
else | ||
echo "$(basename $0): fail: $r" | ||
exit 1 | ||
fi |
Oops, something went wrong.