Add a testcase for the header export sort issue (aka RhBug:953719)

This commit is contained in:
Panu Matilainen 2014-02-06 14:07:52 +02:00
parent 67ccf8d996
commit 1dbb0da2ff
1 changed files with 16 additions and 0 deletions

View File

@ -366,4 +366,20 @@ for f in archive:
[],
[])
RPMPY_TEST([header unload],[
ts = rpm.ts()
h = ts.hdrFromFdno('${RPMDATA}/RPMS/hello-2.0-1.i686.rpm')
# Add some garbage to header to make it non-sorted
h['installtime'] = 0
# RhBug:1061730 causes export of non-sorted header to be larger than it should
len1 = len(h.unload())
# Accessing the header before export forces sorting to take place even on
# buggy versions
t = h['installtime']
len2 = len(h.unload())
myprint(len1 == len2)
],
[True
],
[])