Skip to content

Commit

Permalink
test: add e2e test for canister request-status with different identity
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswanson-dfinity committed Dec 19, 2024
1 parent 5a3667f commit e1235eb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions e2e/tests-dfx/request_status.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,23 @@ teardown() {
assert_eq '4449444c0001710b48656c6c6f2c20426f6221'

}

@test "request-status requires same identity" {
install_asset greet
dfx_start --artificial-delay 10000

dfx canister create hello_backend
dfx build hello_backend
dfx canister install hello_backend

assert_command dfx canister call --async hello_backend greet Bob

# shellcheck disable=SC2154
REQUEST_ID="$stdout"

assert_command_fail dfx canister request-status "$REQUEST_ID" "$(dfx canister id hello_backend)" --identity anonymous
assert_contains "The user tries to access Request ID not signed by the caller"

assert_command dfx canister request-status "$REQUEST_ID" "$(dfx canister id hello_backend)"
assert_eq '("Hello, Bob!")'
}

0 comments on commit e1235eb

Please sign in to comment.