Skip to content

Commit b2ac10c

Browse files
committed
#303 Upgrade Cosmos-SDK to v0.47.8
- Enable light-client-proxy tests Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com> Signed-off-by: Abdulbois <abdulbois123@gmail.com>
1 parent 75c2f3d commit b2ac10c

File tree

9 files changed

+36
-30
lines changed

9 files changed

+36
-30
lines changed

.github/actions/setup-molecule/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ runs:
2424
steps:
2525
- uses: actions/setup-python@v3
2626
with:
27-
python-version: '3.x'
27+
python-version: '3.10'
2828
- name: install dependencies
2929
shell: bash
3030
run: pip install -r deployment/test-requirements.txt

deployment/ansible/roles/bootstrap/defaults/main.yml

-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
16-

integration_tests/light_client_proxy/auth.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test_divider
1919

2020
# connect to light client proxy
2121
dcld config node tcp://localhost:26620
22-
sleep 20
22+
sleep 10
2323

2424
echo "Query non existent account"
2525
result=$(execute_with_retry "dcld query auth account --address=$user_address")

integration_tests/light_client_proxy/compliance.sh

100644100755
+4-4
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ cd_certificate_id="123"
1919
echo "Query non existent complianceinfo"
2020
result=$(execute_with_retry "dcld query compliance compliance-info --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
2121
echo "$result"
22-
#check_response "$result" "Not Found"
22+
check_response "$result" "Not Found"
2323

2424
test_divider
2525

2626
echo "Query non existent certified"
2727
result=$(execute_with_retry "dcld query compliance certified-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
2828
echo "$result"
29-
#check_response "$result" "Not Found"
29+
check_response "$result" "Not Found"
3030

3131
test_divider
3232

3333
echo "Query non existent revoked"
3434
result=$(execute_with_retry "dcld query compliance revoked-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
3535
echo "$result"
36-
#check_response "$result" "Not Found"
36+
check_response "$result" "Not Found"
3737

3838
test_divider
3939

4040
echo "Query non existent provision"
4141
result=$(execute_with_retry "dcld query compliance provisional-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"")
4242
echo "$result"
43-
#check_response "$result" "Not Found"
43+
check_response "$result" "Not Found"
4444

4545
test_divider
4646

integration_tests/light_client_proxy/model.sh

100644100755
File mode changed.

integration_tests/light_client_proxy/pki.sh

+7
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ test_divider
140140
echo "$vendor_account (Not Trustee) propose Root certificate"
141141
root_path="integration_tests/constants/root_cert"
142142
result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --vid $vid --from $vendor_account --yes)
143+
result=$(get_txn_result "$result")
143144
response_does_not_contain "$result" "\"code\": 0"
144145
echo "$result"
145146

@@ -148,13 +149,15 @@ test_divider
148149
echo "$trustee_account (Trustee) propose Root certificate"
149150
root_path="integration_tests/constants/root_cert"
150151
result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --vid $vid --from $trustee_account --yes)
152+
result=$(get_txn_result "$result")
151153
check_response "$result" "\"code\": 0"
152154
echo "$result"
153155

154156
test_divider
155157

156158
echo "$second_trustee_account (Trustee) approve Root certificate"
157159
result=$(echo "$passphrase" | dcld tx pki approve-add-x509-root-cert --subject="$root_cert_subject" --subject-key-id="$root_cert_subject_key_id" --from $second_trustee_account --yes)
160+
result=$(get_txn_result "$result")
158161
check_response "$result" "\"code\": 0"
159162
echo "$result"
160163

@@ -163,6 +166,7 @@ test_divider
163166
echo "$vendor_account (Vendor) add Intermediate certificate"
164167
intermediate_path="integration_tests/constants/intermediate_cert"
165168
result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$intermediate_path" --from $vendor_account --yes)
169+
result=$(get_txn_result "$result")
166170
check_response "$result" "\"code\": 0"
167171
echo "$result"
168172

@@ -171,20 +175,23 @@ test_divider
171175
echo "$vendor_account (Vendor) add Leaf certificate"
172176
leaf_path="integration_tests/constants/leaf_cert"
173177
result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$leaf_path" --from $vendor_account --yes)
178+
result=$(get_txn_result "$result")
174179
check_response "$result" "\"code\": 0"
175180
echo "$result"
176181

177182
test_divider
178183

179184
echo "$vendor_account (Vendor) revokes Leaf certificate."
180185
result=$(echo "$passphrase" | dcld tx pki revoke-x509-cert --subject="$leaf_cert_subject" --subject-key-id="$leaf_cert_subject_key_id" --from=$vendor_account --yes)
186+
result=$(get_txn_result "$result")
181187
check_response "$result" "\"code\": 0"
182188
echo "$result"
183189

184190
test_divider
185191

186192
echo "$trustee_account (Trustee) proposes to revoke Root certificate"
187193
result=$(echo "$passphrase" | dcld tx pki propose-revoke-x509-root-cert --subject="$root_cert_subject" --subject-key-id="$root_cert_subject_key_id" --from $trustee_account --yes)
194+
result=$(get_txn_result "$result")
188195
check_response "$result" "\"code\": 0"
189196
echo "$result"
190197

integration_tests/light_client_proxy/vendorinfo.sh

100644100755
File mode changed.

integration_tests/run-all.sh

+22-21
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,28 @@ make image &>${DETAILED_OUTPUT_TARGET}
105105

106106
cleanup_pool
107107

108+
# Light Client Proxy Cli shell tests
109+
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
110+
CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort)
111+
112+
for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
113+
init_pool
114+
115+
log "*****************************************************************************************"
116+
log "Running $CLI_SHELL_TEST"
117+
log "*****************************************************************************************"
118+
119+
if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
120+
log "$CLI_SHELL_TEST finished successfully"
121+
else
122+
log "$CLI_SHELL_TEST failed"
123+
exit 1
124+
fi
125+
126+
cleanup_pool
127+
done
128+
fi
129+
108130
# Cli shell tests
109131
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
110132
CLI_SHELL_TESTS=$(find integration_tests/cli -type f -name '*.sh' -not -name "common.sh")
@@ -127,27 +149,6 @@ if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then
127149
done
128150
fi
129151

130-
# Light Client Proxy Cli shell tests
131-
# if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then
132-
# CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort)
133-
134-
# for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do
135-
# init_pool
136-
137-
# log "*****************************************************************************************"
138-
# log "Running $CLI_SHELL_TEST"
139-
# log "*****************************************************************************************"
140-
141-
# if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then
142-
# log "$CLI_SHELL_TEST finished successfully"
143-
# else
144-
# log "$CLI_SHELL_TEST failed"
145-
# exit 1
146-
# fi
147-
148-
# cleanup_pool
149-
# done
150-
# fi
151152

152153
# Go rest tests
153154
if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then

utils/cli/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func IsEmptySubtreeRPCError(err error) bool {
122122
return false
123123
}
124124

125-
return strings.Contains(rpcerror.Message, "Internal error") && strings.Contains(rpcerror.Data, "Nonexistence proof has empty Left and Right proof")
125+
return strings.Contains(rpcerror.Message, "Internal error") && strings.Contains(rpcerror.Data, "nonexistence proof has empty Left and Right proof")
126126
}
127127

128128
func isEOFError(err error) bool {

0 commit comments

Comments
 (0)