Commit Graph

1461 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews 0cda14b6cb Print error in Assert{,Not}Error. 2015-08-28 14:11:50 -07:00
Roland Shoemaker 8f3cd5e446 Merge pull request #674 from jcjones/missing_permissions
Add missing DB user / permissions
2015-08-27 15:06:32 -07:00
Jeff Hodges 6740e0c6c9 Merge pull request #684 from letsencrypt/parallel_skip_tests
run unit and integration tests at the same time in TravisCI
2015-08-27 14:42:24 -07:00
Jacob Hoffman-Andrews 86383e1e16 Merge pull request #675 from letsencrypt/fatalf
Use Fatalf for all assert functions in test-tools
2015-08-27 14:20:31 -07:00
Jacob Hoffman-Andrews 455310b1fd Merge pull request #679 from letsencrypt/restore-exec
Restore `exec` command to startservers.py.
2015-08-27 14:20:03 -07:00
Jeff Hodges fb56e35a00 run unit and integration tests at the same time 2015-08-27 14:08:11 -07:00
bifurcation c638f16240 Merge pull request #676 from letsencrypt/unflake-expiration-mailer
Unflake expiration mailer test
2015-08-27 16:56:42 -04: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 26b250c359 Make expiration mailer test unflaky.
Previously the expiration times were right on the cusp of being included or not
included in the query. Adjusted the times to be solidly in the right range.
In a future PR, we should refactor the code to generate absolute expiration
times and have findExpiringCertificates take a time param, so the test isn't
dependent on time.Now().
2015-08-27 00:12:07 -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
J.C. Jones e0edf55307 Add missing user / permissions 2015-08-26 20:14:29 -07:00
Roland Shoemaker 6ee8693fc1 Merge pull request #672 from letsencrypt/fix-test-failure-output
Fix error output in startservers.
2015-08-26 14:57:46 -07:00
Roland Shoemaker be59fb55e8 Merge pull request #657 from letsencrypt/ca_flickr
avoid needing a row to start serialNumber
2015-08-26 13:51:10 -07:00
Jacob Hoffman-Andrews 18958e462b Merge pull request #669 from letsencrypt/test_mode
remove TestMode completely
2015-08-26 11:45:15 -07:00
Jacob Hoffman-Andrews 8639abf282 Merge pull request #667 from letsencrypt/va_pointer
avoid copying large ValidationAuthorityImpl struct
2015-08-26 10:14:41 -07:00
Jacob Hoffman-Andrews dd8e06ec5f Merge pull request #670 from letsencrypt/docker_to_1.5
bump Dockerfile to Go 1.5
2015-08-26 10:14:03 -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 cbcc375bd9 Merge pull request #668 from letsencrypt/boogs_startserver
fix some dregs in startservers.py
2015-08-25 22:56:26 -07:00
Roland Shoemaker 8de2565f2e Merge pull request #665 from letsencrypt/remove_dead_ca_func
remove unused private func in ca
2015-08-25 22:46:53 -07:00
Jeff Hodges 2f18259f47 bump Dockerfile to Go 1.5 2015-08-25 22:39:33 -07:00
Jeff Hodges 283d8de59b remove TestMode completely
This removes TestMode from the boulder-va command, from ca.Config
(it was only used in the VA) and gets the integration config to specify
the ports it should use explicitly.

