Part of #2400. Follow-up to #2368.
What
Exercise the full Ansible-vault-password round-trip through Redis:
osism vault set / unset / view (osism/commands/vault.py:46, :57, :210), which set / delete / get the ansible_vault_password Redis key with a Fernet-encrypted value.
osism.utils.get_ansible_vault_password() (osism/utils/__init__.py:318), which reads that key, decrypts it with the Fernet key from /share/ansible_vault_password.key, and returns the plaintext.
This is a real crypto + Redis path that cannot be meaningfully unit-tested without a live store.
Scope
- Store an encrypted password in Redis, read it back via
get_ansible_vault_password(), assert the plaintext matches.
- Missing key →
ValueError ("... not set in Redis").
- Empty / whitespace-only password →
ValueError.
- Round-trip via the actual
set → get/view → unset flow where practical.
Notes / Where
New file tests/integration/test_vault.py. The Fernet key file path (/share/ansible_vault_password.key) is not writable in CI — point it at a temp file (monkeypatch the module constant or generate a key into a temp path) so the test is self-contained.
Part of #2400. Follow-up to #2368.
What
Exercise the full Ansible-vault-password round-trip through Redis:
osism vault set/unset/view(osism/commands/vault.py:46,:57,:210), whichset/delete/gettheansible_vault_passwordRedis key with a Fernet-encrypted value.osism.utils.get_ansible_vault_password()(osism/utils/__init__.py:318), which reads that key, decrypts it with the Fernet key from/share/ansible_vault_password.key, and returns the plaintext.This is a real crypto + Redis path that cannot be meaningfully unit-tested without a live store.
Scope
get_ansible_vault_password(), assert the plaintext matches.ValueError("... not set in Redis").ValueError.set→ get/view→unsetflow where practical.Notes / Where
New file
tests/integration/test_vault.py. The Fernet key file path (/share/ansible_vault_password.key) is not writable in CI — point it at a temp file (monkeypatch the module constant or generate a key into a temp path) so the test is self-contained.