mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
Add pactest to test long archive reads
This creates two packages with extremely long description lines (500KB and 600 KB), causing our archive read code to perform reallocation to store the whole contents. One of the packages will successfully read while the other will fail for the time being. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
fbcc427754
commit
e3c19569cf
19
test/pacman/tests/smoke002.py
Normal file
19
test/pacman/tests/smoke002.py
Normal file
@ -0,0 +1,19 @@
|
||||
self.description = "Install packages with huge descriptions"
|
||||
|
||||
p1 = pmpkg("pkg1")
|
||||
p1.desc = 'A' * 500 * 1024
|
||||
self.addpkg(p1)
|
||||
|
||||
p2 = pmpkg("pkg2")
|
||||
p2.desc = 'A' * 600 * 1024
|
||||
self.addpkg(p2)
|
||||
|
||||
self.args = "-U %s %s" % (p1.filename(), p2.filename())
|
||||
|
||||
# Note that the current cutoff on line length is 512K, so the first package
|
||||
# will succeed while the second one will fail to record the description.
|
||||
self.addrule("PACMAN_RETCODE=0")
|
||||
self.addrule("PKG_EXIST=pkg1")
|
||||
self.addrule("PKG_DESC=pkg1|%s" % p1.desc)
|
||||
self.addrule("PKG_EXIST=pkg1")
|
||||
self.addrule("!PKG_DESC=pkg1|%s" % p2.desc)
|
Loading…
Reference in New Issue
Block a user