From f9505063f804b9e1c736299b2387e1ddfbdc4f97 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 17 Dec 2008 16:25:07 +0530 Subject: Added gpg verification options per repo to the config file. Once we do this, add support for VerifySig to pactest. We just check if the repo name contains Always, Never or Optional to determine the value of VerifySig. The default is Never. pacman uses Always by default but this is not suitable for pactest. Original-work-by: shankar Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- test/pacman/pmdb.py | 6 ++++++ test/pacman/tests/sign001.py | 2 +- test/pacman/tests/sign002.py | 2 +- test/pacman/util.py | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index fefb135a..1af24ae9 100755 --- a/test/pacman/pmdb.py +++ b/test/pacman/pmdb.py @@ -89,6 +89,12 @@ class pmdb(object): def __str__(self): return "%s" % self.treename + def getverify(self): + for value in "Always","Never","Optional": + if value in self.treename: + return value + return "Never" + def getpkg(self, name): """ """ diff --git a/test/pacman/tests/sign001.py b/test/pacman/tests/sign001.py index 447cea1e..0ae417b7 100644 --- a/test/pacman/tests/sign001.py +++ b/test/pacman/tests/sign001.py @@ -2,7 +2,7 @@ self.description = "Add a signature to a package DB" sp = pmpkg("pkg1") sp.pgpsig = "asdfasdfsdfasdfsdafasdfsdfasd" -self.addpkg2db("sync", sp) +self.addpkg2db("sync+Always", sp) self.args = "-Ss" diff --git a/test/pacman/tests/sign002.py b/test/pacman/tests/sign002.py index 7b098c0d..b55f331e 100644 --- a/test/pacman/tests/sign002.py +++ b/test/pacman/tests/sign002.py @@ -2,7 +2,7 @@ self.description = "Verify a signature in a sync DB (failure)" sp = pmpkg("pkg1") sp.pgpsig = "iEYEABECAAYFAkhMOggACgkQXC5GoPU6du2WVQCffVxF8GKXJIY4juJBIw/ljLrQxygAnj2QlvsUd7MdFekLX18+Ov/xzgZ1" -self.addpkg2db("sync", sp) +self.addpkg2db("sync+Always", sp) self.args = "-S %s" % sp.name diff --git a/test/pacman/util.py b/test/pacman/util.py index b771a345..47255923 100755 --- a/test/pacman/util.py +++ b/test/pacman/util.py @@ -132,8 +132,9 @@ def mkcfgfile(filename, root, option, db): if key != "local": value = db[key] data.append("[%s]\n" \ + "VerifySig = %s\n" \ "Server = file://%s" \ - % (value.treename, + % (value.treename, value.getverify(), \ os.path.join(root, SYNCREPO, value.treename))) for optkey, optval in value.option.iteritems(): data.extend(["%s = %s" % (optkey, j) for j in optval]) -- cgit v1.2.3-24-g4f1b