Skip to content

Commit

Permalink
Work around problem with cryptography being upgraded while installing…
Browse files Browse the repository at this point in the history
… pyOpenSSL (#137)

* Work around problem with cryptography being upgraded while installing pyOpenSSL.

* Avoid another instability.
  • Loading branch information
felixfontein authored Nov 3, 2020
1 parent ec7e491 commit 5ffe97f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/integration/targets/openssl_privatekey/tasks/impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@
select_crypto_backend: '{{ select_crypto_backend }}'
register: privatekey_mode_2

- name: Make sure that mtime actually changes.
# The "privatekey_mode_1_stat.stat.mtime != privatekey_mode_3_stat.stat.mtime" test should be
# changed to compare content instead of mtime. On macOS 10.15, mtime resolution is one second,
# and the machine (VM) is fast enough that both modifications can happen in the same second.
pause:
seconds: 1

- name: "({{ select_crypto_backend }}) Generate privatekey_mode (mode 0400, force)"
openssl_privatekey:
path: '{{ output_dir }}/privatekey_mode.pem'
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/targets/setup_pyopenssl/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@
command: "{{ ansible_python.executable }} -m OpenSSL.debug"
register: pyopenssl_debug_version
ignore_errors: yes

# Depending on which pyOpenSSL version has been installed, it could be that cryptography has
# been upgraded to a newer version. Make sure to register cryptography_version another time here
# to avoid strange testing behavior due to wrong values of cryptography_version.
- name: Register cryptography version
command: "{{ ansible_python.executable }} -c 'import cryptography; print(cryptography.__version__)'"
register: cryptography_version
ignore_errors: yes # in case cryptography was not installed, and setup_openssl hasn't been run before, ignore errors

0 comments on commit 5ffe97f

Please sign in to comment.