Commit graph

40 commits

Author SHA1 Message Date
Adrien Ferrand
2ac99fefe0 [Windows|Linux] Launch integration tests on Pebble without Docker (#7157)
This PR is a part of the actions necessary to make Certbot-CI work on Windows, in order to execute the integration tests on this platform.

Following #7156, this PR changes how the integration tests are setup against Pebble to not need Docker anymore.

As a reminder, one can check #7156 and letsencrypt/pebble#240 to see the rationale about why using Docker is a problem to run the integration tests on Windows.

Basically, this PR executes directly Pebble using its executable, since it is build using Go, and Go produces self-contained executable that can run without any installation on Linux and on Windows. During the integration tests setup, Certbot-CI will get the Pebble (and Challtestsrv) executables for the defined target version on the GitHub releases. The binaries are persisted on the filesystem, so it is not needed to download them again on the second integration tests execution. Nonetheless, we are talking about 20MB of executables.

Since the setup needs to hold a state, I also took this occasion to refactor the acme_server, in order to use on object oriented approach and improve the readability/maintainability.

Once this PR and #7156 are merged, Docker will not be needed anymore for the main integration tests usecase, that is to use Pebble.

* Complete process

* Fix nginx cert path

* Check conditionnally docker

* Update gitignore, fix apacheconftest

* Full object

* Carriage return

* Move to official v2.1.0 of pebble

* Fix name

* Update acme_server.py

* Relaunch CI

* Update certbot-ci/certbot_integration_tests/utils/acme_server.py

Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>

* Update certbot-ci/certbot_integration_tests/utils/acme_server.py

Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>

* Update docstring

* Update documentation

* Configure a stdout to ACMEServer

* Map all process through defined stdout

* Remove unused variable

* Handle using signals

* Use failsafe entering context

* Remove failsafe rmtree, that is not needed anymore
2019-07-10 14:29:57 -07:00
Adrien Ferrand
e394889864 Add executable scripts to start certbot and acme server in certbot-ci (#7073)
During review of #6989, we saw that some of our test bash scripts were still used in the Boulder project in particular. It is about `tests/integration/_common.sh` in particular, to expose the `certbot_test` bash function,  that is an appropriate way to execute a local version of certbot in test mode: define a custom server, remove several checks, full log and so on.

This PR is an attempt to assert this goal: exposing a new `certbot_test` executable for test purpose. More generally, this PR is about giving well suited scripts to quickly make manual tests against certbot without launching the full automated pytest suite.

The idea here is to leverage the existing logic in certbot-ci, and expose it as executable scripts. This is done thanks to the `console_scripts` entry of setuptools entrypoint feature, that install scripts in the `PATH`, when `pip install` is invoked, that delegate to specific functions in the installed packages.

Two scripts are defined this way:
* `certbot_test`: it executes certbot in test mode in a very similar way than the original `certbot_test` in `_common.sh`, by delegating to `certbot_integration_tests.utils.certbot_call:main`. By default this execution will target a pebble directory url started locally. The url, and also http-01/tls-alpn-01 challenge ports can be configured using ad-hoc environment variables. All arguments passed to `certbot_test` are transferred to the underlying certbot command.
* `acme_server`: it set up a fully running instance of an ACME server, ready for tests (in particular, all FQDN resolves to localhost in order to target a locally running `certbot_test` command) by delegating to `certbot_integration_tests.utils.acme_server:main`. The choice of the ACME server is given by the first parameter passed to `acme_server`, it can be `pebble`, `boulder-v1` or `boulder-v2`. The command keeps running on foreground, displaying the logs of the ACME server on stdout/stderr. The server is shut down and resources cleaned upon entering CTRL+C.

This two commands can be run also through the underlying python modules, that are executable.

Finally, a typical workflow on certbot side to run manual tests would be:
```
cd certbot
tools/venv.py
source venv/bin/activate
acme_server pebble &
certbot_test certonly --standalone -d test.example.com
```

On boulder side it could be:
```
# Follow certbot dev environment setup instructions, then ...
cd boulder
docker-compose run --use-aliases -e FAKE_DNS=172.17.0.1 --service-ports boulder ./start.py
SERVER=http://localhost:4001/directory certbot_test certonly --standalone -d test.example.com
```

* Configure certbot-ci to expose a certbot_test console script calling certbot in test mode against a local pebble instance

* Add a command to start pebble/boulder

* Use explicit start

* Add execution permission to acme_server

* Add a docstring to certbot_test function

* Change executable name

* Increase sleep to 3600s

* Implement a context manager to handle the acme server

* Add certbot_test workspace in .gitignore

* Add documentation

* Remove one function in context, split logic of certbot_test towards capturing non capturing

* Use an explicit an properly configured ACMEServer as handler.

* Add doc. Put constants.
2019-06-12 17:19:23 -07:00
ohemorange
05ad539255
git ignore pytest cache (#6340) 2018-09-05 18:05:48 -07:00
Brad Warren
e178bbfdf5 Release script improvements (#6337)
* Add error checking and automatic logging.

* Ignore release dir and logs

* Don't always require PGP card and fix script cmd.

* keep track of default GPG key

* Add PGP card sanity check after offline signature

* fix typo

* I'm tired of pressing y.

* Automate running tools/offline-sigrequest.sh.

* Update comment and make output more readable.
2018-09-05 14:10:05 -07:00
ohemorange
2d31598484 Get mypy tox env running in the current setup (#5861)
* get mypy tox env running in the current setup

* use any python3 with mypy

* pin mypy dependencies
2018-04-12 15:47:39 -07:00
Brad Warren
49edf17cb7
ignore .docker (#5477) 2018-02-13 09:52:04 -08:00
Joona Hoikkala
a1713c0b79 Broader git ignore for pytest cache files (#5361)
Make gitignore take pytest cache directories in to account, even if
they reside in subdirectories.

If pytest is run for a certain module, ie. `pytest certbot-apache` the
cache directory is created under `certbot-apache` directory.
2018-01-05 11:08:38 -08:00
Brad Warren
5388842e5b Fix pytest on macOS in Travis (#5360)
* Add tools/pytest.sh

* pass TRAVIS through in tox.ini

* Use tools/pytest.sh to run pytest

* Add quiet to pytest.ini

* ignore pytest cache
2018-01-03 17:49:22 -08:00
Blake Griffith
49d46ef99a Impelment account deactivation [revision requested] (#3571)
Impelment account deactivation
2017-01-17 16:00:07 -08:00
Joona Hoikkala
b65ea31b42 Add rope directory to gitignore (#3554)
* Ignore .ropeproject
2016-09-28 10:42:00 -07:00
Jacob Hoffman-Andrews
cb9921f4b1 Add more ignored files to gitignore. 2016-08-10 11:14:39 -07:00
Brad Warren
ae6f1c62f1 Rename misc files 2016-04-14 10:20:23 -07:00
Brad Warren
4a17294654 Remove sigfileball and add it to gitignore 2016-03-10 13:35:06 -08:00
Brad Warren
f1bfbadbdb Don't track releases folder 2016-03-01 11:21:40 -08:00
Brad Warren
113774746d Ignore venv in letstest dir 2016-02-02 13:44:44 -08:00
Brad Warren
4156d1cecc Ignore log directories and key files 2015-12-23 12:28:57 -05:00
Jakub Warmuz
3c08b512c3
Simple dev release script 2015-09-27 16:12:50 +00:00
Jakub Warmuz
96f12fe668
Gitignore /.tox/ 2015-07-17 08:10:49 +00:00
Jakub Warmuz
7f46e69454
Update ignore files to remove shared tox.venv 2015-07-12 15:30:51 +00:00
Jakub Warmuz
a876a664df
Add py3 tox tests for acme.jose 2015-07-12 11:37:56 +00:00
Jakub Warmuz
db1e078c06
Shared tox envdir 2015-07-10 16:40:46 +00:00
Brad Warren
13913fd8e0 Added traceback dump 2015-06-30 12:57:51 -07:00
James Kasten
5027d70002 Ignore pycharm project files 2015-06-26 09:30:10 -07:00
Jakub Warmuz
e51f300ee6
Merge remote-tracking branch 'github/letsencrypt/master' into csr
Conflicts:
	letsencrypt/cli.py
	letsencrypt/client.py
	letsencrypt/tests/client_test.py
2015-06-25 13:36:41 +00:00
Jakub Warmuz
d3ad5f8b56
gitignore: +htmlcov, -m3, reorg 2015-06-02 10:41:33 +00:00
Jakub Warmuz
b76e8b6c41
Revert "Update unit tests for determine_authenticator"
This reverts commit 79f5ebe734.
2015-04-22 09:02:39 +00:00
yan
995b5622f8 Fix most pylint errors 2015-04-17 22:24:19 -07:00
Garrett Robinson
79f5ebe734 Update unit tests for determine_authenticator
The last commit refactored determine_authenticator to take a mapping of
authenticator names to authenticators instead of a list of
authenticators. This commit updates the existing unit tests to work with
this refactor.
2015-04-09 15:46:19 -07:00
Garrett Robinson
73824c859a Ignore emacs autosave files 2015-04-09 15:45:18 -07:00
James Kasten
ce2a6b7c5a Merge branch 'restification'
Conflicts:
	.gitignore
	CONTRIBUTING.rst
2015-03-21 14:03:36 -07:00
Garrett Robinson
5eb007cc31 Add Vagrantfile, document use
* Adds workaround to setup.py for issue with Vagrant sync filesystem and
  hard linking (used by distutils in Python < 2.7.9). This workaround is
  only used in a Vagrant environment.
* Adds Vagrant-related files to .gitignore
2015-03-21 12:51:33 -07:00
William Budington
75e4e5d48b Gitignore .swp for vim 2015-03-20 20:56:44 +00:00
Jakub Warmuz
d40a7acf8a gitignore: .coverage is a file 2014-11-27 22:49:15 +01:00
Jakub Warmuz
93291feb58 Ignore .coverage 2014-11-27 20:57:24 +01:00
Jakub Warmuz
300a4f0b45 Use tox for tests 2014-11-22 15:04:36 +01:00
Jakub Warmuz
3ce1679717 Virtualenv setup. Fixes $41. 2014-11-21 17:45:13 +01:00
Jakub Warmuz
8dc8ceca2d gitignore setuptools artifacts 2014-11-19 13:29:02 +01:00
James Kasten
d3708e1e79 Remove trustify/attic related code from setup.py
Conflicts:
	.gitignore
	setup.py
2014-11-18 18:39:39 -08:00
Faidon Liambotis
b8d3aab7a5 Move protocol and client into Python modules
Shuffle files around in an initial attempt of creating trustify,
trustify.protocol and trustify.client Python modules. The reference
implemntation of the server remains where it was for now.
2012-08-12 07:49:45 +03:00
Seth Schoen
d18c7f6eee some .gitignore files to suppress display of generated files in git 2012-07-14 13:49:58 -07:00