(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestIAMNoRoles(t *testing.T) { |
| 181 | server := initTestServerNoRoles() |
| 182 | defer server.Close() |
| 183 | |
| 184 | creds := NewIAM(server.URL) |
| 185 | _, err := creds.GetWithContext(defaultCredContext) |
| 186 | if err == nil { |
| 187 | t.Fatal("Unexpected should fail here") |
| 188 | } |
| 189 | if err.Error() != "No IAM roles attached to this EC2 service" { |
| 190 | t.Fatalf("Expected 'No IAM roles attached to this EC2 service', got %s", err) |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | func TestIAM(t *testing.T) { |
| 195 | server := initIMDSv2Server("2014-12-16T01:51:37Z", false) |
nothing calls this directly
no test coverage detected