cbf4868efde0863310e5a134a18f52953a282e85
[platform/upstream/rpm.git] / tests / rpmconfig.at
1 #    rpmvercmp.at: rpm config file behavior tests
2
3 AT_BANNER([RPM config file behavior])
4
5 # ------------------------------
6 # (Build and) upgrade package with config file, no backup here
7 AT_SETUP([rpm -U to package with unchanged config file])
8 AT_KEYWORDS([install])
9 AT_CHECK([
10 RPMDB_CLEAR
11 rm -rf "${TOPDIR}"
12 rm -rf "${RPMTEST}/etc/my.conf"
13
14 for v in "1.0" "2.0"; do
15     run rpmbuild --quiet -bb \
16         --define "ver $v" \
17         --define "filedata foo" \
18           ${RPMDATA}/SPECS/configtest.spec
19 done
20
21 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
22 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
23 ],
24 [0],
25 )
26 AT_CLEANUP
27 #
28 # ------------------------------
29 # Upgrade package with locally modified config file, unchanged in pkg
30 AT_SETUP([rpm -U to package with locally modified config file])
31 AT_KEYWORDS([install])
32 AT_CHECK([
33 RPMDB_CLEAR
34 rm -rf "${TOPDIR}"
35 rm -rf "${RPMTEST}/etc/my.conf"
36
37 for v in "1.0" "2.0"; do
38     run rpmbuild --quiet -bb \
39         --define "ver $v" \
40         --define "filedata foo" \
41           ${RPMDATA}/SPECS/configtest.spec
42 done
43
44 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
45 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
46 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
47 ],
48 [0],
49 )
50 AT_CLEANUP
51
52 # ------------------------------
53 # Upgrade package with unmodified config file, changed in pkg
54 AT_SETUP([rpm -U to package with unchanged config file])
55 AT_KEYWORDS([install])
56 AT_CHECK([
57 RPMDB_CLEAR
58 rm -rf "${TOPDIR}"
59 rm -rf "${RPMTEST}/etc/my.conf"
60
61 for v in "1.0" "2.0"; do
62     run rpmbuild --quiet -bb \
63         --define "ver $v" \
64         --define "filedata foo-$v" \
65           ${RPMDATA}/SPECS/configtest.spec
66 done
67
68 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
69 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
70 ],
71 [0],
72 )
73 AT_CLEANUP
74
75 # ------------------------------
76 # Upgrade package with locally modified config file, changed in pkg
77 AT_SETUP([rpm -U to package with modified config file])
78 AT_KEYWORDS([install])
79 AT_CHECK([
80 RPMDB_CLEAR
81 rm -rf "${TOPDIR}"
82 rm -rf "${RPMTEST}/etc/my.conf"
83
84 for v in "1.0" "2.0"; do
85     run rpmbuild --quiet -bb \
86         --define "ver $v" \
87         --define "filedata foo-$v" \
88           ${RPMDATA}/SPECS/configtest.spec
89 done
90
91 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
92 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
93 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
94 ],
95 [0],
96 [ignore],
97 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
98 )
99 AT_CLEANUP