Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task for testing to remove gpg key using key id #79729

Merged
merged 1 commit into from Jan 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions test/integration/targets/rpm_key/tasks/rpm_key.yaml
Expand Up @@ -123,6 +123,32 @@
assert:
that: "'rsa sha1 (md5) pgp md5 OK' in sl_check.stdout or 'digests signatures OK' in sl_check.stdout"

- name: get keyid
shell: "rpm -q gpg-pubkey | head -n 1 | xargs rpm -q --qf %{version}"
register: key_id

- name: remove GPG key using keyid
rpm_key:
state: absent
key: "{{ key_id.stdout }}"
register: remove_keyid
failed_when: remove_keyid.changed == false

- name: remove GPG key using keyid (idempotent)
rpm_key:
state: absent
key: "{{ key_id.stdout }}"
register: key_id_idempotence

- name: verify idempotent (key_id)
assert:
that: "not key_id_idempotence.changed"

- name: add very first key on system again
rpm_key:
state: present
key: https://ci-files.testing.ansible.com/test/integration/targets/rpm_key/RPM-GPG-KEY-EPEL-7

- name: Issue 20325 - Verify fingerprint of key, invalid fingerprint - EXPECTED FAILURE
rpm_key:
key: https://ci-files.testing.ansible.com/test/integration/targets/rpm_key/RPM-GPG-KEY.dag
Expand Down