Commit graph

40 commits

Author SHA1 Message Date
Brad Warren
0567c5fe4d fix tests 2020-05-20 15:34:07 -07:00
Brad Warren
f325009ff9 Create apache_util_test.py. 2020-05-20 15:34:07 -07:00
Brad Warren
65decc916a Add mock fallback 2020-05-20 15:34:06 -07:00
Brad Warren
b282046ea6 fix tests 2020-05-20 15:34:06 -07:00
Brad Warren
9c2eb7ad4f Merge branch 'master' into my-apache-ocsp-merge 2020-05-20 15:33:42 -07:00
ohemorange
3ea5170647
Error out earlier in apache installer when mod_ssl is not available (#7984)
* Error out in apache installer when mod_ssl is not available

* Update to MisconfigurationError and add/fix tests

* Remove error cases we no longer hit and associated test

* mock out function to have consistent error across machines

* improve changelog message

* only check key in modules list, not value
2020-05-19 15:34:21 -07:00
Joona Hoikkala
839b86871d
Move cert_sha1_fingerprint to to internal apache_util 2020-04-22 20:56:48 +03:00
Joona Hoikkala
1e5d13f212
Implement deploy hook for ocsp prefetch functionality 2020-04-22 20:46:10 +03:00
Joona Hoikkala
c3ebf331e9
Fix merge issues 2020-04-22 19:39:05 +03:00
Joona Hoikkala
2d9e9c8aef
Merge remote-tracking branch 'origin/master' into ocsp_apache_continued 2020-04-22 19:18:41 +03:00
Joona Hoikkala
741278ef67
Use certificate file path as key for the internal storage and remove revoked and deleted certificates from pool when met 2020-04-16 00:50:19 +03:00
ohemorange
8fb9a395ab
Do not require mock in Python 3 in apache module (#7896)
Part of #7886.

This PR conditionally installs mock in `apache/setup.py` based on setuptools version and python version, when possible. It then updates `apache` tests to use `unittest.mock` when `mock` isn't available.

* Conditionally install mock in apache

* error out on newer python and older setuptools

* error when trying to build wheels with old setuptools

* use unittest.mock when third-party mock isn't available in apache, with no cover and type ignore
2020-04-15 11:30:08 -07:00
Karan Suthar
8e4dc0a48c
Minor bugfixes (#7891)
* Fix dangerous default argument

* Remove unused imports

* Remove unnecessary comprehension

* Use literal syntax to create data structure

* Use literal syntax instead of function calls to create data structure

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2020-04-13 10:41:39 -07:00
Joona Hoikkala
57cd0c7d81
Address review comments 2020-04-09 02:42:26 +03:00
m0namon
1285297b23
[Apache v2] Load apacheconfig tree and gate related tests (#7710)
* Load apacheconfig dependency, gate behind flag

* Bump apacheconfig dependency to latest version and install dev version of apache for coverage tests

* Move augeasnode_test tests to more generic parsernode_test

* Revert "Move augeasnode_test tests to more generic parsernode_test"

This reverts commit 6bb986ef78.

* Mock AugeasNode into DualNode's place, and run augeasnode tests exclusively on AugeasNode

* Don't calculate coverage for skeleton functions

* clean up helper function in augeasnode_test
2020-03-23 17:05:22 -07:00
ohemorange
9e3c348dff
Disable TLS session tickets in Apache (#7771)
Fixes #7350.

This PR changes the parsed modules from a `set` to a `dict`, with the filepath argument as the value. Accordingly, after calling `enable_mod` to enable `ssl_module`, modules now need to be re-parsed, so call `reset_modules`.

* Add mechanism for selecting apache config file, based on work done in #7191.

* Check OpenSSL version

* Remove os imports

* debian override still needs os

* Reformat remaining apache tests with modules dict syntax

* Clean up more apache tests

* Switch from property to method for openssl and add tests for coverage.

* Sometimes the dict location will be None in which case we should in fact return None

* warn thoroughly and consistently in openssl_version function

* update tests for new warnings

* read file as bytes, and factor out the open for testing

* normalize ssl_module_location path to account for being relative to server root

* Use byte literals in a python 2 and 3 compatible way

* string does need to be a literal

* patch builtins open

* add debug, remove space

* Add test to check if OpenSSL detection is working on different systems

* fix relative test location for cwd

* put </IfModule> on its own line in test case

* Revert test file to status in master.

* Call augeas load before reparsing modules to pick up the changes

* fix grep, tail, and mod_ssl location on centos

* strip the trailing whitespace from fedora

* just use LooseVersion in test

* call apache2ctl on debian systems

* Use sudo for apache2ctl command

* add check to make sure we're getting a version

* Add boolean so we don't warn on debian/ubuntu before trying to enable mod_ssl

* Reduce warnings while testing by setting mock _openssl_version.

* Make sure we're not throwing away any unwritten changes to the config

* test last warning case for coverage

* text changes for clarity
2020-03-23 16:49:52 -07:00
Brad Warren
06599a1e18
Cleanup more pylint issues (#7848)
This PR builds on #7657 and cleans up additional unnecessary pylint comments and some stray comments referring to pylint: disable comments that have been deleted that I didn't notice in my review of that PR.

* Remove stray pylint link.

* Cleanup more pylint comments

* Cleanup magic_typing imports

* Remove unneeded pylint: enable comments
2020-03-16 09:43:48 -07:00
Joona Hoikkala
895330e009
Use filesystem.replace for atomic move operations 2020-03-04 20:21:00 +02:00
m0namon
f169c37153
Merge pull request #7742 from osirisinferi/force-non-restrictive-umask
Force non restrictive umask when creating challenge directory in Apache plugin
2020-02-26 17:09:20 -08:00
Joona Hoikkala
dc255aeb4f
Fix tests and handle PluginError 2020-02-26 20:08:20 +02:00
osirisinferi
9819443440
Add test 2020-02-22 15:22:27 +01:00
Joona Hoikkala
a42cf70f71
More review comment fixes 2020-02-19 20:44:37 +02:00
Joona Hoikkala
a446e124e4
Fix tests after moving ocsp to public api 2020-02-12 17:55:10 +02:00
Joona Hoikkala
8ddc17fd2c
Merge remote-tracking branch 'origin/master' into ocsp_apache_continued 2020-02-12 17:42:41 +02:00
Joona Hoikkala
6395cc2b48
Copy dbm file to work directory before writing 2020-02-04 20:13:28 +02:00
Joona Hoikkala
1ad23f9db0
Move DBM handling to a context manager 2020-02-04 13:13:04 +02:00
Joona Hoikkala
fd74aba422
Address review comments 2020-02-03 22:18:52 +02:00
Joona Hoikkala
b6ea34c61d
Address review comments 2020-01-31 20:06:52 +02:00
Joona Hoikkala
882335c7ec
Merge remote-tracking branch 'origin/master' into ap2_to_master 2020-01-30 17:08:16 +02:00
Joona Hoikkala
4138259c51
Add certbot-apache tests and mypy type hints 2020-01-27 15:10:04 +02:00
Joona Hoikkala
a7f934701f
Add test to ensure dbm recovery if restart fails 2020-01-24 16:16:37 +02:00
Joona Hoikkala
6cfc493a71
Move restart() override and interface registration to OCSPPrefetchMixin 2020-01-24 15:02:25 +02:00
Joona Hoikkala
dad0ca3505 Merge remote-tracking branch 'origin/master' into ocsp_apache_continued 2020-01-22 20:51:30 +02:00
Joona Hoikkala
fa8a68d45f
Move the OCSP prefetch functionality to a mixin class 2020-01-22 20:51:09 +02:00
Ville Skyttä
1702cb90fd Spelling and grammar fixes (#7695) 2020-01-17 18:55:51 +01:00
Joona Hoikkala
3b065238b3
Modifications needed for merging to master 2020-01-06 17:19:33 +02:00
Joona Hoikkala
0f5bda4ff9 Merge remote-tracking branch 'origin/master' into ap2_merge_master 2020-01-06 17:17:31 +02:00
Joona Hoikkala
857f98d4ec
Fix tests 2019-12-19 14:35:36 +02:00
Adrien Ferrand
e048da1e38 Reorganize imports (#7616)
* Isort execution

* Fix pylint, adapt coverage

* New isort

* Fix magic_typing lint

* Second round

* Fix pylint

* Third round. Store isort configuration

* Fix latest mistakes

* Other fixes

* Add newline

* Fix lint errors
2019-12-09 15:50:20 -05:00
ohemorange
6c1dfe43c7 Refactor tests out of packaged module for apache plugin (#7607)
Part of #7593.

* Refactor tests out of packaged module for apache plugin

* Exclude pycache and .py[cod]

* Change tests path in tox.ini
2019-11-27 09:57:35 -08:00