1 # rpmverify.at: rpm verification tests
3 AT_BANNER([RPM verification])
5 # ------------------------------
7 AT_SETUP([dependency problems])
14 runroot rpmbuild --quiet -bb \
16 --define "reqs deptest-two" \
17 /data/SPECS/deptest.spec
19 runroot rpm -U --nodeps "${TOPDIR}"/RPMS/noarch/deptest-one-1.0-1.noarch.rpm
23 [Unsatisfied dependencies for deptest-one-1.0-1.noarch:
24 deptest-two is needed by (installed) deptest-one-1.0-1.noarch
29 # Test file verify when no errors expected.
30 # Ignore dependencies here as we're not testing for them, and
31 # --nogroup --nouser is required when running tests as non-root.
32 AT_SETUP([files with no problems])
38 runroot rpm -U --nodeps --noscripts --ignorearch --ignoreos \
39 /data/RPMS/hello-1.0-1.i386.rpm
40 runroot rpm -Va --nodeps --nouser --nogroup
47 # Test file verify when no errors expected in verbose mode.
48 AT_SETUP([files with no problems in verbose mode])
54 runroot rpm -U --nodeps --noscripts --ignorearch --ignoreos \
55 /data/RPMS/hello-1.0-1.i386.rpm
56 runroot rpm -Vva --nodeps --nouser --nogroup
59 [......... /usr/local/bin/hello
60 ......... /usr/share/doc/hello-1.0
61 ......... d /usr/share/doc/hello-1.0/FAQ
66 # Test file verify after mutilating the files a bit.
67 AT_SETUP([verify from db, with problems present])
73 runroot rpm -U --nodeps --noscripts --ignorearch --ignoreos \
74 /data/RPMS/hello-1.0-1.i386.rpm
75 rm -f "${RPMTEST}"/usr/share/doc/hello-1.0/FAQ
76 chmod u-x "${RPMTEST}"/usr/local/bin/hello
77 dd if=/dev/zero of="${RPMTEST}"/usr/local/bin/hello \
78 conv=notrunc bs=1 seek=5 count=6 2> /dev/null
79 runroot rpm -Va --nodeps --nouser --nogroup
82 [.M5....T. /usr/local/bin/hello
83 missing d /usr/share/doc/hello-1.0/FAQ
88 # Test file verify from original package after mutilating the files a bit.
89 AT_SETUP([verify from package, with problems present])
95 runroot rpm -U --nodeps --noscripts --ignorearch --ignoreos \
96 /data/RPMS/hello-1.0-1.i386.rpm
97 rm -f "${RPMTEST}"/usr/share/doc/hello-1.0/FAQ
98 chmod u-x "${RPMTEST}"/usr/local/bin/hello
99 dd if=/dev/zero of="${RPMTEST}"/usr/local/bin/hello \
100 conv=notrunc bs=1 seek=5 count=6 2> /dev/null
101 runroot rpm -Vp --nodeps --nouser --nogroup /data/RPMS/hello-1.0-1.i386.rpm
104 [.M5....T. /usr/local/bin/hello
105 missing d /usr/share/doc/hello-1.0/FAQ
110 # Test verify script success & failure behavior
111 # Ignoring stderr spew for now
112 AT_SETUP([verifyscript failure])
113 AT_KEYWORDS([verify])
119 runroot rpmbuild --quiet -bb /data/SPECS/verifyscript.spec
120 runroot rpm -U --nodeps "${TOPDIR}"/RPMS/noarch/verifyscript-1.0-1.noarch.rpm
121 rm -f "${RPMTEST}"/var/checkme
122 runroot rpm -V --nodeps verifyscript
129 AT_SETUP([verifyscript success])
130 AT_KEYWORDS([verify])
136 runroot rpmbuild --quiet -bb /data/SPECS/verifyscript.spec
137 runroot rpm -U --nodeps "${TOPDIR}"/RPMS/noarch/verifyscript-1.0-1.noarch.rpm
138 touch "${RPMTEST}"/var/checkme
139 runroot rpm -V --nodeps verifyscript
146 # ------------------------------
147 # shared file timestamp behavior
148 AT_SETUP([shared file timestamp behavior])
149 AT_KEYWORDS([verify])
155 # create packages sharing a file but with different timestamp
156 for p in "one" "two"; do
157 runroot rpmbuild --quiet -bb \
159 --define "filedata same_stuff" \
160 /data/SPECS/conflicttest.spec
164 # first instance of a shared file is the one that actually gets created,
165 # force the order so we know what to expect as these dont depend on each other
166 runroot rpm -U --noorder "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
167 runroot rpm -e conflicttwo
168 runroot rpm -Va --nouser --nogroup