MatrixAI / js-encryptedfs

Encrypted Filesystem for TypeScript/JavaScript Applications
https://polykey.com
Apache License 2.0
10 stars 3 forks source link

Unit testing the EFS API #3

Closed MeanMangosteen closed 5 years ago

MeanMangosteen commented 5 years ago

Each method exposed by EncryptedFS should be unit tested to ensure the expected behaviour of the method is met. This allows all changes made to the code base to be tested against the test suite to ensure there are no breaking changes in the updates.

As of now, the units test are constructed using ava tests.

MeanMangosteen commented 5 years ago

All implemented methods in EFS till date have preliminary tests testing basic functionality, though more rigorous testing is needed for boundary/edge cases.

The Cryptor module utilises Python's cryptography library to generate dynamic test vectors to test the validity of its ciphering. It currently spawns a child process to run the a python script passing options through cmd args. This also includes the data to be [en|de]crypted. For cipher payloads of several block an E2BIG error is thrown. So to rigorously test its ciphering capabilities with large payloads (>100 blocks), more sophisticated IPC measures needs to be taken, e.g use of sockets

CMCDragonkai commented 5 years ago

This is done for now, we'll assume we do unit tests for each new feature from now on.