Debian Codegraph @

ansible_collections/community/general/tests/unit/plugins/modules/test_krb_ticket.yaml

raw
1 # Copyright (c) Alexei Znamensky ([email protected])
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 ---
6 anchors:
7 environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: false}
8 environ_data: &env-data {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true, data: cool_password}
9 environ_norc: &env-norc {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true}
10 test_cases:
11 - id: test_kinit_default
12 input:
13 state: present
14 password: cool_password
15 output:
16 changed: true
17 mocks:
18 run_command:
19 - command: [/testbin/klist]
20 environ: *env-def
21 rc: 1
22 out: ''
23 err: ''
24 - command: [/testbin/kinit]
25 environ: *env-data
26 rc: 0
27 out: ''
28 err: ''
29 - id: test_kinit_principal
30 input:
31 state: present
32 password: cool_password
33 principal: [email protected]
34 output:
35 changed: true
36 mocks:
37 run_command:
38 - command: [/testbin/klist, -l]
39 environ: *env-def
40 rc: 0
41 out: ''
42 err: ''
43 - command: [/testbin/kinit, [email protected]]
44 environ: *env-data
45 rc: 0
46 out: ''
47 err: ''
48 - id: test_kdestroy_default
49 input:
50 state: absent
51 output:
52 changed: true
53 mocks:
54 run_command:
55 - command: [/testbin/klist]
56 environ: *env-def
57 rc: 0
58 out: ''
59 err: ''
60 - command: [/testbin/kdestroy]
61 environ: *env-norc
62 rc: 0
63 out: ''
64 err: ''
65 - id: test_kdestroy_principal
66 input:
67 state: absent
68 principal: [email protected]
69 output:
70 changed: true
71 mocks:
72 run_command:
73 - command: [/testbin/klist, -l]
74 environ: *env-def
75 rc: 0
76 out: [email protected]
77 err: ''
78 - command: [/testbin/kdestroy, -p, [email protected]]
79 environ: *env-norc
80 rc: 0
81 out: ''
82 err: ''
83 - id: test_kdestroy_cache_name
84 input:
85 state: absent
86 cache_name: KEYRING:persistent:0:0
87 output:
88 changed: true
89 mocks:
90 run_command:
91 - command: [/testbin/klist, -l]
92 environ: *env-def
93 rc: 0
94 out: KEYRING:persistent:0:0
95 err: ''
96 - command: [/testbin/kdestroy, -c, KEYRING:persistent:0:0]
97 environ: *env-norc
98 rc: 0
99 out: ''
100 err: ''
101 - id: test_kdestroy_all
102 input:
103 state: absent
104 kdestroy_all: true
105 output:
106 changed: true
107 mocks:
108 run_command:
109 - command: [/testbin/kdestroy, -A]
110 environ: *env-norc
111 rc: 0
112 out: ''
113 err: ''