mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-03 08:52:55 +00:00
gem: fix soundness issue when uninstalling default gems on Ubuntu (#10689)
* Attempt to fix gem soundness issue * Return command execution * Fix value error * Attempt to fix failling tests * Fix minor issues * Update changelog * Update tests/integration/targets/gem/tasks/main.yml Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Update changelogs/fragments/10689-gem-prevent-soundness-issue.yml Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Remove state and name from gem error message * Improve gem uninstall check * Make unit tests pass * Fix linting issues * gem: Remove length chenck and adapt unit tests * Adapt gem unit tests * gem: improve error msg * Fix sanity error * Fix linting issue --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
750adb431a
commit
cc41d9da60
4 changed files with 38 additions and 8 deletions
|
|
@ -212,3 +212,18 @@
|
|||
that:
|
||||
- install_gem_result is changed
|
||||
- not gem_bindir_stat.stat.exists
|
||||
|
||||
- name: Attempt to uninstall default gem 'json'
|
||||
community.general.gem:
|
||||
name: json
|
||||
state: absent
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
register: gem_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Assert gem uninstall failed as expected
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
assert:
|
||||
that:
|
||||
- gem_result is failed
|
||||
- gem_result.msg.startswith("Failed to uninstall gem 'json'")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue