Commit Graph

170 Commits

Author SHA1 Message Date
Aaron Gable 316ffd6241
Update to stable go1.15 (#5021)
This updates our test infrastructure from using go1.15rc2 to the
newly-released go1.15 stable version.
2020-08-17 12:32:20 -07:00
Aaron Gable d873e01fa8
Update to go1.15rc2 for tests (#5013)
Go 1.15rc2 was released today. The diff from rc1 only includes one
change to the crypto/ package, but worth upgrading just to be ready
for the official 1.15 stable release.
2020-08-10 11:24:32 -07:00
Roland Bracewell Shoemaker 75b034637b
Update travis go versions (remove 1.14.1, add 1.15rc1) (#5002)
Fixes #4919.
2020-08-04 12:13:09 -07:00
Aaron Gable 09917baf47
Add gosec linter to golangci-lint (#4990)
This enables the gosec linter. It also disables a number of
warnings which it emits on the current codebase. Some of these
(e.g. G104: Errors unhandled) we expect to leave disabled
permanently; others (e.g. G601: Implicit memory aliasing in for loop)
we expect to fix and then enable to prevent regressions.

Part of #4948
2020-07-28 16:42:17 -07:00
Aaron Gable 696fc4e122
Enable testing on go1.14.5 (#4953)
New go version 1.14.5 was released today:
https://groups.google.com/g/golang-announce/c/XZNfaiwgt2w/m/E6gHDs32AQAJ
It includes a security fix for X.509 verification
(CVE-2020-14039, https://golang.org/issue/39360).
2020-07-14 11:28:39 -07:00
Roland Bracewell Shoemaker 7673f02803
Use cmd/ceremony in integration tests (#4832)
This ended up taking a lot more work than I expected. In order to make the implementation more robust a bunch of stuff we previously relied on has been ripped out in order to reduce unnecessary complexity (I think I insisted on a bunch of this in the first place, so glad I can kill it now).

In particular this change:

* Removes bhsm and pkcs11-proxy: softhsm and pkcs11-proxy don't play well together, and any softhsm manipulation would need to happen on bhsm, then require a restart of pkcs11-proxy to pull in the on-disk changes. This makes manipulating softhsm from the boulder container extremely difficult, and because of the need to initialize new on each run (described below) we need direct access to the softhsm2 tools since pkcs11-tool cannot do slot initialization operations over the wire. I originally argued for bhsm as a way to mimic a network attached HSM, mainly so that we could do network level fault testing. In reality we've never actually done this, and the extra complexity is not really realistic for a handful of reasons. It seems better to just rip it out and operate directly on a local softhsm instance (the other option would be to use pkcs11-proxy locally, but this still would require manually restarting the proxy whenever softhsm2-util was used, and wouldn't really offer any realistic benefit).
* Initializes the softhsm slots on each integration test run, rather than when creating the docker image (this is necessary to prevent churn in test/cert-ceremonies/generate.go, which would need to be updated to reflect the new slot IDs each time a new boulder-tools image was created since slot IDs are randomly generated)
* Installs softhsm from source so that we can use a more up to date version (2.5.0 vs. 2.2.0 which is in the debian repo)
* Generates the root and intermediate private keys in softhsm and writes out the root and intermediate public keys to /tmp for use in integration tests (the existing test-{ca,root} certs are kept in test/ because they are used in a whole bunch of unit tests. At some point these should probably be renamed/moved to be more representative of what they are used for, but that is left for a follow-up in order to keep the churn in this PR as related to the ceremony work as possible)
Another follow-up item here is that we should really be zeroing out the database at the start of each integration test run, since certain things like certificates and ocsp responses will be signed by a key/issuer that is no longer is use/doesn't match the current key/issuer.

Fixes #4832.
2020-06-03 15:20:23 -07:00
Jacob Hoffman-Andrews b1347fb3b3
Upgrade to latest protoc and protoc-gen-go (#4794)
There are some changes to the code generated in the latest version, so
this modifies every .pb.go file.

Also, the way protoc-gen-go decides where to put files has changed, so
each generate.go gets the --go_opt=paths=source_relative flag to
tell protoc to continue placing output next to the input.

Remove staticcheck from build.sh; we get it via golangci-lint now.

Pass --no-document to gem install fpm; this is recommended in the fpm docs.
2020-04-23 18:54:44 -07:00
Jacob Hoffman-Andrews 0b3223494c
Clean up tag_and_upload.sh. (#4791)
We used a template and sed in #3622 because common versions of Docker
didn't support build args. But now they do, so we can use the convenient
build args feature to parameterize which Go version to use.

Also, remove the --no-cache flag to docker build, which slows things
down unnecessarily.
2020-04-23 11:52:29 -07:00
Jacob Hoffman-Andrews 87fb6028c1
Add log validator to integration tests (#4782)
For now this mainly provides an example config and confirms that
log-validator can start up and shut down cleanly, as well as provide a
stat indicating how many log lines it has handled.

This introduces a syslog config to the boulder-tools image that will write
logs to /var/log/program.log. It also tweaks the various .json config
files so they have non-default syslogLevel, to ensure they actually
write something for log-validator to verify.
2020-04-20 13:33:42 -07:00
Jacob Hoffman-Andrews 908e8b5590
Test with Go 1.14.1 only. (#4785)
Now that we've deployed Go 1.14.1 in prod, we can remove 1.13.2 from our
test matrix.
2020-04-16 16:57:05 -07:00
Jacob Hoffman-Andrews 9fbab1a1cd
Switch to golangci-lint for our lints. (#4766)
This makes it easier to configure additional linters, and provides us an
easy command to run locally.

The initial set of linters reflects those we are already running:

govet gofmt ineffassign errcheck misspell staticcheck

Note that misspell is in addition to the Python codespell package.

Since the invocation of these linters from golangci-lint is slightly
different from how we currently invoke them, there are some new
findings. This PR won't pass tests until #4763, #4764, and #4765 are
merged.

Incidentally, rename strat -> strategy to appeal misspell.
2020-04-09 09:42:24 -07:00
Jacob Hoffman-Andrews 48942db1a9
Add staticcheck to CI (#4731)
This adds staticcheck to our "lints" CI, with a list of excluded checks. Some of these are checks that we don't care about much (like error string capitalization). Others are nice to fix (possible nil pointer dereferences in _test.go files), but we'd like to land the automated checking first to catch any new issues, then later winnow down the list.

This builds on #4726, #4725, and #4722, which addressed some of the categories of findings from staticcheck.
2020-04-06 17:37:19 -07:00
Jacob Hoffman-Andrews 28dbbce8da
Make boulder-tools image smaller. (#4732)
Instead of installing Certbot from the repo, install the python-acme
library (the only piece we need) from the apt repository. This also
allows us to skip installing build dependencies for Certbot.

Uninstall cmake after building.

Clean the various Go caches.

Move codespell and acme into requirements.txt. Don't use virtualenv anymore.

This reduces image size from 1.4 GB to 1.0 GB.

Incidentally, move the Go install to its own phase in the Dockerfile.
This will give it its own image layer, making rebuilds faster.
2020-04-06 16:53:42 -07:00
Jacob Hoffman-Andrews 995e25e8c3
Start testing Go 1.14.1 in Travis. (#4718)
As part of the process, pin specific versions of protoc-gen-go, mockgen,
and goveralls. Protoc-gen-go recently released a version that was incompatible
with our current version of gRPC. Mockgen has a version that was generating
spurious diffs in our generate test phase, and goveralls recently added
some code that calls git branch --format=..., which breaks on the version of
git in our Docker image.

Pinning versions required forcing go get into module-aware mode, since the
old-style go get doesn't understand versions.
2020-04-06 09:18:00 -07:00
Daniel McCarney 5573760723 CI: Add codespell to detect common typos. (#4637)
The `codespell` tool will be run during the "lints" phase of `test.sh`.
See `.codespell.ignore.txt for ignored words. Note that these ignored
words should be listed one per-line, in **lowercase** form.

The boulder-tools `build.sh` script is updated to include `codespell` in
the tools image. I built and pushed new images with this script that are
ref'd by `docker-compose.yml`.

Resolves #4635
2020-01-07 17:09:51 -08:00
Daniel McCarney f1894f8d1d
tidy: typo fixes flagged by codespell (#4634) 2020-01-07 14:01:26 -05:00
Jacob Hoffman-Andrews 1146eecac3 integration: use python3 (#4582)
Python 2 is over in 1 month 4 days: https://pythonclock.org/

This rolls forward most of the changes in #4313.

The original change was rolled back in #4323 because it
broke `docker-compose up`. This change fixes those original issues by
(a) making sure `requests` is installed and (b) sourcing a virtualenv
containing the `requests` module before running start.py.

Other notable changes in this:
 - Certbot has changed the developer instructions to install specific packages
rather than rely on `letsencrypt-auto --os-packages-only`, so we follow suit.
 - Python3 now has a `bytes` type that is used in some places that used to
provide `str`, and all `str` are now Unicode. That means going from `bytes` to
`str` and back requires explicit `.decode()` and `.encode()`.
 - Moved from urllib2 to requests in many places.
2019-11-28 09:54:58 -05:00
Jacob Hoffman-Andrews 5ff750076c Move to Go 1.13.2. (#4490) 2019-10-17 15:39:04 -04:00
Roland Bracewell Shoemaker 215818a13a Remove godeps cruft (#4467)
Boulder is fully transitioned to using 1st party Go modules/dependency management.
2019-10-07 14:55:14 -04:00
Daniel McCarney 93902965e5 Add Go 1.13 support, temporarily disable TLS 1.3 default. (#4435)
A unit test is included to verify that a TLS-ALPN-01 challenge to
a TLS 1.3 only server doesn't succeed when the `GODEBUG` value to
disable TLS 1.3 in `docker-compose.yml` is set. Without this env var
the test fails on the Go 1.13 build because of the new default:

```
=== RUN   TestTLSALPN01TLS13
--- FAIL: TestTLSALPN01TLS13 (0.04s)
    tlsalpn_test.go:531: expected problem validating TLS-ALPN-01 challenge against a TLS 1.3 only server, got nil
    FAIL
    FAIL        github.com/letsencrypt/boulder/va       0.065s
```

With the env var set the test passes, getting the expected connection
problem reporting a tls error:

```
=== RUN   TestTLSALPN01TLS13
2019/09/13 18:59:00 http: TLS handshake error from 127.0.0.1:51240: tls: client offered only unsupported versions: [303 302 301]
--- PASS: TestTLSALPN01TLS13 (0.03s)
PASS
ok      github.com/letsencrypt/boulder/va       1.054s
```

Since we plan to eventually enable TLS 1.3 support and the `GODEBUG`
mechanism tested in the above test is platform-wide vs package
specific I decided it wasn't worth the time investment to write a
similar HTTP-01 unit test that verifies the TLS 1.3 behaviour on a
HTTP-01 HTTP->HTTPS redirect.

Resolves https://github.com/letsencrypt/boulder/issues/4415
2019-09-17 11:00:58 -07:00
Daniel McCarney c2d8876413
test: remove Go 1.12.0 support (#4401) 2019-08-14 17:26:35 -04:00
Roland Bracewell Shoemaker 04fb34c282 tools: add golang1.12.8 to travis (#4400) 2019-08-13 17:32:19 -04:00
Roland Bracewell Shoemaker 2e4531342d tests: add authorization deactivation integration tests (#4381)
Add pending and valid authorization deactivation integration tests
2019-07-31 17:47:52 -04:00
Jacob Hoffman-Andrews 3af49a16be
Revert "integration: move to Python3 (#4313)" (#4323)
This reverts commit 796a7aa2f4.

People's tests have been breaking on `docker-compose up` with the following output:

```
ImportError: No module named requests
```

Fixes #4322
2019-07-03 11:35:45 -07:00
Jacob Hoffman-Andrews 796a7aa2f4 integration: move to Python3 (#4313)
* integration: move to Python3

- Add parentheses to all print and raise calls.
- Python3 distinguishes bytes from strings. Add encode() and
  decode() calls as needed to provide the correct type.
- Use requests library consistently (urllib3 is not in Python3).
- Remove shebang from Python files without a main, and update
  shebang for integration-test.py.
2019-07-02 09:28:49 -04:00
Jacob Hoffman-Andrews 23cb68be4f Remove Go 1.11.5 from tag-and-upload.sh. (#4149)
Also switch to venv3.py for initializing Certbot, to avoid a Python 2.7 deprecation warning.
2019-04-09 12:47:31 -07:00
Jacob Hoffman-Andrews d2d5f0a328 Update miekg/dns and golang/protobuf. (#4150)
Precursor to #4116. Since some of our dependencies impose a minimum
version on these two packages higher than what we have in Godeps, we'll
have to bump them anyhow. Bumping them independently of the modules
update should keep things a little simpler.

In order to get protobuf tests to pass, I had to update protoc-gen-go in
boulder-tools. Now we download a prebuilt binary instead of using the
Ubuntu package, which is stuck on 3.0.0. This also meant I needed to
re-generate our pb.go files, since the new version generates somewhat
different output.

This happens to change the tag for pbutil, but it's not a substantive change - they just added a tagged version where there was none.

$ go test github.com/miekg/dns/...
ok      github.com/miekg/dns    4.675s
ok      github.com/miekg/dns/dnsutil    0.003s

ok      github.com/golang/protobuf/descriptor   (cached)
ok      github.com/golang/protobuf/jsonpb       (cached)
?       github.com/golang/protobuf/jsonpb/jsonpb_test_proto     [no test files]
ok      github.com/golang/protobuf/proto        (cached)
?       github.com/golang/protobuf/proto/proto3_proto   [no test files]
?       github.com/golang/protobuf/proto/test_proto     [no test files]
ok      github.com/golang/protobuf/protoc-gen-go        (cached)
?       github.com/golang/protobuf/protoc-gen-go/descriptor     [no test files]
ok      github.com/golang/protobuf/protoc-gen-go/generator      (cached)
ok      github.com/golang/protobuf/protoc-gen-go/generator/internal/remap       (cached)
?       github.com/golang/protobuf/protoc-gen-go/grpc   [no test files]
?       github.com/golang/protobuf/protoc-gen-go/plugin [no test files]
ok      github.com/golang/protobuf/ptypes       (cached)
?       github.com/golang/protobuf/ptypes/any   [no test files]
?       github.com/golang/protobuf/ptypes/duration      [no test files]
?       github.com/golang/protobuf/ptypes/empty [no test files]
?       github.com/golang/protobuf/ptypes/struct        [no test files]
?       github.com/golang/protobuf/ptypes/timestamp     [no test files]
?       github.com/golang/protobuf/ptypes/wrappers      [no test files]
2019-04-09 09:27:28 -07:00
Jacob Hoffman-Andrews 2f6626afca Add Go 1.12 to Travis. (#4097)
* Add Go 1.12 to Travis.
* Update tag date.
* Fix go vet.
2019-03-06 16:45:11 -05:00
Jacob Hoffman-Andrews 80629eaff8 Remove Go 1.10 from test matrix. (#4092) 2019-03-01 08:13:33 -05:00
Roland Bracewell Shoemaker a6a00cb2ee Add ineffassign to CI tests (#4056) 2019-02-14 09:47:16 -05:00
Daniel McCarney 7369bf0354
CI/Dev: Remove boulder-tools Certbot version pin. (#4047)
The upstream Certbot project acme module supports initiating TLS-ALPN-01
challenges again and so we can remove the version pin we had in place.
This lets us keep the Certbot version we're testing with in-sync with
master at the time of building the tools image again.
2019-02-11 12:36:48 -05:00
Jacob Hoffman-Andrews cee32b10ba
Break dependency on Golang docker image (#4028)
When a Golang security release comes out, we don't want to wait on
the upstream Docker image to update and upload before we can start
running tests on it. This changes our boulder-tools image so it
can download and install Golang itself.

Also, fix some issues in build.sh:

Unparallelize the `go get` with the `apt install`. The `go get`
pulls in `go-sqlite3`, which needs `cmake`, installed by `apt install`.
    
Also, don't remove build-essential and cmake at the end.
2019-01-23 15:36:08 -08:00
Daniel McCarney b29c762167 CI/Dev: Update Go 1.11.3 -> 1.11.4, update challtestsrv. (#3996)
1. Updates both boulder tools images to use an update `pebble-challtestsrv`
2. Updates the Go 1.11.3 boulder tools image to Go 1.11.4
3. Updates the vendored `challtestsrv` dep to 1.0.2

This fixes a panic in the `challtestsrv` library and prepares us to move directly 
to 1.11.4 after we've resolved the outstanding issues keeping us on the 1.10.x 
stream in prod/staging.

There are no unit tests to run for item 3.
2019-01-09 11:27:43 -08:00
Jacob Hoffman-Andrews 340c1e4681
Bump Go versions in boulder-tools. (#3987) 2018-12-13 16:26:20 -08:00
Daniel McCarney 893e8459d6
Use pebble-challtestrv cmd, letsencrypt/challtestsrv package. (#3980)
Now that Pebble has a `pebble-challtestsrv` we can remove the `challtestrv`
package and associated command from Boulder. I switched CI to use
`pebble-challtestsrv`. Notably this means that we have to add our expected mock
data using the HTTP management interface. The Boulder-tools images are
regenerated to include the `pebble-challtestsrv` command.

Using this approach also allows separating the TLS-ALPN-01 and HTTPS HTTP-01
challenges by binding each challenge type in the `pebble-challtestsrv` to
different interfaces both using the same VA
HTTPS port. Mock DNS directs the VA to the correct interface.

The load-generator command that was previously using the `challtestsrv` package
from Boulder is updated to use a vendored copy of the new
`github.org/letsencrypt/challtestsrv` package.

Vendored dependencies change in two ways:
1) Gomock is updated to the latest release (matching what the Bouldertools image
   provides)
2) A couple of new subpackages in `golang.org/x/net/` are added by way of
   transitive dependency through the challtestsrv package.

Unit tests are confirmed to pass for `gomock`:
```
~/go/src/github.com/golang/mock/gomock$ git log --pretty=format:'%h' -n 1
51421b9
~/go/src/github.com/golang/mock/gomock$ go test ./...
ok    github.com/golang/mock/gomock 0.002s
?     github.com/golang/mock/gomock/internal/mock_matcher [no test files]
```
For `/x/net` all tests pass except two `/x/net/icmp` `TestDiag.go` test cases
that we have agreed are OK to ignore.

Resolves https://github.com/letsencrypt/boulder/issues/3962 and
https://github.com/letsencrypt/boulder/issues/3951
2018-12-12 14:32:56 -05:00
Daniel McCarney 965acf381b
CI/Dev: Go 1.11.1 -> 1.11.2 (#3945) 2018-11-19 15:21:53 -05:00
Daniel McCarney 3319246a97 Dev/CI: Add Go 1.11.1 builds (#3888)
Resolves https://github.com/letsencrypt/boulder/issues/3872

**Note to reviewers**: There's an outstanding bug that I've tracked down to the `--load` stage of the integration tests that results in one of the remote VA instances in the `test/config-next` configuration under Go 1.11.1 to fail to cleanly shut down. I'm working on finding the root cause but in the meantime I've disabled `--load` during CI so we can unblock moving forward with getting Go 1.11.1 in dev/CI. Tracking this in https://github.com/letsencrypt/boulder/issues/3889
2018-10-19 09:38:20 -07:00
Daniel McCarney 740dc92e48 setup cleanup: update build.sh, remove setup.sh (#3885)
`test/setup.sh` is removed because it was a relic of the "slowstart" instructions we removed from the README previously. One less place to keep in-sync.

`test/boulder-tools/build.sh` is updated to fix three problems: 
  1) the `github.com/golang/lint/golint` package moved to `golang.org/x/lint/golint`
  2) it did not abort if a background process (e.g. `apt` or `go get`) failed for any reason.
  3) Certbot master has removed tls-alpn-01 support

Problem 1 was causing `go get github.com/golang/lint/golint` to fail. Problem 2 was causing Problem 1 to be ignored, resulting in Docker images that were missing all of the dev tools (missing `goose` is the
first error to indicate this state).

Problem 3 breaks the TLS-ALPN-01 integration tests from `test/config-next` and requires using a specific version of Certbot (even though we don't rely on Certbot for solving the TLS-ALPN-01 challenge, we do rely on it to POST the initiation of the challenge and that does not function with Certbot master).
2018-10-15 08:41:48 -07:00
Daniel McCarney fa9a79b55f
CI/Dev: Remove Go 1.10.2. (#3761)
We've migrated the production/staging Boulder instances to builds using
Go 1.10.3 and can now remove the Go 1.10.2 builds from the travis matrix
and the `tag_and_upload.sh` Boulder tools script.
2018-06-14 12:04:29 -04:00
Daniel McCarney b9dd06ad85 CI/Dev: Add Go 1.10.3 to build matrix. (#3751) 2018-06-11 15:55:26 -07:00
Daniel McCarney 700219a4a0
Dev/CI: Remove Go 1.10.1, default to 1.10.2 (#3711)
Production/staging have been updated to a release built with Go 1.10.2.
This allows us to remove the Go 1.10.1 builds from the travis matrix and
default to Go 1.10.2.
2018-05-11 16:25:25 -04:00
Roland Bracewell Shoemaker 9920058ef0 Cleanup .travis.yml (#3691)
Our `.travis.yml` does some weird things that are a bit non-standard. This change brings it into line with the general Travis conventions - https://docs.travis-ci.com/user/customizing-the-build
2018-05-04 19:32:30 -04:00
Daniel McCarney 230db4ebd1 Dev/CI: Add Go 1.10.2 to build matrix. (#3690)
This PR adds Go 1.10.2 to the build matrix along with Go 1.10.1.

After staging/prod have been updated to Go 1.10.2 we can remove Go 1.10.1.

Resolves #3680
2018-05-04 12:35:11 -07:00
Daniel McCarney f235b96339 CI/Dev/Tools: Remove Go 1.10.0 builds/tests. (#3645)
We have updated staging/prod Boulder builds to use Go 1.10.1. This means
we no longer need to support Go 1.10.0 in dev docker images, CI, and our
image building tools.
2018-04-12 13:24:33 -07:00
Daniel McCarney aef2fbb13f Tools: Support multiple Go versions in CI/Dev. (#3622)
This PR updates the `test/boulder-tools/tag_and_upload.sh` script to template a `Dockerfile` for building multiple copies of `boulder-tools`: one per supported Go version. Unfortunately this is required because only Docker 17+ supports an env var in a Dockerfile `FROM`. It's best if we can stay on package manger installed versions of Docker which precludes 17+ 😞.

The `docker-compose.yml` is updated to version "3" to allow specifying a `GO_VERSION` env var in the respective Boulder `image` directives. This requires `docker-compose` version 1.10.0+ which in turn requires Docker engine version 1.13.0+. The README is updated to reflect these new requirements. This Docker engine version is commonly available in package managers (e.g. Ubuntu 16.04). A sufficient `docker-compose` version is not, but this is a simple one binary Go application that is easy to update outside of package managers.

The `.travis.yml` config file is updated to set the `GO_VERSION` in the build matrix, allowing build tasks for different Go versions. Since the `docker-compose.yml` now requires `docker-compose` 1.10.0+ the
`.travis.yml` also gains a new `before_install` for setting up a modern `docker-compose` version.

Lastly tools and images are updated to support both Go 1.10 (our current Go version) and Go 1.10.1 (the new point release). By default Go 1.10 is used, we can switch this once staging/prod are updated.

_*TODO*: One thing I haven't implemented yet is a `sed` expression in `tag_and_upload.sh` that updates both `image` lines in `docker-compose.yml` with an up-to-date tag. Putting this up for review while I work on that last creature comfort._

Resolves https://github.com/letsencrypt/boulder/issues/3551

Replaces https://github.com/letsencrypt/boulder/pull/3620 (GH got stuck from a yaml error)
2018-04-05 14:08:54 -07:00
Jacob Hoffman-Andrews c4607bac52 Update boulder-tools to new version. (#3535)
This pulls in an updated Certbot repo with a fix to content-type for the
revoke method.

Also, adds a convenience replacement in tag_and_release.sh to update
docker-compose.yml.
2018-03-08 18:14:58 +00:00
Jacob Hoffman-Andrews 6b8b6a37c0 Update chisel2 and boulder-tools (#3495)
This change updates boulder-tools to use Go 1.10, and references a
newly-pushed image built using that new config.

Since boulder-tools pulls in the latest Certbot master at the time of
build, this also pulls in the latest changes to Certbot's acme module,
which now supports ACME v2. This means we no longer have to check out
the special acme-v2-integration branch in our integration tests.

This also updates chisel2.py to reflect some of the API changes that
landed in the acme module as it was merged to master.

Since we don't need additional checkouts to get the ACMEv2-compatible
version of the acme module, we can include it in the default RUN set for
local tests.
2018-02-28 15:21:40 -08:00
Jacob Hoffman-Andrews 9051c2c9fa Remove boulder-tools checkout of mockgen/model. (#3455)
This was added in the theory that it would stop some errors running
`docker compose go generate ./...` but in tests today, that command
succeeds right now even after removing this from the build steps and
rebuilding. This is not surprising, because as Roland pointed out, the
/alt-gopath/ path was never actually referenced anywhere.
2018-02-19 09:02:55 -05:00
Jacob Hoffman-Andrews 8261d60ff9 Bump Go version and push new Docker image. (#3453)
Also, move the installation of `mock/model` above the removal of junk
directories; otherwise we get a "getcwd: no such file or directory"
error.
2018-02-16 09:27:19 -05:00
Jacob Hoffman-Andrews c556a1a20d
Reduce spurious errors in integration test (#3436)
Boulder is fairly noisy about gRPC connection errors. This is a mixed
blessing: Our gRPC configuration will try to reconnect until it hits
an RPC deadline, and most likely eventually succeed. In that case,
we don't consider those to really be errors. However, in cases where
a connection is repeatedly failing, we'd like to see errors in the
logs about connection failure, rather than "deadline exceeded." So
we want to keep logging of gRPC errors.

However, right now we get a lot of these errors logged during
integration tests. They make the output hard to read, and may disguise
more serious errors. So we'd like to avoid causing such errors in
normal integration test operation.

This change reorders the startup of Boulder components by their gRPC
dependencies, so everything's backend is likely to be up and running
before it starts. It also reverses that order for clean shutdowns,
and waits for each process to exit before signalling the next one.

With these changes, I still got connection errors. Taking listenbuddy
out of the gRPC path fixed them. I believe the issue is that
listenbuddy is not a truly transparent proxy. In particular, it
accepts an inbound TCP connection before opening an outbound TCP
connection. If opening that outbound connection results in "connection
refused," it closes the inbound connection. That means gRPC sees a
"connection closed" (or "connection reset"?) rather than "connection
refused". I'm guessing it handles those cases differently, explaining
the different error results.

We've been using listenbuddy to trigger disconnects while Boulder is
running, to ensure that gRPC's reconnect code works. I think we can
probably rely on gRPC's reconnect to work. The initial problem that
led us to start testing this was a configuration problem; now that
we have the configuration we want, we should be fine and don't need
to keep testing reconnects on every integration test run.
2018-02-12 18:17:50 -08:00
Jacob Hoffman-Andrews af0bd70196
Update boulder-tools version. (#3294)
Also update chisel.py to refer to josepy, and update featureflag_string.go based on latest stringer.

Fixes #3289
2017-12-21 10:36:04 -08:00
Jacob Hoffman-Andrews 84eaf49352 Update to Go 1.9.1 (#3153)
Update the boulder-tools Docker image, and switch to the new tag.
2017-10-06 09:38:49 -04:00
Jacob Hoffman-Andrews f472587a13 In tag_and_upload, ensure correct directory. (#3151)
This avoids accidentally building the Boulder Dockerfile instead of the
boulder-tools one.
2017-10-06 09:36:07 -04:00
Roland Bracewell Shoemaker e91349217e Switch to using go 1.9 (#3047)
* Switch to using go 1.9

* Regenerate with 1.9

* Manually fix import path...

* Upgrade mockgen and regenerate

* Update github.com/golang/mock
2017-09-06 16:30:13 -04:00
Roland Bracewell Shoemaker 8fe0697b9a Bump golang version to 1.8.3 (#2787) 2017-05-25 17:01:31 -07:00
Roland Bracewell Shoemaker 08f4dda038 Update github.com/grpc-ecosystem/go-grpc-prometheus and google.golang.org/grpc (#2637)
Updates the various gRPC/protobuf libs (google.golang.org/grpc/... and github.com/golang/protobuf/proto) and the boulder-tools image so that we can update to the newest github.com/grpc-ecosystem/go-grpc-prometheus. Also regenerates all of the protobuf definition files.

Tests run on updated packages all pass.

Unblocks #2633 fixes #2636.
2017-04-03 11:13:48 -07:00
Daniel McCarney 9da55fd5a5 Merge pull request #2574 from calavera/update_to_go_1_8
Update to Go 1.8.0.
2017-02-24 12:24:01 -05:00
Daniel McCarney e23b4b6896 Adds script for tagging boulder-tools images. (#2577)
This commit adds a small script `tag_and_upload.sh` that:

1) Builds the boulder-tools image with the correct tag
2) Prompts you to log in to dockerhub
3) Pushes the boulder-tools image

This means I won't have to remember how to do this next time we need to
bump our Go version :-)
2017-02-21 12:00:44 -05:00
David Calavera 0d1cc66cab
Update to Go 1.8.0.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-02-21 10:57:57 +01:00
Jacob Hoffman-Andrews 1b994083ba Use latest Certbot in boulder-tools. (#2554)
This allows us to iterate more easily against the current acme module.

Also, remove nodejs from boulder-tools, clean up a few packages that weren't
previously cleaned up, and install a specific version of protoc-gen-go to match
our vendored grpc.
2017-02-09 16:10:01 -08:00
Roland Bracewell Shoemaker 313bc75c05 Switch to Golang 1.7.3 in travis (#2305)
Protobuf files need to be regenerated because (I think) Golang 1.7.3 uses a somewhat different method of ordering fields in a struct when marshaling to bytes.
2016-11-07 10:49:23 -08:00
Jacob Hoffman-Andrews 580c25286a Switch back to go 1.5 in Travis. (#2261)
* Switch back to go 1.5 in Travis.

* Add back GO15VENDOREXPERIMENT.

* Add GO15VENDOREXPERIMENT to Dockerfile

* Revert FAKE_DNS change.

* Revert "Properly close test servers (#2110)"

* Revert "Close VA HTTP test servers (#2111)"

* Change Godep version to 1.5.

* Standardize on issue number
2016-10-20 14:11:26 -04:00
Roland Bracewell Shoemaker 239bf9ae0a Very basic feature flag impl (#1705)
Updates #1699.

Adds a new package, `features`, which exposes methods to set and check if various internal features are enabled. The implementation uses global state to store the features so that services embedded in another service do not each require their own features map in order to check if something is enabled.

Requires a `boulder-tools` image update to include `golang.org/x/tools/cmd/stringer`.
2016-09-20 16:29:01 -07:00
Jacob Hoffman-Andrews 87fee12d6c Improve single-ocsp command (#2181)
Output base64-encoded DER, as expected by ocsp-responder.
Use flags instead of template for Status, ThisUpdate, NextUpdate.
Provide better help.
Remove old test (wasn't run automatically).
Add it to integration test, and use its output for integration test of issuer ocsp-responder.

Add another slot to boulder-tools HSM image, to store root key.
2016-09-15 15:28:54 -07:00
Roland Bracewell Shoemaker e3266a1684 Switch to Golang 1.6.3 (#2105)
* Switch to golang 1.6

* Update docker image references

* Update godep major version

* Remove GO15VENDOREXPERIMENT references

* Fix errcheck ignore path
2016-08-05 16:35:43 -04:00
Roland Bracewell Shoemaker a0a9623cb6 Switch to using SoftHSM in Docker for testing (#1920)
Instead of reading the CA key from a file on disk into memory and using that for signing in `boulder-ca` this patch adds a new Docker container that runs SoftHSM and pkcs11-proxy in order to hold the key and perform signing operations. The pkcs11-proxy module is used by `boulder-ca` to talk to the SoftHSM container.

This exercises (almost) the full pkcs11 path through boulder and will allow testing various HSM related failures in the future as well as simplifying tuning signing performance for benchmarking.

Fixes #703.
2016-07-11 11:20:51 -07:00
Jacob Hoffman-Andrews d0e3883acb Remove special BCode type (#1912) 2016-06-09 09:22:40 -07:00
Jacob Hoffman-Andrews 2c108118a8 Docker test updates (#1842)
Commit test/boulder-tools (forgot to include them in #1838).
Mount $GOPATH as a volume in the container so that source code changes take
effect in the container without a rebuild, and build cache can make repeated
runs faster. Install rabbitmq-setup outside of the mounted-over path so it still
exists.
Remove unnecessary entries from Dockerfile's PATH and GOBIN.

https://github.com/letsencrypt/boulder/pull/1842
2016-05-25 12:19:51 -07:00
Jacob Hoffman-Andrews b954dcc010 Revert "Run Travis tests in Docker (#1830)" (#1834)
This reverts commit 92d94f2 and commit 0b4623f to unbreak the Certbot build.
2016-05-20 15:57:10 -07:00
Jacob Hoffman-Andrews 92d94f2558 Run Travis tests in Docker (#1830)
* MariaDB 10.1

* MariaDB 10.1 in Docker

* Run docker stuff.

* Improve test.js error.

* Lower log level

* Revert dockerfile to master

* Export debug ports, set FAKE_DNS, and remove container_name.

* Remove typo.

* Make integration-test.py wait for debug ports.

* Use 10.1 and export more Boulder ports.

* Test updates for Docker

Listen on 0.0.0.0 for utility servers.
Make integration-test.py just wait for ports rather than calling startservers.
Run docker-compose in test.sh.
Remove bypass when database exists.
Separate mailer test into its own function in integration test.
Print better errors in test.js.

* Always bring up mysql container.

* Wait for MySQL to come up.

* Put it in travis-before-install.

* Use 127

* Remove manual docker-up.

* Add ifconfig

* Switch to docker-compose run

* It works!

* Remove some spurious env vars.

* Add bash

* try running it

* Add all deps.

* Pass through env.

* Install everything in the Dockerfile.

* Fix install of ruby

* More improvements

* Revert integration test to run directly
Also remove .git from dockerignore and add some packages.

* Revert integration-test.py to master.

* Stop ignoring test/js

* Start from boulder-tools.

* Add boulder-tools.

* Tweak travis.yml

* Separate out docker-compose pull as install.

* Build in install phase; don't bother with go install in Dockerfile

* Add virtualenv

* Actually build rabbitmq-setup

* Remove FAKE_DNS

* Trivial change

* Pull boulder-tools as a separate step so it gets its own timing info.

* Install certbot and protobuf from repos.

* Use cerbot from debian backports.

* Fix clone

* Remove CERTBOT_PATH

* Updates

* Go back to letsencrypt for build.sh

* Remove certbot volume.

* go back to preinstalled letsencrypt

* Restore ENV

* Remove BASH_ENV

* Adapt reloader test so it psses when run as root.

* Fixups for review.

* Revert test.js

* Revert startservers.py

* Revert Makefile.
2016-05-19 16:29:45 -07:00