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