Commit Graph

27 Commits

Author SHA1 Message Date
Daniel McCarney 4f9ee00510 gRPC: publish in-flight RPC gauge in client interceptor. (#3672)
This PR updates the Boulder gRPC clientInterceptor to update a Prometheus gauge stat for each in-flight RPC it dispatches, sliced by service and method.

A unit test is included that uses a custom ChillerServer that lets the test block up a bunch of RPCs, check the in-flight gauge value is increased, unblock the RPCs, and recheck that the in-flight gauge is reduced. To check the gauge value for a specific set of labels a new test-tools.go function GaugeValueWithLabels is added.

Updates #3635
2018-04-27 15:53:54 -07:00
Daniel McCarney 17922a6d2d
Add CAAIdentities and Website to /directory "meta". (#3588)
This commit updates the WFE and WFE2 to have configuration support for
setting a value for the `/directory` object's "meta" field's
optional "caaIdentities" and "website" fields. The config-next wfe/wfe2
configuration are updated with values for these fields. Unit tests are
updated to check that they are sent when expected and not otherwise.

Bonus content: The `test.AssertUnmarshaledEquals` function had a bug
where it would consider two inputs equal when the # of keys differed.
This commit also fixes that bug.
2018-03-22 16:12:43 -04:00
Jacob Hoffman-Andrews 9003dd4522 Improve test-tools. (#3481)
Use `t.Helper` and `t.Fatalf` instead of our own versions.

Remove some unused or single-user helpers.

Make the output of `AssetUnmarshaledEquals` clearer by showing one line per field.
2018-02-27 10:19:24 -05:00
Jacob Hoffman-Andrews d2883f12c1 Remove TimingDuration call from VA (#3122)
Also switch over tests.

Fixes #3100
2017-09-28 14:25:22 -07:00
Jacob Hoffman-Andrews 568407e5b8 Remote VA logging and stats (#3063)
Add a logging statement that fires when a remote VA fail causes
overall failure. Also change remoteValidationFailures into a
counter that counts the same thing, instead of a histogram. Since
the histogram had the default bucket sizes, it failed to collect
what we needed, and produced more metrics than necessary.
2017-09-11 12:50:50 -07:00
Roland Bracewell Shoemaker eadbc19c43 Switch DNS metrics from statsd to prometheus (#2994)
Makes the DNS stats code much nicer if I don't say so myself. Should make investigating DNS problems much easier now as well.

Fixes #2956.
2017-08-22 14:33:36 -07:00
Daniel McCarney 6a6a6537aa WFE2 unit test cleanup (part 1) (#2962)
This is the first half of a clean-up of the WFE2 unit tests that were copied over from the original WFE implementation.

I will file a follow-up pt2 PR for TestChallenge, TestAuthorization, and TestGetCert which I think are the remaining tests that could use a 🛁.

The one non-test commit changed the WFE2 index to return a problem when the method is unsupported similar to the other API endpoints. This might be inappropriate since normally the index returns XHTML and not JSON. It made testing easier but I'm open to switching back to returning a "" body and special casing the index test.

Note to reviewers: The main diff is hidden by GH by default and needs to be expanded.

Updates #2928
2017-08-11 11:00:07 -07:00
Daniel McCarney a3696a2c58 Change `%v` to `%#v` in AssertEquals error msg. (#1983)
Whenever I run into a test failure using `AssertEquals` I end up changing the error format string to include the full type information. I think given the context of when the message will be printed it makes sense to include type information all the time.

This commit changes the format string from `%v` to `%#v`. This avoids otherwise unhelpful test failures like:
    `ra_test.go:789: [0] != [0]`
where the underlying types differ while their String() representation matches.
2016-06-28 08:42:51 -07:00
Roland Bracewell Shoemaker 54573b36ba Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
Jacob Hoffman-Andrews 3018c00519 Testing and logging improvements
Pass log as an argument to SA. This allows us to mock it out.
Use a mockSA in CA test.
Use mockSA in orphan-finder test.
Improve logging from assert functions: Use our own printing style plus FailNow() so that each failure message isn't prefixed by "test-tools.go:60"
Remove duplicate TraceOn.

Part of #1642.

https://github.com/letsencrypt/boulder/pull/1683
2016-04-04 18:42:42 -07:00
Jeff Hodges 9ea4ac8b14 return ProblemDetails when validating emails in ra
Fixes #1153
2015-12-15 14:44:19 -08:00
Roland Shoemaker 661476f40e Backoff OCSP Updater on HSM failure
If a ServiceUnavailableError is returned from GenerateOCSP backoff before
attempting to retry the call as to not to overwhelm the CA with calls that
may instantly fail.
2015-10-26 14:06:32 -07:00
Jacob Hoffman-Andrews faafc18a20 AssertError: Don't bother logging nil errors 2015-10-04 21:01:11 -07:00
Jeff Hodges 03cb25c601 add actual error message to test.AssertError 2015-09-01 15:08:48 -07:00
Jacob Hoffman-Andrews 0cda14b6cb Print error in Assert{,Not}Error. 2015-08-28 14:11:50 -07:00
Jacob Hoffman-Andrews ef9d30f81a Use Fatalf for all assert functions in test-tools
This makes the test terminate after the assertion failure. Especially in the
case of AssertNotError, this can avoid triggering an immediate nil dereference
panic that obscures the error message.
2015-08-26 23:50:48 -07:00
Tom Clegg ff491962b9 Dry up "method not allowed" handling. 2015-07-16 22:07:44 -04:00
J.C. Jones 41f5788c77 Correct most `go lint` warnings. (274 -> 5) 2015-06-16 22:18:28 -05:00
J.C. Jones d1321f2d78 More RPC fixes for Issue #202
- NewPendingAuthorization now uses a core.Authorization object, so
  that foreign key constraints are followed
- core.Authorization now serializes RegistrationID to JSON, so it has to get
  blanked out in WFE before transmission to client.
- Remove ParsedCertificate from core.Certificate, as type x509.Certificate cannot
  be marshaled.
- Added AssertDeepEquals and AssertMarhsaledEquals to test-tools.go
- Caught several overloaded and misleadingly named errors in WFE
2015-05-28 11:05:55 -07:00
Richard Barnes c3b312118e Add audit logging
- Auditing for general errors in executables
- Auditing for improper messages received by WFE
- Automatic audit wlogging of software errors
- Audit logging for mis-routed messages
- Audit logging for certificate requests
- Auditing for improper messages received by WFE
- Add audit events table
- Expect more details in TestRegistration in web-front-end_test.go
- Remove "extra" debug details from web-front-end.go per Issue #174
- Improve test coverage of web-front-end.go
- WFE audit updates for revocation support rebase
- Add audit messages to RPC for Improper Messages and Error Conditions
- Also note misrouted messages
2015-05-18 18:23:08 -07:00
Roland Shoemaker 771d6d9b6d add serial conv. functions and basic tests 2015-05-06 16:07:19 -07:00
Peter Eckersley d609aebc3f Some NewToken tests 2015-05-01 22:03:59 -07:00
J.C. Jones e828c61818 Add singleton semantics to Audit Logger, per Issue #135
- Update tests to use the singleton logger
- Update commands to set the audit logger singleton
- Formatting updates to the tests (go fmt)
2015-05-01 21:48:24 -07:00
Jacob Hoffman-Andrews ca6e349906 Fix tests. 2015-04-23 20:06:17 -07:00
Jacob Hoffman-Andrews 7145207104 Add initial certificate status in SA.
Also improve test tools.
2015-04-23 19:52:34 -07:00
J.C. Jones 151274f1b3 Rework audit logging. Issue #23. 2015-03-24 17:36:26 -07:00
Richard Barnes dcdf9954ae Pulling out sa module 2015-03-10 15:21:50 -07:00