(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestSaveRequestAutoSign(t *testing.T) { |
| 183 | allConfig := SetupSignerdConfig(-1, 0) |
| 184 | environment := "testing" |
| 185 | envConfig := allConfig[environment] |
| 186 | requestHandler := makeCertRequestHandler(allConfig) |
| 187 | |
| 188 | pubKey, _, _, _, err := ssh.ParseAuthorizedKey([]byte(boringUserCertString)) |
| 189 | if err != nil { |
| 190 | t.Fatalf("Parsing canned cert failed: %v", err) |
| 191 | } |
| 192 | cert := pubKey.(*ssh.Certificate) |
| 193 | signed, err := requestHandler.saveSigningRequest(envConfig, environment, "reason: testing", "DEADBEEFDEADBEEF", 1, cert) |
| 194 | if err != nil { |
| 195 | t.Fatalf("Should have succeeded. Failed with: %v", err) |
| 196 | } |
| 197 | if !signed { |
| 198 | t.Fatal("Should have auto signed. But we didn't.") |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | func TestSaveRequestValidCert(t *testing.T) { |
| 203 | allConfig := SetupSignerdConfig(1, 0) |
nothing calls this directly
no test coverage detected