Files
floci/compatibility-tests/sdk-test-awscli/test/sts.bats
T
Conor Heine eeefb729c4 test: move compatibility tests into this repo (#225)
* test: move compatibility tests into this repo
* fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler
* fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest
* test: add sdk tests for multipart S3 copy coverage
* fix: cover and fix smithy cbor and multipart s3 copy regressions
* test: migrate more test coverage to new folder
* test: add missing ec2 expectation in healthcheck test
* docs: update READMEs in `./compatibility-tests`
2026-04-06 09:35:53 -05:00

27 lines
627 B
Bash

#!/usr/bin/env bats
# STS tests
setup() {
load 'test_helper/common-setup'
}
@test "STS: get caller identity" {
run aws_cmd sts get-caller-identity
assert_success
account=$(json_get "$output" '.Account')
[ -n "$account" ]
user_id=$(json_get "$output" '.UserId')
[ -n "$user_id" ]
}
@test "STS: assume role" {
local role_arn="arn:aws:iam::000000000000:role/test-role"
run aws_cmd sts assume-role \
--role-arn "$role_arn" \
--role-session-name "bats-test-session"
assert_success
access_key=$(json_get "$output" '.Credentials.AccessKeyId')
[ -n "$access_key" ]
}