aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/test
Commit message (Collapse)AuthorAgeFilesLines
* taddons: remove has_eventAldo Cortesi2018-05-021-11/+0
| | | | We no longer use this anywhere, so ditch it.
* client replay: re-designAldo Cortesi2018-04-301-6/+4
| | | | | | | | | Re-design the way client replay works. Before, we would fire up a thread, replay, wait for the thread to complete, get the next flow, and repeat the procedure. Now, we have one replay thread that starts when the addon starts, which pops flows off a thread-safe queue. This is much cleaner, removes the need for busy tick, and sets the scene for optimisations like server connection reuse down the track.
* test: shift test_data out of our public APIAldo Cortesi2018-04-231-4/+0
|
* addons/script: improve relability of reload testAldo Cortesi2018-04-231-2/+2
| | | | | | The granularity of mtime is surprisingly bad. Make the tests more robust against this, and promote has_log back to a public method, now that we have a few legitimate examples.
* asyncio: shift script reloading out of the tick eventAldo Cortesi2018-04-231-5/+1
| | | | | | | The tick event is a nasty compromise, left over from when we didn't have an event loop. This is the first patch in a series that explores moving our built-in addons to managing coroutines on the eventloop directly for periodic tasks.
* asyncio: ditch the handler contextAldo Cortesi2018-04-071-11/+0
| | | | | | | There are a few reasons for this. First, logs are now async, and can be called at any time. Second, the event loop is thread local, so there can only ever be one master per thread. These two things together completely obviate the need for a handler context.
* asyncio: remove test master.has_logAldo Cortesi2018-04-071-2/+2
| | | | | Now that logs are async, using this call is almost always a mistake. Signal this by making it semi-private. The method may go away entirely down the track.
* asyncio: move log mechanism onto the event loopAldo Cortesi2018-04-071-0/+9
| | | | | | Logs are now asynchronous, with a log entry pushed onto the event loop for handling. To support this, the test mechanism grows an await_log method that waits for a log entry to appear.
* Start consolidating core optionsAldo Cortesi2018-02-261-2/+5
| | | | | | | | | | This is a preparatory patch that paves the way to consolidating our core options in the core addon. It amalgamates the core_option_validation and core addons, prepares the test suite for a world where options live in core, and moves over two trivial options as a trial balloon. From here, things will get harder, but at the end of the process we'll have a core that's responsive to options.
* Misc. typosluz.paz2018-02-241-1/+1
| | | | | | | | | | | | | | Found via `codespell -q 3 -I ../mitmproxy-word-whitelist.txt` Where whitelist contains: ``` cas doubleclick nd ot seeked statics te thru ```
* addon options: setheaders, stickyauthAldo Cortesi2018-02-241-1/+1
|
* addon options: migrate replace, simplify taddons.contextAldo Cortesi2018-02-241-4/+3
|
* Start moving addon options into /addonsAldo Cortesi2018-02-241-1/+5
| | | | | | | | | This takes the first few steps: - Extends taddons to make loading addon options easier - Removes dependencies in the test suite on options in addons - Tweaks command-line parser autocreation to ignore nonexistent options. This lets us load common options without over-depending on loaded addons.
* store ClientHello extensions with client connectionMaximilian Hils2018-01-131-0/+1
|
* rename TLS/SSL-related attributesThomas Kriechbaumer2018-01-061-4/+4
| | | | | | SSL is an outdated protocol superseeded by TLS. Although the commonly used library is called OpenSSL, it is no reason to still use outdated language for attributes.
* fix test flow timestamps to values that don't overflow in certain timezonesMaximilian Hils2018-01-052-15/+15
|
* add testsThomas Kriechbaumer2017-12-181-1/+3
|
* websocket: support domain and url filtersThomas Kriechbaumer2017-12-181-1/+1
|
* console: add a data view overlay for command outputAldo Cortesi2017-12-171-1/+0
| | | | Fixes #2654
* command cuts: add completionAldo Cortesi2017-12-172-3/+9
| | | | | | - Remove shortcuts for request, response, etc. - we don't need them if we have completion - Restrict cuts specification to a set of prefixes - Extend cuts to add a few more items
* Update taddon and tests.Matthew Shao2017-08-031-2/+2
|
* Update tests.Matthew Shao2017-08-011-0/+2
|
* disentangle ProxyServer and Master classes.Maximilian Hils2017-07-301-5/+5
| | | | | | The proxy server should ultimately be an addon itself and not be passed to the Master constructor. This commit already removes the server in the majority of instances, and also replaces a large number of ProxyConfig usages with the Options class..
* fixed addon errorUjjwal Verma2017-07-261-1/+1
|
* minor improvementsMaximilian Hils2017-06-021-0/+2
|
* cut: more flexible cut specification based on attribute pathsAldo Cortesi2017-04-301-2/+2
| | | | Also support certificate types, which are converted to ASCII-encoded PEM format.
* addons.streamfile -> addons.saveAldo Cortesi2017-04-271-1/+1
| | | | | | | Options: streamfile -> save_stream_file streamfile_filter -> save_stream_filter
* console: flow resolution commandAldo Cortesi2017-04-271-0/+8
| | | | | | | This is our first built-in command, which will be used by very many other commands. Also add a --commands option to dump all commands, analogous to --options.
* Addons and addon testingAldo Cortesi2017-04-261-0/+6
| | | | | | | | - Fix some loading sequence bugs affecting command-line script invocation - Allow addons to over-ride existing options (with a warning). We need this for reloading. - Convert har_dump to new-style arguments, fix and re-instate its test suite. - Covnert miscelaneous other exmples to new-style args.
* configure(options, updated) -> configure(updated)Aldo Cortesi2017-04-261-1/+0
| | | | | Options are now available globally on ctx, so the first argument of configure is redundant.
* Remove watchdog, solidify script testingAldo Cortesi2017-04-261-4/+7
| | | | | | | | - Remove the watchdog dependency. We now just stat the script file every 2 seconds to check for an updated mtime. - Further solidify our script testing, and in particular make the example tests nicer. These should exemplify how we want users to test their own addon scripts. More work on addon testing to follow.
* Revamp how addons workAldo Cortesi2017-04-251-8/+36
| | | | | | | | | | | | | | | | | | | - Addons now nest, which means that addons can manage addons. This has a number of salutary effects - the scripts addon no longer has to poke into the global addons list, we no longer have to replace/remove/boot-outof parent addons when we load scripts, and this paves the way for making our top-level tools into addons themselves. - All addon calls are now wrapped in a safe execution environment where exceptions are caught, and output to stdout/stderr are intercepted and turned into logs. - We no longer support script arguments in sys.argv - creating an option properly is the only way to pass arguments. This means that all scripts are always directly controllable from interctive tooling, and that arguments are type-checked. For now, I've disabled testing of the har dump example - it needs to be moved to the new argument handling, and become a class addon. I'll address that in a separate patch.
* Rip out master handler mechanismAldo Cortesi2017-03-161-10/+7
| | | | | All events are now handled by addons, and we no longer support any events on master.
* Remove test handlers by using taddons.RecordingMasterAldo Cortesi2017-03-161-4/+13
| | | | | This also means expanding and tweaking the recording master API, which we reflect through the current test suite
* Add a light-weight custom event system, use it for keepservingAldo Cortesi2017-03-161-3/+23
| | | | | | | This patch implements the lightweight event system I propose in #2144, adds a custom event "processing_complete" that is triggered after file read, client replay and server replay, and introduces a KeepServing addon to handle this for mitmdump.
* add connection idsMaximilian Hils2017-03-141-0/+3
|
* nuke tutils.tmpdir, use pytest tmpdirThomas Kriechbaumer2017-03-121-17/+1
|
* make websocket flows serializableThomas Kriechbaumer2017-03-091-0/+1
| | | | fixes #2113
* Cleanups and test coverageAldo Cortesi2017-03-071-2/+3
|
* Revamp optionsAldo Cortesi2017-03-051-12/+2
| | | | | - Options are now explicitly initialized with an add_option method - We have one canonical Options class - ditch dump.Options
* connections: coverage++ (#2064)Thomas Kriechbaumer2017-02-261-0/+7
|
* flowfilter: coverage++Thomas Kriechbaumer2017-02-241-1/+2
|
* nuke tcp.Address and add proper IPv6 supportThomas Kriechbaumer2017-02-241-3/+3
|
* store generated cert for each flowDaniel Lenski2017-02-211-0/+1
| | | | fixes #1935
* eventsequence: coverage++Thomas Kriechbaumer2017-02-091-2/+2
|
* websockets, tcp, version: coverage++Thomas Kriechbaumer2017-02-091-2/+3
|
* fix mergeThomas Kriechbaumer2017-02-021-5/+6
|
* replace tutils.raises with pytest.raises + shimThomas Kriechbaumer2017-02-021-59/+0
|
* cleanup test utilsThomas Kriechbaumer2017-02-022-7/+27
|
* test disable_h2c_upgrade addonThomas Kriechbaumer2017-01-231-0/+1
|