From 63b7097f67dfcbd95c4df359d31374e8849a666c Mon Sep 17 00:00:00 2001 From: J08nY Date: Wed, 19 Jul 2017 19:39:57 +0200 Subject: Add testing configs. --- src/mailman_pgp/testing/layers.py | 4 --- src/mailman_pgp/testing/mailman.cfg | 33 +++++++++++++++++++ src/mailman_pgp/testing/mailman_pgp.cfg | 57 +++++++++++++++++++++++++++++++++ tox.ini | 2 +- 4 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 src/mailman_pgp/testing/mailman.cfg create mode 100644 src/mailman_pgp/testing/mailman_pgp.cfg diff --git a/src/mailman_pgp/testing/layers.py b/src/mailman_pgp/testing/layers.py index 9f80248..07eb386 100644 --- a/src/mailman_pgp/testing/layers.py +++ b/src/mailman_pgp/testing/layers.py @@ -63,10 +63,6 @@ def reset_pgp_soft(): # don't work when ws create a mixin class with the two classmethods # and subclass both it and the respective Mailman Core test layer. class PGPConfigLayer(ConfigLayer): - @classmethod - def setUp(cls): - config.set('keypairs', 'autogenerate', 'no') - @classmethod def tearDown(cls): reset_pgp_soft() diff --git a/src/mailman_pgp/testing/mailman.cfg b/src/mailman_pgp/testing/mailman.cfg new file mode 100644 index 0000000..d9401ca --- /dev/null +++ b/src/mailman_pgp/testing/mailman.cfg @@ -0,0 +1,33 @@ +# Copyright (C) 2017 Jan Jancar +# +# This file is a part of the Mailman PGP plugin. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see . + +# Testing Mailman config + +[plugin.pgp] +class: mailman_pgp.plugin.PGPMailman +path: mailman_pgp +enable: yes +configuration: python:mailman_pgp.testing.mailman_pgp + +[mta] +outgoing: mailman_pgp.mta.deliver.deliver + +[runner.in] +class: mailman_pgp.runners.incoming.PGPIncomingRunner + +[runner.in_default] +class: mailman.runners.incoming.IncomingRunner diff --git a/src/mailman_pgp/testing/mailman_pgp.cfg b/src/mailman_pgp/testing/mailman_pgp.cfg new file mode 100644 index 0000000..735f1a0 --- /dev/null +++ b/src/mailman_pgp/testing/mailman_pgp.cfg @@ -0,0 +1,57 @@ +# Copyright (C) 2017 Jan Jancar +# +# This file is a part of the Mailman PGP plugin. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see . + +# Default PGP config + +[db] +# db path the PGP plugin will use to store list/user configuration (not keys!). +url = sqlite:////$DATA_DIR/pgp.db + + +[keydirs] +# Key directory used to store user public keys. +user_keydir= $DATA_DIR/pgp/user_keydir/ + +# Key directory used to store list keypairs. +list_keydir = $DATA_DIR/pgp/list_keydir/ + +# Key directory used to store archive public keys. +archive_keydir = $DATA_DIR/pgp/archive_keydir/ + + +[keypairs] +# Whether to autogenerate +autogenerate = no + +# Length of primary list key. +key_length = 1024 + +# Type of primary list key. +# One of RSA, DSA, ECDSA. +key_type = RSA + +# Length of list encryption subkey. +subkey_length = 1024 + +# Type of list encryption subkey. +# One of RSA, ECDH. +subkey_type = RSA + + +[queues] +# The queue to which processed incoming messages are passed. +in = in_default \ No newline at end of file diff --git a/tox.ini b/tox.ini index 4845bb6..173a96b 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ deps = flufl.testing # Expects a mailman repo and PGPy repo in parent directory. dev: -e../mailman dev: -e../PGPy -setenv = MAILMAN_EXTRA_TESTING_CFG = {toxinidir}/src/mailman_pgp/config/mailman.cfg +setenv = MAILMAN_EXTRA_TESTING_CFG = {toxinidir}/src/mailman_pgp/testing/mailman.cfg cov: COVERAGE_PROCESS_START = {[coverage]rcfile} commands = nocov: python -m nose2 -v {posargs} cov: python -m coverage run {[coverage]rc} -m nose2 -v {posargs} -- cgit v1.2.3-70-g09d2