MCPcopy
hub / github.com/minio/minio-go / TestIAMFailAssume

Function TestIAMFailAssume

pkg/credentials/iam_aws_test.go:224–239  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

222}
223
224func TestIAMFailAssume(t *testing.T) {
225 server := initIMDSv2Server("2014-12-16T01:51:37Z", true)
226 defer server.Close()
227
228 p := &IAM{
229 Endpoint: server.URL,
230 }
231
232 _, err := p.RetrieveWithCredContext(defaultCredContext)
233 if err == nil {
234 t.Fatal("Unexpected success, should fail")
235 }
236 if err.Error() != "ErrorMsg" {
237 t.Errorf("Expected \"ErrorMsg\", got %s", err)
238 }
239}
240
241func TestIAMIsExpired(t *testing.T) {
242 server := initIMDSv2Server("2014-12-16T01:51:37Z", false)

Callers

nothing calls this directly

Calls 4

initIMDSv2ServerFunction · 0.85
CloseMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected