Skip to content

Commit

Permalink
#303 Upgrade Cosmos-SDK to v0.47.8
Browse files Browse the repository at this point in the history
- Enable light-client-proxy tests

Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com>
Signed-off-by: Abdulbois <abdulbois123@gmail.com>
  • Loading branch information
Abdulbois committed Apr 16, 2024
1 parent 75c2f3d commit b2ac10c
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-molecule/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions deployment/ansible/roles/bootstrap/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.


2 changes: 1 addition & 1 deletion integration_tests/light_client_proxy/auth.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/light_client_proxy/compliance.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Empty file modified integration_tests/light_client_proxy/model.sh
100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions integration_tests/light_client_proxy/pki.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -148,13 +149,15 @@ 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"

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"

Expand All @@ -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"

Expand All @@ -171,20 +175,23 @@ 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"

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"

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"

Expand Down
Empty file modified integration_tests/light_client_proxy/vendorinfo.sh
100644 → 100755
Empty file.
43 changes: 22 additions & 21 deletions integration_tests/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion utils/cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b2ac10c

Please sign in to comment.