Debian Codegraph @

test/integration/targets/dnf/tasks/exclude.yml

raw
1 - name: Test `exclude`
2 block:
3 - name: Ensure no lsof
4 dnf:
5 name: lsof
6 state: removed
7
8 - name: Try installing lsof latest with exclude
9 dnf:
10 name: lsof
11 state: latest
12 exclude: ls*
13 register: latest_excluded
14 ignore_errors: true
15
16 - name: Try installing lsof present with exclude
17 dnf:
18 name: lsof
19 state: present
20 exclude: lsof
21 register: present_excluded
22 ignore_errors: true
23
24 - name: Install lsof present with non-matching exclude
25 dnf:
26 name: lsof
27 state: present
28 exclude: neovim
29 register: present_non_matching_exclude
30
31 - name: Try removing lsof with matching exclude
32 dnf:
33 name: lsof
34 state: absent
35 exclude: lsof
36 register: absent_excluded
37 ignore_errors: true
38
39 - name: Try removing lsof with non-matching exclude
40 dnf:
41 name: lsof
42 state: absent
43 exclude: neovim
44 register: absent_non_matching_exclude
45
46 - name: Assert correct exclude behavior (dnf5)
47 assert:
48 that:
49 - latest_excluded is failed
50 - present_excluded is failed
51 - present_non_matching_exclude is changed
52 - absent_excluded is not changed
53 - absent_non_matching_exclude is changed
54 when: dnf5
55
56 - name: Assert correct exclude behavior (dnf4)
57 assert:
58 that:
59 - latest_excluded is not changed
60 - present_excluded is not changed
61 - present_non_matching_exclude is changed
62 - absent_excluded is not changed
63 - absent_non_matching_exclude is changed
64 when: not dnf5
65 always:
66 - name: Ensure no lsof
67 dnf:
68 name: lsof
69 state: absent