From 3c067aa2c31b9a580d20d8ec0ed13477631c6313 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 22:31:08 +0200 Subject: [PATCH] [PR #7064/4b17fd42 backport][stable-7] Snap add test (#7065) Snap add test (#7064) * add test for 3 dashes in description * remove extraneous comment (cherry picked from commit 4b17fd4265297a81e799526195de1d8fadc93673) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- tests/integration/targets/snap/tasks/main.yml | 2 ++ .../targets/snap/tasks/test_3dash.yml | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/integration/targets/snap/tasks/test_3dash.yml diff --git a/tests/integration/targets/snap/tasks/main.yml b/tests/integration/targets/snap/tasks/main.yml index 14d8fe6c26..c533ed5bff 100644 --- a/tests/integration/targets/snap/tasks/main.yml +++ b/tests/integration/targets/snap/tasks/main.yml @@ -17,3 +17,5 @@ ansible.builtin.include_tasks: test_channel.yml - name: Include test_dangerous ansible.builtin.include_tasks: test_dangerous.yml + - name: Include test_3dash + ansible.builtin.include_tasks: test_3dash.yml diff --git a/tests/integration/targets/snap/tasks/test_3dash.yml b/tests/integration/targets/snap/tasks/test_3dash.yml new file mode 100644 index 0000000000..4d39c0a488 --- /dev/null +++ b/tests/integration/targets/snap/tasks/test_3dash.yml @@ -0,0 +1,31 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +- name: Make sure packages are not installed (3 dashes) + community.general.snap: + name: + - bw + - shellcheck + state: absent + +- name: Install package with 3 dashes in description (check) + community.general.snap: + name: + - bw + - shellcheck + state: present + check_mode: true + register: install_3dash_check + +- name: Remove packages (3 dashes) + community.general.snap: + name: + - bw + - shellcheck + state: absent + +- assert: + that: + - install_3dash_check is changed