diff options
author | Dan McGee <dan@archlinux.org> | 2010-12-29 18:43:44 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-12-29 18:43:44 -0600 |
commit | a58083459b096e935693d94b9cb51a447b3a1abd (patch) | |
tree | e21857a8cc0b3dbe562cfe015571280c41023729 /test | |
parent | 126f50ab0b5ee3ed46c5a6ecae241e8af49b0fe2 (diff) | |
parent | e3c19569cfe7cd77674490b30624e71512417e0b (diff) |
Merge branch 'fgets-perf'
Diffstat (limited to 'test')
-rwxr-xr-x | test/pacman/pmrule.py | 10 | ||||
-rwxr-xr-x | test/pacman/pmtest.py | 7 | ||||
-rw-r--r-- | test/pacman/tests/smoke002.py | 19 |
3 files changed, 26 insertions, 10 deletions
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index e7c9c44f..89ae3f49 100755 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -29,7 +29,9 @@ class pmrule: self.result = 0 def __str__(self): - return "rule = %s" % self.rule + if len(self.rule) <= 40: + return self.rule + return self.rule[:37] + '...' def check(self, root, retcode, localdb, files): """ @@ -76,6 +78,9 @@ class pmrule: elif case == "VERSION": if value != newpkg.version: success = 0 + elif case == "DESC": + if value != newpkg.desc: + success = 0 elif case == "GROUPS": if not value in newpkg.groups: success = 0 @@ -153,7 +158,4 @@ class pmrule: self.result = success return success - -if __name__ != "__main__": - rule = pmrule("PKG_EXIST=dummy") # vim: set ts=4 sw=4 et: diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index b7af5809..c70e41ae 100755 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -260,11 +260,6 @@ class pmtest: self.result["fail"] += 1 else: msg = "SKIP" - print "\t[%s] %s" % (msg, i.rule) - i.result = success - - -if __name__ == "__main__": - pass + print "\t[%s] %s" % (msg, i) # vim: set ts=4 sw=4 et: diff --git a/test/pacman/tests/smoke002.py b/test/pacman/tests/smoke002.py new file mode 100644 index 00000000..44f2d0ec --- /dev/null +++ b/test/pacman/tests/smoke002.py @@ -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) |