1 # rpmconfig2.at: rpm config symlink behavior tests
3 AT_BANNER([RPM config filetype changes])
5 # non-modified config changes to non-config and back, no backups
6 AT_SETUP([upgrade config to/from non-config])
11 cf="${RPMTEST}"/etc/my.conf
12 rm -rf "${cf}" "${cf}".rpm*
15 runroot rpmbuild --quiet -bb \
17 --define "filetype file" \
18 --define "filedata foo" \
19 /data/SPECS/configtest.spec
21 runroot rpmbuild --quiet -bb \
23 --define "filetype file" \
24 --define "filedata bar" \
25 --define "noconfig 1" \
26 /data/SPECS/configtest.spec
28 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
30 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
32 runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
43 # modified config changes to non-config and back, back up on first upgrade
44 AT_SETUP([upgrade modified config to/from non-config 1])
45 AT_KEYWORDS([install])
49 cf="${RPMTEST}"/etc/my.conf
50 rm -rf "${cf}" "${cf}".rpm*
53 runroot rpmbuild --quiet -bb \
55 --define "filetype file" \
56 --define "filedata foo" \
57 /data/SPECS/configtest.spec
59 runroot rpmbuild --quiet -bb \
61 --define "filetype file" \
62 --define "filedata bar" \
63 --define "noconfig 1" \
64 /data/SPECS/configtest.spec
66 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
68 echo "otherstuff" > "${cf}"
70 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
73 runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
83 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
87 # modified config changes to identical non-config and back, no backups
88 AT_SETUP([upgrade modified config to/from non-config 2])
89 AT_KEYWORDS([install])
93 cf="${RPMTEST}"/etc/my.conf
94 rm -rf "${cf}" "${cf}".rpm*
97 runroot rpmbuild --quiet -bb \
99 --define "filetype file" \
100 --define "filedata foo" \
101 /data/SPECS/configtest.spec
103 runroot rpmbuild --quiet -bb \
105 --define "filetype file" \
106 --define "filedata bar" \
107 --define "noconfig 1" \
108 /data/SPECS/configtest.spec
110 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
114 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
116 runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
128 # non-modified config file changes to config symlink and back, no backups
129 AT_SETUP([upgrade config to/from config link])
130 AT_KEYWORDS([install])
134 cf="${RPMTEST}"/etc/my.conf
135 rm -rf "${cf}" "${cf}".rpm*
138 runroot rpmbuild --quiet -bb \
140 --define "filetype file" \
141 --define "filedata foo" \
142 /data/SPECS/configtest.spec
144 runroot rpmbuild --quiet -bb \
146 --define "filetype link" \
147 --define "filedata bar" \
148 /data/SPECS/configtest.spec
150 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
152 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
154 runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
165 # Modified config changes to config symlink
166 AT_SETUP([upgrade modified config to config link])
167 AT_KEYWORDS([install])
171 cf="${RPMTEST}"/etc/my.conf
172 rm -rf "${cf}" "${cf}".rpm*
175 runroot rpmbuild --quiet -bb \
177 --define "filetype file" \
178 --define "filedata foo" \
179 /data/SPECS/configtest.spec
181 runroot rpmbuild --quiet -bb \
183 --define "filetype link" \
184 --define "filedata bar" \
185 /data/SPECS/configtest.spec
187 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
189 echo "otherstuff" > "${cf}"
191 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
201 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
205 # Modified config link changes to config file
206 AT_SETUP([upgrade modified config link to config])
207 AT_KEYWORDS([install])
211 cf="${RPMTEST}"/etc/my.conf
212 rm -rf "${cf}" "${cf}".rpm*
215 runroot rpmbuild --quiet -bb \
217 --define "filetype link" \
218 --define "filedata foo" \
219 /data/SPECS/configtest.spec
221 runroot rpmbuild --quiet -bb \
223 --define "filetype file" \
224 --define "filedata bar" \
225 /data/SPECS/configtest.spec
227 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
229 ln -sf "otherstuff" "${cf}"
231 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
233 readlink "${cf}.rpmsave"
241 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
245 # Non-modified config file changes to directory.
246 AT_SETUP([upgrade config to directory])
247 AT_KEYWORDS([install])
251 cf="${RPMTEST}"/etc/my.conf
252 rm -rf "${cf}" "${cf}".rpm*
255 runroot rpmbuild --quiet -bb \
257 --define "filetype file" \
258 --define "filedata foo" \
259 /data/SPECS/configtest.spec
261 runroot rpmbuild --quiet -bb \
263 --define "filetype dir" \
264 /data/SPECS/configtest.spec
266 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
268 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
277 # Modified config changes to directory
278 AT_SETUP([upgrade modified config to directory])
279 AT_KEYWORDS([install])
283 cf="${RPMTEST}"/etc/my.conf
284 rm -rf "${cf}" "${cf}".rpm*
287 runroot rpmbuild --quiet -bb \
289 --define "filetype file" \
290 --define "filedata foo" \
291 /data/SPECS/configtest.spec
293 runroot rpmbuild --quiet -bb \
295 --define "filetype dir" \
296 /data/SPECS/configtest.spec
298 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
300 echo "otherstuff" > "${cf}"
302 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
311 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]