Add test for file verification from originating package
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 7 Aug 2012 09:52:29 +0000 (12:52 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 7 Aug 2012 09:52:29 +0000 (12:52 +0300)
tests/rpmverify.at

index 77d6bfe..f863121 100644 (file)
@@ -64,7 +64,7 @@ runroot rpm -Vva --nodeps --nouser --nogroup
 AT_CLEANUP
 
 # Test file verify after mutilating the files a bit.
-AT_SETUP([verify files with problems present])
+AT_SETUP([verify from db, with problems present])
 AT_KEYWORDS([verify])
 AT_CHECK([
 RPMDB_CLEAR
@@ -85,6 +85,28 @@ missing   d /usr/share/doc/hello-1.0/FAQ
 [])
 AT_CLEANUP
 
+# Test file verify from original package after mutilating the files a bit.
+AT_SETUP([verify from package, with problems present])
+AT_KEYWORDS([verify])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpm -U --nodeps --noscripts --ignorearch --ignoreos \
+       /data/RPMS/hello-1.0-1.i386.rpm
+rm -f "${RPMTEST}"/usr/share/doc/hello-1.0/FAQ
+chmod u-x "${RPMTEST}"/usr/local/bin/hello
+dd if=/dev/zero of="${RPMTEST}"/usr/local/bin/hello \
+   conv=notrunc bs=1 seek=5 count=6 2> /dev/null
+runroot rpm -Vp --nodeps --nouser --nogroup /data/RPMS/hello-1.0-1.i386.rpm
+],
+[1],
+[.M5....T.    /usr/local/bin/hello
+missing   d /usr/share/doc/hello-1.0/FAQ
+],
+[])
+AT_CLEANUP
+
 # Test verify script success & failure behavior
 # Ignoring stderr spew for now
 AT_SETUP([verifyscript failure])