Commit Graph

24 Commits

Author SHA1 Message Date
Aaron Gable 146b78a0f7
Remove all static minica keys (#7489)
Remove the redis-tls, wfe-tls, and mail-test-srv keys which were
generated by minica and then checked in to the repo. All three are
replaced by the dynamically-generated ipki directory.

Part of https://github.com/letsencrypt/boulder/issues/7476
2024-05-17 11:45:40 -07:00
Phil Porada 3866e4f60d
VA: Use default PortConfig during testing (#6609)
Part of #3940
2023-01-25 16:16:08 -05:00
Samantha 90eb90bdbe
test: Replace sd-test-srv with consul (#6389)
- Add a dedicated Consul container
- Replace `sd-test-srv` with Consul
- Add documentation for configuring Consul
- Re-issue all gRPC credentials for `<service-name>.service.consul`

Part of #6111
2022-09-19 16:13:53 -07:00
Jacob Hoffman-Andrews 1047c4cf7a
Remove chisel.py (#5986)
This was used for ACMEv1 and is not needed anymore.

Also update some outdated references in chisel2.py.
2022-03-11 08:39:06 -08:00
Jacob Hoffman-Andrews 5527716410
Port v1 integration tests to v2. (#4807)
As of this change, each test case in v1_integration.py has an equivalent
in v2_integration.py. This mostly involved copying the test cases and
tweaking them to use chisel2.py. I had to add support for updating email
addresses in chisel2.py (copied from chisel.py) in order to support one
of the test cases.

The VA was not yet configured to recognize account paths that start
with the ACMEv2 path, so I added that configuration.

The most useful way to see what's changed in porting the test cases
is to check out this branch and then do a diff between v1_integration.py
and v2_integration.py.
2020-05-13 11:59:04 -07: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 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 f61242e751
Unshadow v2 integration tests. (#4131)
Previously the v2_integration tests were imported to the global
namespace in integration-test.py. As a result, some were shadowed and
didn't run, or called methods that were in the main namespace rather
than their own.

This PR imports and runs them under their own namespace. It also fixes
some tests that were broken. Notably:

- Fixes chisel2.expect_problem.
- Fixes incorrect namespacing on some expect_problem calls.
- Remove unused ValidationError from v2_integration.
- Replace client.key with client.net.key.
2019-03-20 17:11:49 -07:00
Daniel McCarney 11433e1ea0
VA: Fix SimplifiedVAHTTP01 redirect query param handling. (#3988)
When the `SimplifiedVAHTTP01` feature flag is enabled we need to
preserve query parameters when reconstructing a redirect URL for the
resolved IP address.

To add integration testing for this condition the Boulder tools images
are updated to in turn pull in an updated `pebble-challtestsrv` command
that tracks request history.

A new Python wrapper for the `pebble-challtestsrv` HTTP API is added to
centralize interacting with the chall test srv to add mock data and to
get the history of HTTP requests that have been processed.
2019-01-04 14:20:44 -05:00
Daniel McCarney bd4c254942
Use Challtestsrv for HTTP-01 integration tests, add redirect tests (#3960)
To complete https://github.com/letsencrypt/boulder/issues/3956 the `challtestsrv` is updated such that its existing TLS-ALPN-01 challenge test server will serve HTTP-01 responses with a self-signed certificate when a non-TLS-ALPN-01 request arrives. This lets the TLS-ALPN-01 challenge server double as a HTTPS version of the HTTP challenge server. The `challtestsrv` now also supports adding/remove redirects that will be served to clients when requesting matching paths.

The existing chisel/chisel2 integration tests are updated to use the `challtestsrv` instead of starting their own standalone servers. This centralizes our mock challenge responses and lets us bind the `challtestsrv` to the VA's HTTP port in `startservers.py` without clashing ports later on.

New integration tests are added for HTTP-01 redirect scenarios using the updated `challtestserv`. These test cases cover:
* valid HTTP -> HTTP redirect
* valid HTTP -> HTTPS redirect
* Invalid HTTP -> non-HTTP/HTTPS port redirect
* Invalid HTTP-> non-HTTP/HTTPS protocol scheme redirect
* Invalid HTTP-> bare IP redirect
* Invalid HTTP redirect loop

The new integration tests shook out two fixes that were required for the legacy VA HTTP-01 code (afad22b) and one fix for the challtestsrv mock DNS (59b7d6d).

Resolves https://github.com/letsencrypt/boulder/issues/3956
2018-11-30 17:20:10 -05:00
Roland Bracewell Shoemaker 9ea4a54ca2 Use challtestsrv for solving TLS-ALPN-01 in integration tests (#3789)
Also in the process fix some errors I made in the original challtestsrv TLS-ALPN-01 implementation.

Fixes #3780.
2018-07-03 10:41:20 -04:00
Daniel McCarney c254159235 challsrv: Common ACME challenge response server library/command. (#3689)
Prior to this commit we had two implementations of ACME challenge
servers for use in tests:
1) test/dns-test-srv - a small fake DNS server used for adding/removing
   DNS-01 TXT records and returning fake A/AAAA data.
2) test/load-generator/challenge-servers.go - a small library for
   providing an HTTP-01 challenge server.

This commit consolidates both into a dedicated `test/challsrv` package.
The `load-generator` code is updated to use this library package to
implement its HTTP-01 challenge server. This leaves the `load-generator`
as a nice stand alone tool that doesn't need coordination between itself
and a separate `challsrv` binary.

To keep the `dns-test-srv` use-case of a nice standalone binary that can
be run from `test/startservers.py` the `test/challsrv` package has
a `test/challsrv/cmd/challsrv` package that provides the `challsrv`
command. This is a stand-alone binary that can offer both an HTTP-01 and
a DNS-01 challenge server along with a management HTTP interface that
can be used by external programs to add/remove HTTP-01 and DNS-01
challenges.

The Boulder integration tests are updated to use `challsrv` instead of
`dns-test-srv`. Presently only the DNS-01 challenge server of `challsrv`
is used by the integration tests.

TODO: The DNS-01 challenge server is doing a fair number of non-DNS-01
challenge things (Fake host data, etc). This should be cleaned up and
made configurable.

Updates #3652
2018-05-09 12:49:13 -07:00
Jacob Hoffman-Andrews bc2085bbe0 Default to DNS challenge in chisel and chisel2. (#3621)
This allows these tools to easily be run in command line mode from
the host machine against a Boulder running inside docker-compose up
without modifying the FAKE_DNS field in docker-compose.yml. This
allows for easier testing of various conditions.
2018-04-05 15:37:10 -04:00
Jacob Hoffman-Andrews 268d9b1491 Run v2 integration tests as part of v1 tests. (#3569)
- Remove acme-v2 test phase.
- Rename integration-test-v2.py to v2_integration, so it can be imported.
- Import all symbols from v2_integration before running test_*.
- In chisel2:
  - Rename DIRECTORY so it doesn't collide.
  - Incidental logging and error fixes.
- Merge v1 and v2 load testing into a single function.
- Run cert-checker just once, after all other test cases.
- In v2_integration:
  - Remove unnecessary imports.
  - Import chisel2 methods in the chisel2 namespace so they don't
    collide with chisel methods.
  - Remove main and shutdown code.
2018-03-19 10:19:02 -04:00
Roland Bracewell Shoemaker 459a9036f6 Add integration test for wfe2 OnlyReturnExisting (#3555)
Fixes #3512.
2018-03-15 14:04:46 -07: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 f730abd32c Verify SSL by default in chisel. (#3449)
chisel had verify_ssl=False. Remove that, and set a sensible default
for REQUESTS_CA_BUNDLE to make it easier to run chisel on the command
line. Port the REQUESTS_CA_BUNDLE change into chisel2 as well.
2018-02-15 08:36:04 -05:00
Roland Bracewell Shoemaker 2a8066b54b Refactor revocation integration tests (#3415)
Fixes #3330.
2018-01-31 17:22:07 -08:00
Jacob Hoffman-Andrews b16e788c4b Make chisel2 more adaptable. (#3350)
This makes it easier to use in testing the staging server.
2018-01-09 19:39:41 -05:00
Jacob Hoffman-Andrews 91a3545d8f Return multiple TXT records from dns-test-srv (#3316)
With this change, each call to `/set-txt` adds a record, and `/clear-txt` deletes all records for a hostname.

Part of #3312
2018-01-04 14:00:45 -05:00
Daniel McCarney 488b7259ae
Issue for wildcard name during v2 integration tests. (#3301)
This commit updates `chisel2.py` to support DNS-01 challenges. The code
required was already there, but not "wired in" to the `auth_and_issue`
function. Along the way a bug with `get_chall` raising a string instead
of an exception was fixed.

This commit also updates `test/integration-test-v2.py` with two new tests
1) issuing a certificate with a normal random domain name, and a random wildcard
domain name using DNS-01.
2) issuing a certificate with a random domain name, and in the same certificate,
a wildcard for that domain name. This tests that two authorizations are created 
even though that base domain is the same.
2017-12-21 15:13:56 -05:00
Jacob Hoffman-Andrews b369818ad6 Integration test for ACMEv2 (#3298) 2017-12-21 13:27:32 -05:00
Roland Bracewell Shoemaker e2cc6fbe68 Add test/chisel2.py for ACME v2 testing (#3179)
Pulled out of https://github.com/certbot/certbot/compare/acme-v2 by @jsha, Boulder is the correct place for it to live.
2017-10-19 10:45:51 -07:00