1 # rpmvercmp.at: rpm config file behavior tests
3 AT_BANNER([RPM config file behavior])
5 # ------------------------------
6 # (Build and) upgrade package with config file, no backup here
7 AT_SETUP([rpm -U to package with unchanged config file])
12 cf="${RPMTEST}"/etc/my.conf
13 rm -f "${cf}" "${cf}".rpm*
16 for v in "1.0" "2.0"; do
17 runroot rpmbuild --quiet -bb \
19 --define "filedata foo" \
20 /data/SPECS/configtest.spec
23 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
25 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
35 # ------------------------------
36 # Upgrade package with locally modified config file, unchanged in pkg
37 AT_SETUP([rpm -U to package with locally modified config file])
38 AT_KEYWORDS([install])
42 cf="${RPMTEST}"/etc/my.conf
43 rm -f "${cf}" "${cf}".rpm*
46 for v in "1.0" "2.0"; do
47 runroot rpmbuild --quiet -bb \
49 --define "filedata foo" \
50 /data/SPECS/configtest.spec
53 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
55 echo "otherstuff" > "${cf}"
57 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
68 # ------------------------------
69 # Upgrade package with unmodified config file, changed in pkg
70 AT_SETUP([rpm -U to package with unchanged config file])
71 AT_KEYWORDS([install])
75 cf="${RPMTEST}"/etc/my.conf
76 rm -f "${cf}" "${cf}".rpm*
79 for v in "1.0" "2.0"; do
80 runroot rpmbuild --quiet -bb \
82 --define "filedata foo-$v" \
83 /data/SPECS/configtest.spec
86 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
88 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
98 # ------------------------------
99 # Upgrade package with locally modified config file, changed in pkg
100 AT_SETUP([rpm -U to package with modified config file 1])
101 AT_KEYWORDS([install])
105 cf="${RPMTEST}"/etc/my.conf
106 rm -f "${cf}" "${cf}".rpm*
109 for v in "1.0" "2.0"; do
110 runroot rpmbuild --quiet -bb \
112 --define "filedata foo-$v" \
113 /data/SPECS/configtest.spec
116 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
118 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
120 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
128 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
132 # ------------------------------
133 # Modified config file matches the content from new package. Creating a
134 # backup makes no sense in this case, but that's what currently happens.
135 AT_SETUP([rpm -U to package with modified config file 2])
136 AT_KEYWORDS([install])
140 cf="${RPMTEST}"/etc/my.conf
141 rm -f "${cf}" "${cf}".rpm*
144 for v in "1.0" "2.0"; do
145 runroot rpmbuild --quiet -bb \
147 --define "filedata foo-$v" \
148 /data/SPECS/configtest.spec
151 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
153 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
155 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
163 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]