Commit Graph

135 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews 163d9547f4 Remove the agreement flag from test.js. (#1885)
Since we only use this for testing, not a live client, it's unnecessary
complexity.
2016-06-06 13:19:57 -07:00
Jacob Hoffman-Andrews 6f082f397b Improve error logging in test.js (#1829)
Also fix a typo in startservers.py and quote variables in Makefile (provides more meaningful errors when they are unset).
2016-05-19 15:54:53 -07:00
Roland Bracewell Shoemaker 8eaf247ee9 Split CAA checking out to its own service (#1647)
* Split out CAA checking service (minus logging etc)
* Add example.yml config + follow general Boulder style
* Update protobuf package to correct version
* Add grpc client to va
* Add TLS authentication in both directions for CAA client/server
* Remove go lint check
* Add bcodes package listing custom codes for Boulder
* Add very basic (pull-only) gRPC metrics to VA + caa-service
2016-04-12 23:02:41 -07:00
Jacob Hoffman-Andrews d98eb634d1 Docker improvements.
Use bridged networking.

Add some files to .dockerignore to shrink the build state sent to Docker
daemon.

Use specific hostnames to contact services, rather than localhost.

Add instructions for adding those hostnames to /etc/hosts in non-Docker config.

Use DSN-style connect strings for DBs.

Remove localhost / 127.0.0.1 rewrite hack from create_db.sh.

Add hosts section with new hostnames.

Remove bin from .dockerignore.

SQL grants go to %

Short-circuit DB creation if already existing.

Make `go install` a part of Docker image build so that Docker run is much
faster.

Bind to 0.0.0.0 for OCSP responders so they can be reached from host, and
publish / expose their ports.

Remove ToSServerThread and test.js' fetch of ToS.

Increase the registrationsPerIP rate limit threshold. When issuing from a Docker
host, the 127.0.0.1 override doesn't apply, so the limit is quickly hit.

Update docker-compose for bridged networking. Note: docker-compose doesn't currently work, but should be close.

https://github.com/letsencrypt/boulder/pull/1639
2016-04-04 16:05:08 -07:00
Kane York 98567efdfc Add integration tests for expiry mailer
This creates a new server, 'mail-test-srv', which is a simplistic SMTP
server that accepts mail and can report the received mail over HTTP.

An integration test is added that uses the new server to test the expiry
mailer.

The FAKECLOCK environment variable is used to force the expiry mailer to
think that the just-issued certificate is about to expire.

Additionally, the expiry mailer is modified to cleanly shut down its
SMTP connections.
2016-03-25 10:02:02 -07:00
Kane York 9e4066e0c7 Remove std_json build tag
After a review of the logs, it seems that no clients are using
capitalized or duplicate keys in the JWS bodies. Remove the std_json
build tag.
2016-03-22 14:00:33 -07:00
Roland Shoemaker 4d8c7a323f Set std_json build flag in order to preserve case insensitive JSON key parsing 2016-03-15 14:25:03 -07:00
Kane York a6317d1717 Introduce cmd.Clock() for use in integration tests
If the FAKECLOCK environment variable is set, and the build was in a
test environment, cmd.Clock will return a FakeClock with the time set to
the content of the environment variable.

The choice of the UnixDate format was because `date -d` is a common
choice for shell scripts.
2016-03-07 14:52:34 -08:00
Jacob Hoffman-Andrews f67648d22f Disable activity-monitor.
We no longer run this in prod, so we shouldn't run it in test / dev.
2016-01-05 14:50:25 -08:00
Jacob Hoffman-Andrews 9e4b0c1e5b Move RabbitMQ initialization into its own binary.
Previously our executables would all try to declare the boulder exchange on
startup, which may have been leading to some race conditions in Travis. Also,
the Activity Monitor would try to bind a queue to the exchange at startup.
In prod both of these tasks are taken care of administratively, so including
them in the app code was adding unnecessary complexity. It also may have been
part of an issue causing Activity Monitor to fail to start up recently.

Also, turn the Activity Monitor into an RPC service, which gets it reconnects
for free, and add it to startservers.py.
2015-11-29 16:55:03 -08:00
Jeff Hodges baaa8a6209 check for wfe port liveness in integration tests
We're getting many more spurious "Can't connect to WFE" errors in
TravisCI. So, we add the WFE's main port to the port liveness check in
amqp-integration-test.py.

Fixes #1099
2015-11-05 15:32:05 -08:00
Jacob Hoffman-Andrews 194e421931 Add reconnects in AMQP. 2015-10-27 19:54:54 -07:00
Jacob Hoffman-Andrews 17918010dc Allow override of all build flags in Makefile.
I think even the ldflags that did not change between subsequent invocations of
./start.py, e.g. BUILD_HOST_VAR, were different between ./start.py and
`go test ./...`, which would cause test runs to be unnecessarily slow.

Open question: To keep local developer builds fast, maybe we should enable race
detection only in Travis? Otherwise, `go test ./...` runs with one set of
ldflags, and then `ampq-integration-test.py` runs with a different set, which I
think makes both of them slower.
2015-10-03 12:45:06 -07:00
Roland Shoemaker 3be29f8288 Remove cmd/ prefix 2015-10-01 17:30:49 -07:00
Roland Shoemaker 9dc7b2d682 Merge master 2015-10-01 17:23:48 -07:00
Roland Shoemaker 2d0dee4ce1 Daemonize the OCSP updater tool so we are constantly updating OCSP responses.
also moves the first OCSP responses generation from the CA to the OCSP updater. This patch lays the
ground work for moving CT submission and adding CT backfill to the OCSP updater.
2015-10-01 16:36:51 -07:00
Jacob Hoffman-Andrews b3aca1ff2b Speed up tests.
Make `make` aware of output files so it doesn't always have to rebuild. Also
make it use `go install`, which is faster than building files individually.

Now that make is faster, use it in startservers.py to consolidate building
logic. This also has the handy side-effect that ./start.py exposes useful build
information through /build, whereas before only the .rpm packaged version did.

Additionally, this allows us to remove `make` from the Travis matrix, since we
are running `make` as part of the integration test. This means each PR only
triggers two Travis builds instead of one, which means we will get results from
Travis faster.

Also, change the Travis matrix logic to be a list of actions to run, rather than
a list of actions to skip. That fixes
https://github.com/letsencrypt/boulder/issues/817.

Enumerate specific sections of test.sh to run, rather than sections to skip.

Note: ./start.py now installs into ./bin/ instead of $GOPATH/bin.

Only set up GitHub secret file (for PR status reporting) when available, and
decrypt it into /tmp rather than $HOME, to avoid accidentally caching it once
Travis' caching features are available.

Clone letsencrypt repo into $HOME instead of $TMP, to make it possible to cache
eventually.

Remove unused `mysql` dependency in Travis.

Override default Travis install command to prevent it from adding
Godeps/_workspace to GOPATH. When that happens, it hides failures that should
arise from importing non-vendorized paths.
2015-10-01 16:28:17 -07:00
Jacob Hoffman-Andrews 540c792474 Add an OCSP responder that serves from a file.
This is useful for intermediate and root OCSP, which are generated manually one
a year.
2015-09-23 16:34:13 -07:00
Jacob Hoffman-Andrews 5666b5a59a Add dummy CT log server for integration testing. 2015-09-22 17:10:38 -07:00
Roland Shoemaker ff6eca7a29 Submit all issued certificates to configured CT logs
Adds a new service, Publisher, which exists to submit issued certificates to various Certificate Transparency logs. Once submitted the Publisher will also parse and store the returned SCT (Signed Certificate Timestamp) receipts that are used to prove inclusion in a specific log in the SA database. A SA migration adds the new SCT receipt table.

The Publisher only exposes one method, SubmitToCT, which is called in a goroutine by ca.IssueCertificate as to not block any other issuance operations. This method will iterate through all of the configured logs attempting to submit the certificate, and any required intermediate certificates, to them. If a submission to a log fails it will be retried the pre-configured number of times and will either use a back-off set in a Retry-After header or a pre-configured back-off between submission attempts.

This changeset is the first of a number of changes ending with serving SCT receipts in OCSP responses and purposefully leaves out the following pieces for follow-up PRs.

* A fake CT server for integration testing
* A external tool to search the database for certificates lacking a full set of SCT receipts
* A method to construct X.509 v3 extensions containing receipts for the OCSP responder
* Returned SCT signature verification (beyond just checking that the signature is of the correct type so we aren't just serving arbitrary binary blobs to clients)

Resolves #95.
2015-09-17 18:11:05 -07:00
Jacob Hoffman-Andrews fc70f00fb3 Restore `exec` command to startservers.py.
Fixes https://github.com/letsencrypt/boulder/issues/671
2015-08-27 12:56:36 -07:00
Jacob Hoffman-Andrews 02c22c40aa Fix error output in startservers.
Previously startservers would crash with an error about concatenating NoneType and string, if there was a build erro.r
2015-08-26 10:12:29 -07:00
Jeff Hodges 469253a9e3 fix some dregs in startservers.py
Changes this to use just communicate(), not the subprocess.PIPE stuff (which
apparently can do Weird Things)

Also rename the install variable to cmd in the install function
2015-08-25 21:42:48 -07:00
Jeff Hodges 3a4fef4463 install boulder cmds in one cmd in startserver.py
This eases the CPU and thread requirements of our tests (by forking
less, not doing everything at once). It should also speed up the tests
by avoiding certain repetitive work.

Updates https://github.com/letsencrypt/letsencrypt/issues/712
2015-08-25 16:02:08 -07:00
Jacob Hoffman-Andrews f6c21120b0 Add OCSP testing to integration test. 2015-08-20 09:37:24 -07:00
Jacob Hoffman-Andrews bcfb935472 Fail startservers.py when compile fails. 2015-08-07 17:55:43 -07:00
Jacob Hoffman-Andrews 9b20f0afaf Startservers.py: remove tempdir, add sys.exit 2015-07-29 11:15:01 -07:00
Jacob Hoffman-Andrews 237f759ac9 Use go install for even more speed. 2015-07-28 18:29:39 -07:00
Jacob Hoffman-Andrews d69f97e954 Fix exception handling. 2015-07-28 18:11:52 -07:00
Jacob Hoffman-Andrews a4c4b473f1 Speed up start.py and integration test.
Run builds in parallell as well as starting servers in parallel.
Wait for the servers to come up, so tests don't start running too early.
Enable race detection only for the integration test, not for start.py.
Previously I'd suggested it should always be on, but after running with it for a
while I'm convinced it's too slow for start.py (but still very valuable for
integration tests!).
2015-07-28 18:07:22 -07:00
Tom Clegg 2914ba6af5 Fix "main process kept alive forever by ToSServerThread." 2015-07-25 18:17:02 -04:00
Tom Clegg e6ca449d34 Bring up a stub ToS server in test scripts. 2015-07-25 16:21:40 -04:00
Tom Clegg e871b30cbf Shut down everything if any server exits before ^C/timer. Fixup log messages. 2015-07-25 15:59:38 -04:00
Tom Clegg 43c738cc93 Set GORACE env var only in "go build", not everywhere. 2015-07-25 14:51:22 -04:00
Tom Clegg de5cce8c03 De-duplicate start.py and test/amqp-integration-test.py 2015-07-25 04:04:20 -04:00