(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestEnrollInvalidCSR(t *testing.T) { |
| 181 | ca := newTestCA(t) |
| 182 | store := enrolltokens.NewMemoryStore() |
| 183 | ctx := context.Background() |
| 184 | tok := enrolltokens.Token{Token: "tk-bad-csr", NodeID: "n", ExpiresAt: time.Now().Add(time.Hour)} |
| 185 | _ = store.Insert(ctx, tok) |
| 186 | |
| 187 | mux := http.NewServeMux() |
| 188 | RegisterEnrollEndpoint(mux, ca, store, "") |
| 189 | w := doEnroll(t, mux, enrollRequest{NodeID: "n", CSRPem: "not a csr", Token: tok.Token}) |
| 190 | if w.Code != http.StatusBadRequest { |
| 191 | t.Fatalf("status=%d", w.Code) |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | func TestEnrollMissingFields(t *testing.T) { |
| 196 | ca := newTestCA(t) |
nothing calls this directly
no test coverage detected