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