1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

Add pactest for overflowing date (year 2038 problem)

This will work fine on x86_64 (or any platform that has a 64 bit long),
but currently fails on i686. This test also stresses the recent changes
to accommodate package size values greater than a 32 bit UINT_MAX.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-09-01 12:06:32 -05:00
parent 11873b70ae
commit 13072ef86c
3 changed files with 31 additions and 4 deletions

View File

@ -1,4 +1,4 @@
self.description = "Query info on a package" self.description = "Query info on a package (old date)"
p = pmpkg("foobar") p = pmpkg("foobar")
p.files = ["bin/foobar"] p.files = ["bin/foobar"]

View File

@ -1,4 +1,4 @@
self.description = "Query info on a package" self.description = "Query info on a package (new date)"
p = pmpkg("foobar") p = pmpkg("foobar")
p.files = ["bin/foobar"] p.files = ["bin/foobar"]

View File

@ -0,0 +1,27 @@
self.description = "Query info on a package (overflow long values)"
p = pmpkg("overflow")
p.desc = "Overflow size and date values if possible"
p.url = "http://www.archlinux.org"
p.license = "GPL2"
p.arch = "i686"
p.packager = "Arch Linux"
# size is greater than 4294967295, aka UINT_MAX
p.size = "10000000000"
# build date is greater than 2147483647, aka INT_MAX
p.builddate = "3000000000"
# install date is greater than UINT_MAX
p.installdate = "10000000000"
self.addpkg2db("local", p)
self.args = "-Qi %s" % p.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PACMAN_OUTPUT=^Name.*%s" % p.name)
self.addrule("PACMAN_OUTPUT=^Description.*%s" % p.desc)
self.addrule("PACMAN_OUTPUT=^Installed Size.*9765625.00 KiB")
self.addrule("PACMAN_OUTPUT=^Build Date.* 2065")
self.addrule("PACMAN_OUTPUT=^Install Date.* 2286")
self.expectfailure = True