certbot/certbot-ci/certbot_integration_tests/utils
Adrien Ferrand 9cbb13ef04
Run hooks with Powershell on Windows (#7800)
Fixes #7713.

As discussed in #7713, providing a Powershell script as hook for Certbot is not working currently. This is because hooks are run in a `cmd` environment, that recognizes only `.bat` files as valid scripts that can be run from their bare name on command line.

On the other hand, the Powershell both `.bat` and `.ps1` scripts as valid scripts.

This PR makes hooks command be executed by Powershell, instead of `cmd` as `Popen` does by default when `shell=true` is used. It also modifies the tests to handle this new environment, in particular in term of encoding (UTF-16-LE is the default one in Powershell).

* Run hooks in powershell on Windows

* Fix hook test

* Fallback to unittest.mock

* In fact, shell_cmd as a list of str could not work. Declare only str as acceptable input for shell_cmd.

* Added changelog
2020-04-27 09:38:30 -07:00
..
__init__.py [Unix] Create a framework for certbot integration tests: PART 1 (#6578) 2019-03-01 13:18:06 -08:00
acme_server.py Avoid deleting the workspace twice. (#7923) 2020-04-23 23:29:16 +02:00
certbot_call.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
constants.py Create a mock OCSP server for Pebble integration tests (#7281) 2019-08-02 11:46:12 -07:00
misc.py Run hooks with Powershell on Windows (#7800) 2020-04-27 09:38:30 -07:00
pebble_artifacts.py Fix acme compliance to RFC 8555 (#7176) 2020-03-13 09:56:35 -07:00
pebble_ocsp_server.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00
proxy.py Reorganize imports (#7616) 2019-12-09 15:50:20 -05:00