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