From b2ac10c8a62ea0fd2990386491e225325505b518 Mon Sep 17 00:00:00 2001 From: Abdulbois Date: Mon, 15 Apr 2024 20:51:02 +0500 Subject: [PATCH] #303 Upgrade Cosmos-SDK to v0.47.8 - Enable light-client-proxy tests Signed-off-by: Abdulbois Signed-off-by: Abdulbois --- .github/actions/setup-molecule/action.yml | 2 +- .../ansible/roles/bootstrap/defaults/main.yml | 2 - integration_tests/light_client_proxy/auth.sh | 2 +- .../light_client_proxy/compliance.sh | 8 ++-- integration_tests/light_client_proxy/model.sh | 0 integration_tests/light_client_proxy/pki.sh | 7 +++ .../light_client_proxy/vendorinfo.sh | 0 integration_tests/run-all.sh | 43 ++++++++++--------- utils/cli/utils.go | 2 +- 9 files changed, 36 insertions(+), 30 deletions(-) mode change 100644 => 100755 integration_tests/light_client_proxy/auth.sh mode change 100644 => 100755 integration_tests/light_client_proxy/compliance.sh mode change 100644 => 100755 integration_tests/light_client_proxy/model.sh mode change 100644 => 100755 integration_tests/light_client_proxy/vendorinfo.sh diff --git a/.github/actions/setup-molecule/action.yml b/.github/actions/setup-molecule/action.yml index 4c12633d7..6de1b4508 100644 --- a/.github/actions/setup-molecule/action.yml +++ b/.github/actions/setup-molecule/action.yml @@ -24,7 +24,7 @@ runs: steps: - uses: actions/setup-python@v3 with: - python-version: '3.x' + python-version: '3.10' - name: install dependencies shell: bash run: pip install -r deployment/test-requirements.txt diff --git a/deployment/ansible/roles/bootstrap/defaults/main.yml b/deployment/ansible/roles/bootstrap/defaults/main.yml index f015bffe4..772fd3eb1 100644 --- a/deployment/ansible/roles/bootstrap/defaults/main.yml +++ b/deployment/ansible/roles/bootstrap/defaults/main.yml @@ -12,5 +12,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - diff --git a/integration_tests/light_client_proxy/auth.sh b/integration_tests/light_client_proxy/auth.sh old mode 100644 new mode 100755 index 78250d141..e591dcf49 --- a/integration_tests/light_client_proxy/auth.sh +++ b/integration_tests/light_client_proxy/auth.sh @@ -19,7 +19,7 @@ test_divider # connect to light client proxy dcld config node tcp://localhost:26620 -sleep 20 +sleep 10 echo "Query non existent account" result=$(execute_with_retry "dcld query auth account --address=$user_address") diff --git a/integration_tests/light_client_proxy/compliance.sh b/integration_tests/light_client_proxy/compliance.sh old mode 100644 new mode 100755 index ca1dbf3be..8c3cdcd36 --- a/integration_tests/light_client_proxy/compliance.sh +++ b/integration_tests/light_client_proxy/compliance.sh @@ -19,28 +19,28 @@ cd_certificate_id="123" echo "Query non existent complianceinfo" result=$(execute_with_retry "dcld query compliance compliance-info --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"") echo "$result" -#check_response "$result" "Not Found" +check_response "$result" "Not Found" test_divider echo "Query non existent certified" result=$(execute_with_retry "dcld query compliance certified-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"") echo "$result" -#check_response "$result" "Not Found" +check_response "$result" "Not Found" test_divider echo "Query non existent revoked" result=$(execute_with_retry "dcld query compliance revoked-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"") echo "$result" -#check_response "$result" "Not Found" +check_response "$result" "Not Found" test_divider echo "Query non existent provision" result=$(execute_with_retry "dcld query compliance provisional-model --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType="zigbee"") echo "$result" -#check_response "$result" "Not Found" +check_response "$result" "Not Found" test_divider diff --git a/integration_tests/light_client_proxy/model.sh b/integration_tests/light_client_proxy/model.sh old mode 100644 new mode 100755 diff --git a/integration_tests/light_client_proxy/pki.sh b/integration_tests/light_client_proxy/pki.sh index cb6f10156..d6f2fb9fd 100755 --- a/integration_tests/light_client_proxy/pki.sh +++ b/integration_tests/light_client_proxy/pki.sh @@ -140,6 +140,7 @@ test_divider echo "$vendor_account (Not Trustee) propose Root certificate" root_path="integration_tests/constants/root_cert" result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --vid $vid --from $vendor_account --yes) +result=$(get_txn_result "$result") response_does_not_contain "$result" "\"code\": 0" echo "$result" @@ -148,6 +149,7 @@ test_divider echo "$trustee_account (Trustee) propose Root certificate" root_path="integration_tests/constants/root_cert" result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --vid $vid --from $trustee_account --yes) +result=$(get_txn_result "$result") check_response "$result" "\"code\": 0" echo "$result" @@ -155,6 +157,7 @@ test_divider echo "$second_trustee_account (Trustee) approve Root certificate" 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) +result=$(get_txn_result "$result") check_response "$result" "\"code\": 0" echo "$result" @@ -163,6 +166,7 @@ test_divider echo "$vendor_account (Vendor) add Intermediate certificate" intermediate_path="integration_tests/constants/intermediate_cert" result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$intermediate_path" --from $vendor_account --yes) +result=$(get_txn_result "$result") check_response "$result" "\"code\": 0" echo "$result" @@ -171,6 +175,7 @@ test_divider echo "$vendor_account (Vendor) add Leaf certificate" leaf_path="integration_tests/constants/leaf_cert" result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$leaf_path" --from $vendor_account --yes) +result=$(get_txn_result "$result") check_response "$result" "\"code\": 0" echo "$result" @@ -178,6 +183,7 @@ test_divider echo "$vendor_account (Vendor) revokes Leaf certificate." 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) +result=$(get_txn_result "$result") check_response "$result" "\"code\": 0" echo "$result" @@ -185,6 +191,7 @@ test_divider echo "$trustee_account (Trustee) proposes to revoke Root certificate" 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) +result=$(get_txn_result "$result") check_response "$result" "\"code\": 0" echo "$result" diff --git a/integration_tests/light_client_proxy/vendorinfo.sh b/integration_tests/light_client_proxy/vendorinfo.sh old mode 100644 new mode 100755 diff --git a/integration_tests/run-all.sh b/integration_tests/run-all.sh index c705e4b45..6ad877584 100755 --- a/integration_tests/run-all.sh +++ b/integration_tests/run-all.sh @@ -105,6 +105,28 @@ make image &>${DETAILED_OUTPUT_TARGET} cleanup_pool +# Light Client Proxy Cli shell tests + if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then + CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort) + + for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do + init_pool + + log "*****************************************************************************************" + log "Running $CLI_SHELL_TEST" + log "*****************************************************************************************" + + if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then + log "$CLI_SHELL_TEST finished successfully" + else + log "$CLI_SHELL_TEST failed" + exit 1 + fi + + cleanup_pool + done + fi + # Cli shell tests if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "cli" ]]; then 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 done fi -# Light Client Proxy Cli shell tests -# if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "light" ]]; then -# CLI_SHELL_TESTS=$(find integration_tests/light_client_proxy -type f -name '*.sh' -not -name "common.sh" | sort) - -# for CLI_SHELL_TEST in ${CLI_SHELL_TESTS}; do -# init_pool - -# log "*****************************************************************************************" -# log "Running $CLI_SHELL_TEST" -# log "*****************************************************************************************" - -# if bash "$CLI_SHELL_TEST" &>${DETAILED_OUTPUT_TARGET}; then -# log "$CLI_SHELL_TEST finished successfully" -# else -# log "$CLI_SHELL_TEST failed" -# exit 1 -# fi - -# cleanup_pool -# done -# fi # Go rest tests if [[ $TESTS_TO_RUN =~ "all" || $TESTS_TO_RUN =~ "rest" ]]; then diff --git a/utils/cli/utils.go b/utils/cli/utils.go index 8050d21cd..9eb1ce957 100644 --- a/utils/cli/utils.go +++ b/utils/cli/utils.go @@ -122,7 +122,7 @@ func IsEmptySubtreeRPCError(err error) bool { return false } - return strings.Contains(rpcerror.Message, "Internal error") && strings.Contains(rpcerror.Data, "Nonexistence proof has empty Left and Right proof") + return strings.Contains(rpcerror.Message, "Internal error") && strings.Contains(rpcerror.Data, "nonexistence proof has empty Left and Right proof") } func isEOFError(err error) bool {