(It also removes a DBDriver field from ca.Config that was left over from
letsencrypt/boulder#624.)

Fixes #627.
2015-08-25 21:57:24 -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 5bd820f3c5 avoid copying large ValidationAuthorityImpl struct
Saves some allocations
2015-08-25 21:14:59 -07:00
Jacob Hoffman-Andrews 49ae811385 Merge pull request #663 from letsencrypt/chill_go_install
install boulder cmds in one cmd in startserver.py
2015-08-25 16:54:42 -07:00
Jeff Hodges 15cb96933f remove unused private func in ca 2015-08-25 16:30:58 -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
Roland Shoemaker d6af4ecdf2 Merge pull request #658 from letsencrypt/strict
turn on strict mode for MariaDB
2015-08-25 14:34:55 -07:00
Roland Shoemaker 5705d2dd33 Merge pull request #659 from letsencrypt/remove_hostname_override
remove unused VA.hostnameOverride field
2015-08-25 14:33:16 -07:00
Jeff Hodges fa89973681 remove unused VA.hostnameOverride field 2015-08-25 13:46:03 -07:00
Jeff Hodges ae58e7d488 turn on strict mode for MariaDB
Avoids silently allowing bad things to happen (like mismatched data
types, strings being truncated, etc.).

Ensures that MySQL/MariaDB warnings are treated as errors. This avoids a
number of nasty edge conditions we could wander into. Common things this
discovers includes places where data being sent had a different type
than what is in the schema, strings being truncated, writes of null to a
NOT NULL column, and so on. See
<https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sql-mode-strict>.

MySQL is very funny.

Fixes #623
2015-08-25 13:17:15 -07:00
Jeff Hodges 6b7bfb40d1 avoid needing a row to start serialNumber
Managing the single row needed in serialNumber is a bit of hassle in a
world where we delete all of the rows in all tables in our tests. Plus,
if someone does that on their development database, they have to drop
all the way to the start of the migrations and run them again. It's a
bummer.

Instead, use the MySQL id generation design as [described and used by
Flickr](https://code.flickr.net/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-the-cheap/). That design
doesn't need a row at its first insert to work correctly.

(That post mentions maybe using `ON DUPLICATE KEY UPDATE`, but it has
subtle bugs that even using `LAST_INCREMENT_ID(id)` doesn't fix. This is
because `UPDATE` doesn't run on the first `INSERT` but the `INSERT` will
return 1. Then, id 1 will be returned again on the
second `INSERT` attempt because the `LAST_INCREMENT_ID(id)` will be 0
because no increment was done! All subsequent `INSERT` attempts will be off by
one.)

Fixes #649.
2015-08-25 13:14:17 -07:00
Roland Shoemaker b3c0066727 Merge pull request #648 from letsencrypt/migrate
add goose as the migration tool
2015-08-25 13:06:21 -07:00
Jeff Hodges 7b6f2894f7 add goose as the migration tool
This has required some substantive changes to the tests. Where
previously the foreign key constraints did not exist in the tests, now
that we use the actual production schema, they do. This has mostly led
to having to create real Registrations in the sa, ca, and ra tests. Long
term, it would be nice to fake this out better instead of needing a real
sa in the ca and ra tests.

The "goose" being referred to is <https://bitbucket.org/liamstask/goose>.

Database migrations are stored in a _db directory inside the relevant
owner service (namely, ca/_db, and sa/_db, today).

An example of migrating up with goose:

    goose -path ./sa/_db -env test up

An example of creating a new migration with goose:

    goose -path ./sa/_db -env test create NameOfNewMigration sql

Notice the "sql" at the end. It would be easier for us to manage sql
migrations. I would like us to stick to only them. In case we do use Go
migrations in the future, the underscore at the beginning of "_db" will
at least prevent build errors when using "..." with goose-created Go
files. Goose-created Go migrations do not compile with the go tool but
only with goose.

Fixes #111
Unblocks #623
2015-08-25 12:02:31 -07:00
Jacob Hoffman-Andrews 7a0b5c3c43 Merge pull request #645 from letsencrypt/fix-va-test
Refactor VA test to use Go's httptest.
2015-08-25 12:00:39 -07:00
Jacob Hoffman-Andrews f809806ddb Use NewValidationAuthorityImpl(false) everywhere. 2015-08-25 11:46:09 -07:00
Roland Shoemaker 54e7ac6b1b Merge pull request #655 from letsencrypt/fix-flaky-ocsp
Fix flaky OCSP.
2015-08-25 10:26:38 -07:00
Jacob Hoffman-Andrews 9b9dd76f54 Fix flaky OCSP.
If two OCSP responses were generated in the same second, the earlier would
previously take priority sometimes, leading to a "good" response for revoked
certificates and causing the OCSP integration test to be flaky.
2015-08-24 15:31:26 -07:00
Jacob Hoffman-Andrews 3a7e53c371 Remove merge artifacts 2015-08-24 12:34:51 -07:00
Roland Shoemaker 2662a10997 Merge pull request #634 from letsencrypt/ocsp-integration
Add OCSP testing to integration test
2015-08-24 11:25:20 -07:00
Jacob Hoffman-Andrews f8db80538b Merge pull request #654 from letsencrypt/std-cli
Standardize CLI UX
2015-08-24 10:16:43 -07:00
Roland Shoemaker 289280d50a Merge branch 'master' into std-cli 2015-08-23 23:17:24 -07:00
Roland Shoemaker 7ad8847ba2 Standardize CLI UX 2015-08-23 23:17:14 -07:00
Jacob Hoffman-Andrews 93c07c160c Handle port == 65536 better. 2015-08-21 16:09:58 -07:00
Jacob Hoffman-Andrews ccbd7a037e Work around race in hs.Close() 2015-08-21 16:09:58 -07:00
Jacob Hoffman-Andrews 6f60530781 Add hostnameOverride. 2015-08-21 16:09:57 -07:00
Jacob Hoffman-Andrews 178991e811 Add a sleep to placate the race detector. 2015-08-21 16:07:14 -07:00
Jacob Hoffman-Andrews efa94628c7 Refactor VA test to use Go's httptest.
Previously the VA test had race conditions where the various test servers would
not shut down before the next test started its own server, and the necessary port
wouldn't be available.

Go's httptest makes shutdown simpler, and also chooses a random port, which
further helps avoid collisions.

This change required refactoring the VA to specify the ports for various
challenges as fields. This should allow us to fully remove the TestMode bool in
a subsequent change.

Credit to jmhodges for the first version of this patch.
2015-08-21 16:07:10 -07:00
Roland Shoemaker 803193a19e Merge pull request #647 from letsencrypt/makefile_fix
correct Makefile on linux
2015-08-21 15:32:09 -07:00
Roland Shoemaker acce7fee9c Merge pull request #621 from letsencrypt/fixed-505
Re-apply #505
2015-08-21 15:30:27 -07:00
Roland Shoemaker d58198e035 Add validationRecord logic to challenge model and schema 2015-08-21 15:19:32 -07:00