summaryrefslogtreecommitdiff
path: root/testing
AgeCommit message (Collapse)Author
2016-12-07[feature] Change CTR to GCM on secrets.pyVictor Shyba
Current implementation can allow tampering and the CTR->GCM exchange can help to avoid it. This commits also alters a behaviour where we moved ahead after failing to decrypt a recovery document. IMHO we can't move ahead as this is a fatal error. Signed-off-by: Victor Shyba <victor1984@riseup.net>
2016-12-07[feature] Add retro compat on secrets.py ciphersVictor Shyba
Integrated the secrets's JSON key that specifies ciphers into _crypto and added optional GCM. Also added a test to check if both cipher types can be imported. Resolves: #8680 Signed-off-by: Victor Shyba <victor1984@riseup.net>
2016-12-06[feature] use GCM instead of CTR+HMACVictor Shyba
Resolves: #8668 - client: substitute usage of CTR mode + HMAC by GCM cipher mode Signed-off-by: Victor Shyba <victor1984@riseup.net>
2016-11-30[refactor] improve blob signature magic usageVictor Shyba
Our magic value wasn't being used and were represented as a string. Refactored it to a constant, increased it's size to 2 bytes and optimzed is_symmetrically_encrypted to look for the magic and symmetrically encrypted flag under base64 encoding. Most file types will use this feature to help identifying themselves, so it got refactored to serve the purpose it was created.
2016-11-29[feature] speed up sync benchmark setup codeVictor Shyba
We aren't testing huge payloads on CI, so it doesn't make sense to insert docs one by one. 'gatherResults' can speed up bench setup.
2016-11-28[refactor] introduces a GenericWriterVictor Shyba
AESWriter and HMACWriter are just applying hmac or aes into a flow of data. Abstracted the application of those operations into a super class and highlighted just the difference on each implementation.
2016-11-28[refactor] simplify _cryptoVictor Shyba
After adding the streaming decrypt, some classes were doing almost the same thing. Unified them. Also fixed some module level variables to upper case and some class name to camel case.
2016-11-28[bug] make the semaphore cover all parsingVictor Shyba
Unfortunately, if a doc finishes decryption before the previous one we will still have an issue while inserting. This commits solves it by adding the parse and decrypt inside of the semaphore.
2016-11-28[feature] make _crypto stream on decryptionVictor Shyba
We are already doing this on encryption, now we can stream also from decryption. This unblocks the reactor and will be valuable for blobs-io.
2016-11-28[feature] delimit preamble from ciphertextVictor Shyba
We now encode preamble and ciphertext+hmac in two distinct payloads separated by a space. This allows metadata to be extracted and used before decoding the whole document. It also introduces a single packer for packing and unpacking of data instead of reads and writes. Downside: doc_id and rev are limited to 255 chars now.
2016-11-27[refactor] Hide IV, simplify some callsVictor Shyba
IV was being set during tests and this required some defensive coding to avoid IV being set in production. This commits makes the test use the generated IV and "hides" it using a read-only property to let it clear this should never happen. Also refactored out some parameters that are generated automatically to reduce some lines of code and enhance readability.
2016-11-21[refactor] separate server application into another filedrebs
2016-11-20[bug] emit last sent doc eventVictor Shyba
Document sending happens after encryption, so the last sent document needs to be signalled after request end.
2016-11-19[tests] fixes test_crypto benchVictor Shyba
encrypt returns a deferred and needs the adapted benchmark runner.
2016-11-19[tests] use options instead of marksVictor Shyba
When we use marks the new pytests from benchmarks folder are collected and ignored, but this causes trial to fail sometimes. Using --ignore avoids it from being loaded while --benchmark-only will properly select the benchmarks for tox, as intended.
2016-11-19[tests] migrate pytest to trialVictor Shyba
test_deprecated_crypto was using pytest, which unfortunately doesnt work when mixed with trial. Migrated back. Also added norecursedirs option back, as it is necessary for parallel testing mode.
2016-11-18[test] rename benchmark tests directory and tagdrebs
2016-11-18[test] add test for deprecated crypto format updatedrebs
2016-11-18[test] move fixtures one level updrebs
2016-11-18[test] use tags for selecting benchmark testsdrebs
2016-11-18[test] remove unneeded setting of environment variablesdrebs
2016-11-18[style] fix pep8 and confsVictor Shyba
Fixes setup.cfg, adding current exclude rules, simplified tox.ini to use setup.cfg and fixed all.
2016-11-18[bug] include_deleted=True on syncVictor Shyba
Also refactored tests and code to stop relying on old parameters which included docs instead of get_doc calls.
2016-11-18[tests] remove test_sync_deferredVictor Shyba
Deferred encryption option is gone.
2016-11-18[feature] Adds back support to deprecated cryptoVictor Shyba
Will be removed when we have the proper tool to migrate data.
2016-11-18[tests] remove test_sync_very_large_filesVictor Shyba
We have benchmarks now to test sync limits and 100mb is too far from current needs.
2016-11-18[tests] improve doc creation on benchmarksVictor Shyba
If we create all at once we cant test higher loads because it will try to hold all in memory at the same time. Also, this code is smaller and more readable.
2016-11-18[tests] fall back to TestCase classesVictor Shyba
This test was using pytest, but it was making other trial based tests fail. I couldn't figure out why, but falling back to TestCase solved it.
2016-11-18[refactor] stop using leap.common.httpVictor Shyba
We aren't using leap.common.http implementation and we need specific features from original Twisted Web Agent. This commit implements it on HTTP Targer.
2016-11-18[bug] total number of documentsVictor Shyba
Parsing from metadata we can store the total of docs and handle it for the doc parser in order to be able to keep consistent events info.
2016-11-18[test] fix test and remove leftovers defer_encryptionVictor Shyba
2016-11-18[bug] fix importKali Kaneko
2016-11-18[refactor] remove lingering refs to syncdbKali Kaneko
2016-11-18[tests] adapt testsKali Kaneko
2016-11-18[refactor] add SoledadCrypto interfaceKali Kaneko
2016-11-18[feature] blob encryptor / decryptorKali Kaneko
2016-11-18[refactor] remove encryption poolKali Kaneko
2016-11-18[feature] upload streamingVictor Shyba
1) enable HTTP 1.1 chunked upload on server 2) make the client sync.py generate a list of function calls instead of a list of full docs 3) disable encryption pool 4) make the doc encryption a list of function calls 5) create a twisted protocol for sending 6) make a producer that calls the doc generation as necessary
2016-11-18[feature] streaming download protocolVictor Shyba
This commit finishes reversion into u1db original streaming protocol for downloads.
2016-11-18[refactor] remove decpoolVictor Shyba
It's not being used
2016-11-18[bug] disable decpoolVictor Shyba
Temporary fix for server streaming
2016-10-21[tests] make check_schema_versions default to FalseVictor Shyba
CouchServerState is spread across test codebase and this option is intended to be used only on server startup. This commit makes it default to False and explicitly set it to True on where it's necessary.
2016-10-21[tests] specify basepython on root envVictor Shyba
code-check is running with py3 randomly on CI, this commit should pin it.
2016-10-03[feature] check for user dbs couch schema versionsdrebs
2016-09-30[test] add flake8 code check and generalize name of tox envdrebs
2016-09-30[test] use pytest tmpdir fixture in all testsdrebs
Tests that were imported from u1db or created on top of that structure were leaving temporary directories behind. This could cause problems in test servers, either by filling the partition or by extrapolating the maximum amount of files in a directory. This commit replaces all usages of temporary directories in the old test structure by pytest tmpdir fixture, which properly cares for removing temporary directories.
2016-09-09[test] add tagged perf job for gitlab-cidrebs
In order to configure performance tests to run in a specific machine we need to add a tagged job to .gitlab-ci.yml file. That job will only execute the perf tests, and then we can have runners that will only run those jobs.
2016-09-06[test] add tox env for perf testsdrebs
2016-09-02[tests] add pep8 in main tox run from within the gitlab scriptKali Kaneko
add coverage reports too. (hereby we swear not to write stupid tests just because it feels good to have an increased coverage metric). - Resolves: #8416
2016-08-29[test] randomize payloadVictor Shyba
We were using 'x'*size as payload, but on real usage the payload will be random. This commit randomizes the payload using a predefined seed, so the random payload will be the same across benchmarks. Using random payloads also improves accuracy of compression or encoding impacts and we will be evaluating those changes for resouce usage issues. Also note that base64 is used on payload. That was needed for utf8 safety, but overhead was removed to leave payloads as defined by benchmarks. Base64 was chosen also due its popular usage on MIME encoding, which is used on mail attachments (our current scenario).