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

snap: add tests for multiple commands #5488

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions tests/integration/targets/snap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,53 @@
- "'uhttpd:document-root-dir=/tmp' in install_with_option_changed.options_changed"
- "'uhttpd:listening-port=8080' not in install_with_option_changed.options_changed"
- remove is changed

- name: Install two packages at the same time
community.general.snap:
name:
- hello-world
- uhttpd
state: present
register: install_two

- name: Install two packages at the same time (again)
community.general.snap:
name:
- hello-world
- uhttpd
state: present
register: install_two_again

- name: Remove packages (hello-world & uhttpd)
community.general.snap:
name:
- hello-world
- uhttpd
state: absent
register: install_two_remove
russoz marked this conversation as resolved.
Show resolved Hide resolved

- name: Remove packages again (hello-world & uhttpd)
community.general.snap:
name:
- hello-world
- uhttpd
state: absent
register: install_two_remove_again

- name: Assert installation of two packages
assert:
that:
- install_two is changed
- "'hello-world' in install_two.snaps_installed"
- "'uhttpd' in install_two.snaps_installed"
- install_two.snaps_removed is not defined
- install_two_again is not changed
- install_two_again.snaps_installed is not defined
- install_two_again.snaps_removed is not defined
- install_two_remove is changed
- install_two_again.snaps_installed is not defined
- "'hello-world' in install_two_remove.snaps_removed"
- "'uhttpd' in install_two_remove.snaps_removed"
- install_two_remove_again is not changed
- install_two_remove_again.snaps_installed is not defined
- install_two_remove_again.snaps_removed is not defined