Debian Codegraph @

ansible_collections/community/general/tests/unit/plugins/modules/test_opkg.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 test_cases:
9 - id: install_zlibdev
10 input:
11 name: zlib-dev
12 state: present
13 output:
14 msg: installed 1 package(s)
15 mocks:
16 run_command:
17 - command: [/testbin/opkg, --version]
18 environ: *env-def
19 rc: 0
20 out: ''
21 err: ''
22 - command: [/testbin/opkg, list-installed, zlib-dev]
23 environ: *env-def
24 rc: 0
25 out: ''
26 err: ''
27 - command: [/testbin/opkg, install, zlib-dev]
28 environ: *env-def
29 rc: 0
30 out: |
31 Installing zlib-dev (1.2.11-6) to root...
32 Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk
33 Installing zlib (1.2.11-6) to root...
34 Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk
35 Configuring zlib.
36 Configuring zlib-dev.
37 err: ''
38 - command: [/testbin/opkg, list-installed, zlib-dev]
39 environ: *env-def
40 rc: 0
41 out: |
42 zlib-dev - 1.2.11-6
43 err: ''
44 - id: install_zlibdev_present
45 input:
46 name: zlib-dev
47 state: present
48 output:
49 msg: package(s) already present
50 mocks:
51 run_command:
52 - command: [/testbin/opkg, --version]
53 environ: *env-def
54 rc: 0
55 out: ''
56 err: ''
57 - command: [/testbin/opkg, list-installed, zlib-dev]
58 environ: *env-def
59 rc: 0
60 out: |
61 zlib-dev - 1.2.11-6
62 err: ''
63 - id: install_zlibdev_force_reinstall
64 input:
65 name: zlib-dev
66 state: present
67 force: reinstall
68 output:
69 msg: installed 1 package(s)
70 mocks:
71 run_command:
72 - command: [/testbin/opkg, --version]
73 environ: *env-def
74 rc: 0
75 out: ''
76 err: ''
77 - command: [/testbin/opkg, list-installed, zlib-dev]
78 environ: *env-def
79 rc: 0
80 out: |
81 zlib-dev - 1.2.11-6
82 err: ''
83 - command: [/testbin/opkg, install, --force-reinstall, zlib-dev]
84 environ: *env-def
85 rc: 0
86 out: |
87 Installing zlib-dev (1.2.11-6) to root...
88 Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk
89 Configuring zlib-dev.
90 err: ''
91 - command: [/testbin/opkg, list-installed, zlib-dev]
92 environ: *env-def
93 rc: 0
94 out: |
95 zlib-dev - 1.2.11-6
96 err: ''
97 - id: install_zlibdev_with_version
98 input:
99 name: zlib-dev=1.2.11-6
100 state: present
101 output:
102 msg: installed 1 package(s)
103 mocks:
104 run_command:
105 - command: [/testbin/opkg, --version]
106 environ: *env-def
107 rc: 0
108 out: ''
109 err: ''
110 - command: [/testbin/opkg, list-installed, zlib-dev]
111 environ: *env-def
112 rc: 0
113 out: ''
114 err: ''
115 - command: [/testbin/opkg, install, zlib-dev=1.2.11-6]
116 environ: *env-def
117 rc: 0
118 out: |
119 Installing zlib-dev (1.2.11-6) to root...
120 Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib-dev_1.2.11-6_mips_24kc.ipk
121 Installing zlib (1.2.11-6) to root...
122 Downloading https://downloads.openwrt.org/releases/22.03.0/packages/mips_24kc/base/zlib_1.2.11-6_mips_24kc.ipk
123 Configuring zlib.
124 Configuring zlib-dev.
125 err: ''
126 - command: [/testbin/opkg, list-installed, zlib-dev]
127 environ: *env-def
128 rc: 0
129 out: "zlib-dev - 1.2.11-6 \n" # This output has the extra space at the end, to satisfy the behaviour of Yocto/OpenEmbedded's opkg
130 err: ''
131 - id: install_vim_updatecache
132 input:
133 name: vim-fuller
134 state: present
135 update_cache: true
136 output:
137 msg: installed 1 package(s)
138 mocks:
139 run_command:
140 - command: [/testbin/opkg, --version]
141 environ: *env-def
142 rc: 0
143 out: ''
144 err: ''
145 - command: [/testbin/opkg, update]
146 environ: *env-def
147 rc: 0
148 out: ''
149 err: ''
150 - command: [/testbin/opkg, list-installed, vim-fuller]
151 environ: *env-def
152 rc: 0
153 out: ''
154 err: ''
155 - command: [/testbin/opkg, install, vim-fuller]
156 environ: *env-def
157 rc: 0
158 out: |
159 Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest.
160 Installing vim-fuller (9.0-1) to root...
161 Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/packages/vim-fuller_9.0-1_x86_64.ipk
162 Installing terminfo (6.4-2) to root...
163 Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/base/terminfo_6.4-2_x86_64.ipk
164 Installing libncurses6 (6.4-2) to root...
165 Downloading https://downloads.openwrt.org/snapshots/packages/x86_64/base/libncurses6_6.4-2_x86_64.ipk
166 Configuring terminfo.
167 Configuring libncurses6.
168 Configuring vim-fuller.
169 err: ''
170 - command: [/testbin/opkg, list-installed, vim-fuller]
171 environ: *env-def
172 rc: 0
173 out: "vim-fuller - 9.0-1 \n" # This output has the extra space at the end, to satisfy the behaviour of Yocto/OpenEmbedded's opkg
174 err: ''