summaryrefslogtreecommitdiff
path: root/src/mailman/testing/layers.py
Commit message (Collapse)AuthorAgeFilesLines
* Add support for regex based postfix transport maps and relay_domains.Abhilash Raj2017-05-231-0/+1
|
* Bump copyright years.Barry Warsaw2017-01-041-1/+1
|
* Use `atpublic` for @public instead of internal copy.Barry Warsaw2016-11-291-1/+1
|
* New template system. Closes #249Barry Warsaw2016-07-161-4/+2
| | | | | The new template system is introduced for API 3.1. See ``src/mailman/rest/docs/templates.rst`` for details.
* Replace another rmtree() with a better solution.Barry Warsaw2016-05-011-4/+8
|
* Ensure that $(PWD)/var/ is cleaned up.Barry Warsaw2016-04-301-1/+5
|
* Clean up the testing directory.Barry Warsaw2016-03-251-18/+9
|
* Happy New Year.Barry Warsaw2016-01-021-1/+1
|
* Turn off tying the -E test suite option to debugging the database logger.Barry Warsaw2015-08-181-2/+5
| | | | | | | SQLAlchemy is generally pretty chatty and usually not necessary to debug. Set use_poll=True in asyncore.loop() which improves Python 3.5 compatibility. We were getting OSErrors in stop() when using select under Python 3.5.
* all tests passing now (except doctests)Abhilash Raj2015-03-261-1/+1
|
* Bump copyright years.Barry Warsaw2015-01-041-1/+1
|
* Remove huge amounts of now unnecessary file boilerplate.Barry Warsaw2014-12-221-11/+6
|
* Checkpointing.Barry Warsaw2014-11-301-2/+3
| | | | | | | | | | By using `six` I think I have most of the imports squared away. There's probably still uses of `unicode` built-ins that need fixing. The idea is to first get the test suite running (which it doesn't yet), and then to fix tests. There's a bug in lazr.config which requires us to patch it for now.
* Remove some unnecessary code, and revert back to SQLite by default for theBarry Warsaw2014-11-011-3/+0
| | | | test suite.
* DatabaseBarry Warsaw2014-11-011-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------- * The ORM layer, previously implemented with Storm, has been replaced by SQLAlchemy, thanks to the fantastic work by Abhilash Raj and Aurélien Bompard. Alembic is now used for all database schema migrations. * The new logger `mailman.database` logs any errors at the database layer. API --- * Several changes to the internal API: - `IListManager.mailing_lists` is guaranteed to be sorted in List-ID order. - `IDomains.mailing_lists` is guaranteed to be sorted in List-ID order. - Iteration over domains via the `IDomainManager` is guaranteed to be sorted by `IDomain.mail_host` order. - `ITemporaryDatabase` interface and all implementations are removed.
| * Merge abompard's fixes to the Postgres test suite.Barry Warsaw2014-10-301-3/+4
| |
| * Remove some unnecessary code.Barry Warsaw2014-10-131-4/+1
| |
| * Merge Aurélien Bompard's latest merge branch, with some cleaning up by Barry.Barry Warsaw2014-10-131-1/+4
| |\
| | * Don't use a testing layer for database testsAurélien Bompard2014-10-061-55/+0
| | |
| | * Merge from Abhilash's branchAurélien Bompard2014-10-061-3/+3
| | |\ | | |/ | |/|
| | * Fix DB unit testsAurélien Bompard2014-10-061-4/+34
| | |
| | * New DB testing layer that does not auto-create the DBAurélien Bompard2014-10-031-0/+30
| | |
| * | Migrations, with cleanup by Barry.Barry Warsaw2014-09-271-0/+4
|/| | | |/
| * added support for migrations via alembicAbhilash Raj2014-09-241-0/+4
|/
* Bump copyright years.Barry Warsaw2014-01-011-1/+1
|
* * When --sort is used, watch out for continuation lines, which shouldn't getBarry Warsaw2013-10-181-27/+6
| | | | | | sorted. * Fix stderr output in sub-runners, and move the -e test option to -E.
* Switch to virtualenv and nose2 instead of zc.buildout and zope.testing.Barry Warsaw2013-08-251-1/+1
|
* * `bin/runner` command has been simplified and its command line optionsBarry Warsaw2013-06-171-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | reduced. Now, only one `-r/--runner` option may be provided and the round-robin feature has been removed. * Fixed REST server crash on `reopen` command. Identification and test provided by Aurélien Bompard. (LP: #1184376) Also: * bin/runner now uses standard argparse instead of ScriptOptions. * The entire bin/runner machinery has bee reorganized and simplified. There * is no more Loop class. Signal setting is moved directly into the base Runner class and overrided in specific subclasses (e.g. RESTRunner which must cleanly shutdown its TCPServer). The runner exit status is now set directly on the Runner instance. * Fixed a few minor style issues. * In order to cleanly shutdown the RESTRunner's WSGI server, we must start a subthread which only watches for an Event and then calls the server's shutdown() method. It has to be this way because the WSGI server itself (due to interactions with SQLite), and the signal handlers (due to Python's signal handling semantics) must both run in the main thread. However, the shutdown() must be invoked from a subthread in order to prevent deadlock. * Refactor the RESTLayer to eliminate duplication of code.
* Bump copyright years.Barry Warsaw2013-01-011-1/+1
|
* ConfigurationBarry Warsaw2012-11-041-2/+13
| | | | | | | | | | | | | | | ------------- * `[passlib]path` configuration variable renamed to `[passlib]configuration`. * Postfix-specific configurations in the `[mta]` section are moved to a separate file, named by the `[mta]configuration` variable. * In the new `postfix.cfg` file, `postfix_map_cmd` is renamed to `postmap_command`. Also: * More Python 2.7-isms, use assertMultiLineEqual() directly. * Added external_configuration() and load_external() to mailman.config.config * ConfigLayer does a blanket set of [postfix]postmap_command so subtests generally won't have to.
* Refactor to better handling the difference between a testing database and aBarry Warsaw2012-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | production database. - Add an IDatabaseFactory interface with two named utility implementations. The initialization subsystem will either ask for the 'testing' or 'production' factory utility depending on whether we're in the test suite or not. The testing factory returns an IDatabase that can be _reset(). - initialize_2() now takes an optional `testing` argument, defaulting to False. The test ConfigLayer will pass in True. - Remove _reset() from the base database class. - The ModelMeta now adds a PRESERVE attribute to database classes. This defaults to False, meaning by default the test framework will reset the table. The Version table is preserved because it records the schema migrations. - Because of the above, we no longer need to support pre_reset() and post_reset() on migrations. Also, bin/mailman should allow the standard configuration file search algorithm to be used except when -C/--config is given.
* * `passlib`_ is now used for all password hashing instead of flufl.password.Barry Warsaw2012-07-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | The default hash is `sha512_crypt`. * Events renamed and moved: * `mailman.chains.accept.AcceptNotification` * `mailman.chains.base.ChainNotification` * `mailman.chains.discard.DiscardNotification` * `mailman.chains.hold.HoldNotification` * `mailman.chains.owner.OwnerNotification` * `mailman.chains.reject.RejectNotification` changed to (respectively): * `mailman.interfaces.chains.AcceptEvent` * `mailman.interfaces.chains.ChainEvent` * `mailman.interfaces.chains.DiscardEvent` * `mailman.interfaces.chains.HoldEvent` * `mailman.interfaces.chains.AcceptOwnerEvent` * `mailman.interfaces.chains.RejectEvent` * A `ConfigurationUpdatedEvent` is triggered when the system-wide global configuration stack is pushed or popped. * With the switch to `passlib`_, `[passwords]password_scheme` has been removed. Instead use `[passwords]path` to specify where to find the `passlib.cfg` file. See the comments in `schema.cfg` for details.
* Replace flufl.password with passlib, albeit with a wrapper.Barry Warsaw2012-06-271-1/+1
|
* - Modernize the layers.py module by using print().Barry Warsaw2012-04-221-6/+7
| | | | | - Rewrite a small bit of code to use the transaction context manager instead of accessing config.db directly.
* Verp all messages to the -owners. Add a test to prove that email to -ownersBarry Warsaw2012-03-231-0/+8
| | | | now works as expected!
* * The LMTP server now requires that the incoming message have a `Message-ID`,Barry Warsaw2012-03-131-1/+34
| | | | | | | | | | | otherwise it rejects the message with a 550 error. Also, the LMTP server adds the `X-Message-ID-Hash` header automatically. The `inject` cli command will also add the `X-Message-ID-Hash` header, but it will craft a `Message-ID` header first if one is missing from the injected text. Also, `inject` will always set the correct value for the `original_size` attribute on the message object, instead of trusting a possibly incorrect value if it's already set. The individual `IArchiver` implementations no longer set the `X-Message-ID-Hash` header.
* copybumpBarry Warsaw2012-01-011-1/+1
|
* Fixed two typos.Barry Warsaw2011-06-111-2/+3
| | | | | * Use a list comprehension to get a proper list of addresses. * config.devmode.testing must be converted to a boolean.
* Major terminology shift:Barry Warsaw2011-06-011-1/+1
| | | | | | | | | | | | | | | | | * Queue runners are now called just 'Runners' since several of them don't manage queue directories. * Ban the term 'qrunner' too. * The master queue runner watcher should now just be called the 'master' or the 'master runner'. * bin/qrunner -> bin/runner * mailman.qrunner log file -> mailman.runner * master-qrunner.lck -> master.lck * master-qrunner.pid -> master.pid Also: * Remove some obsolete files * Begin the .txt -> .rst renaming
* Move the test timeout values into a configuration variable. Set devmode.waitBarry Warsaw2011-05-031-1/+2
| | | | to the timeout value you want.
* Merge passwords into restBarry Warsaw2011-04-081-0/+2
|\
| * encrypt_password(): New convenience function for ensuring that a password isBarry Warsaw2011-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | both encrypted according to a scheme, and a bytes object. add_member(): Use encrypt_password(). cli_members: Give the user a default, user-friendly password. Of course, this will be encrypted so it can't be retrieved, but it can be reset. Passwords are stored as bytes objects, not unicode now. ConfigLayer: Set the default test password scheme to cleartext. General test repair.
* | Removing debugging printBarry Warsaw2011-04-041-1/+0
| |
* | More fleshing out of the users REST API.Barry Warsaw2011-04-041-0/+14
|/ | | | | | | | | | | | | | * Add a 'uid factory' which allows us to return predictable unique ids for various testing purposes, e.g. user ids. This should work even in the case of cross-subprocess uid generation. * REST access to individual users, or the set of all users. * User objects now have a created_on attribute. * Users can be created through the web, but must have an email address. * Add a [devmode] 'testing' variable for communicating to qrunner subprocesses that we're running in testing mode. This allows us to coordinate factories and such in the qrunner processes. * layers.is_testing() for more consistent API. * Give AddressError a .address attribute for better diagnostics.
* * Re-organize the interface between buildout.cfg and the zope.testing layerBarry Warsaw2011-04-011-8/+10
| | | | | | | | | | | | | | | | | | | initialization. buildout.cfg is now really simple; it calls one method. That method does all the relevant layer initializations. This better localizes what has to be set up before testing can even begin. * IUsers now have a created_on property which contains the datetime at which the user record was created. * Rework the date and uid factories so that they consult the MockAndMonkeyLayer for the current testing flag. Also, those factories register themselves with the layer so that they'll get automatically reset between tests, without the layer actually having to know about them. * Move the User model object initialization into User.__init__() from the user manager. The User now also adds itself to the store. * Add a 'uid factory' for unique id creation, which is test suite aware.
* Fixed a typo in add_member() which prevented subscribing an email address thatBarry Warsaw2011-01-311-15/+2
| | | | | | | | was already linked to a user. Found by Florian Fuchs who also provided the fix, though I implemented the test differently. LP: #710182 Also, refactor the "reset the world" functionality ConfigLayer.testTearDown() so that it could be used by other test code.
* LP: #490044 - Support SMTP AUTH.Barry Warsaw2011-01-021-0/+1
| | | | | Added smtp_user and smtp_pass options to the [mta] section to support logging into the SMTP server. All the underlying support is in Python's smtplib.
* Happy New Year.Barry Warsaw2011-01-011-1/+1
|
* Insulate the test environment from the running environment. Sadly, the testBarry Warsaw2010-12-221-1/+1
| | | | | | ports are still hard coded. Also, 'bin/mailman info' dumps the REST root url and credentials.
* Add Basic Auth support to the REST API, given by Jimmy Bergman, with styleBarry Warsaw2010-10-111-2/+8
|\ | | | | | | corrections by Barry.