(t *testing.T)
| 222 | } |
| 223 | |
| 224 | func 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 | |
| 241 | func TestIAMIsExpired(t *testing.T) { |
| 242 | server := initIMDSv2Server("2014-12-16T01:51:37Z", false) |
nothing calls this directly
no test coverage detected