Add a testcase for db iterator locked to single instance number
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 26 Mar 2013 10:36:15 +0000 (12:36 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 7 Jun 2013 07:32:36 +0000 (10:32 +0300)
- Back in the day, this case used to cause an endless loop. Just
  making sure we dont end up with such stupidity again...
(cherry picked from commit 035c52d2f4e58176ee90266b43367d32c5ae3d32)

tests/rpmpython.at

index 86a5d2f..ee85a2e 100644 (file)
@@ -197,6 +197,20 @@ runroot rpm -i \
 
 RPMPY_CHECK([
 ts = rpm.ts()
+ix = 0
+for h in ts.dbMatch():
+    if h['name'] == 'hello':
+        ix = h['dbinstance']
+        break
+for h in ts.dbMatch('packages', ix):
+    myprint(h['nevra'])
+],
+[hello-2.0-1.i686
+],
+[])
+
+RPMPY_CHECK([
+ts = rpm.ts()
 for h in ts.dbMatch('name'):
     myprint(h['nevra'])
 ],