summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-23 08:34:51 +0100
committerDan McGee <dan@archlinux.org>2011-03-23 08:34:51 +0100
commitf7b577dc77667d8b7dc346e9754d9b203cc8068d (patch)
tree31a4505db608dac3d3aca97c8a300cb336ce69a7 /test
parent8584c25903d72de7489733bbbf0c3dd21bbc81ac (diff)
parentcedc63375758cf1c2a821dd5a78d960b34b44f28 (diff)
downloadpacman-f7b577dc77667d8b7dc346e9754d9b203cc8068d.tar.gz
pacman-f7b577dc77667d8b7dc346e9754d9b203cc8068d.tar.xz
Merge branch 'gpg-libalpm-basics'
Diffstat (limited to 'test')
-rwxr-xr-xtest/pacman/pmdb.py4
-rwxr-xr-xtest/pacman/pmpkg.py1
-rw-r--r--test/pacman/tests/sign001.py9
-rw-r--r--test/pacman/tests/smoke004.py11
4 files changed, 25 insertions, 0 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index b31498a7..fefb135a 100755
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -150,6 +150,8 @@ class pmdb(object):
pkg.size = int(fd.readline().strip("\n"))
elif line == "%MD5SUM%":
pkg.md5sum = fd.readline().strip("\n")
+ elif line == "%PGPSIG%":
+ pkg.pgpsig = fd.readline().strip("\n")
elif line == "%REPLACES%":
pkg.replaces = _getsection(fd)
elif line == "%DEPENDS%":
@@ -241,6 +243,8 @@ class pmdb(object):
data.append(_mksection("CSIZE", pkg.csize))
if pkg.md5sum:
data.append(_mksection("MD5SUM", pkg.md5sum))
+ if pkg.pgpsig:
+ data.append(_mksection("PGPSIG", pkg.pgpsig))
if data:
data.append("")
filename = os.path.join(path, "desc")
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 73156ab2..ec51e5d4 100755
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -47,6 +47,7 @@ class pmpkg(object):
self.csize = 0
self.reason = 0
self.md5sum = "" # sync only
+ self.pgpsig = "" # sync only
self.replaces = []
self.depends = []
self.optdepends = []
diff --git a/test/pacman/tests/sign001.py b/test/pacman/tests/sign001.py
new file mode 100644
index 00000000..447cea1e
--- /dev/null
+++ b/test/pacman/tests/sign001.py
@@ -0,0 +1,9 @@
+self.description = "Add a signature to a package DB"
+
+sp = pmpkg("pkg1")
+sp.pgpsig = "asdfasdfsdfasdfsdafasdfsdfasd"
+self.addpkg2db("sync", sp)
+
+self.args = "-Ss"
+
+self.addrule("PACMAN_RETCODE=0")
diff --git a/test/pacman/tests/smoke004.py b/test/pacman/tests/smoke004.py
new file mode 100644
index 00000000..1f9b883d
--- /dev/null
+++ b/test/pacman/tests/smoke004.py
@@ -0,0 +1,11 @@
+self.description = "Read a package DB with several PGP signatures"
+
+for i in range(1000):
+ sp = pmpkg("pkg%03d" % i)
+ sp.desc = "test description for package %d" % i
+ sp.pgpsig = "asdfasdfsdfasdfsdafasdfsdfasd"
+ self.addpkg2db("sync", sp)
+
+self.args = "-Ss"
+
+self.addrule("PACMAN_RETCODE=0")