Add tests for Python code #51

Merged
pfm merged 14 commits from 39-add-tests into master 2022-01-10 18:10:01 +01:00
Collaborator
  • Provide a script to feed Mailgate with input messages and check the output.
  • Explain testing basics.
  • Set up 3 identities: cleartext, RSA and Ed25519.

This addresses #39.

- Provide a script to feed Mailgate with input messages and check the output. - Explain testing basics. - Set up 3 identities: cleartext, RSA and Ed25519. This addresses #39.
pfm added 10 commits 2022-01-07 12:12:58 +01:00
a9506805fb Write a test mail relay
Provide a simple Python script that would linsten on a given port and print to
standard output any message received via SMTP on that port.

This script will then be used to automatically test gpg-mailgate with different
scenarios (unknown recipient key, RSA key, elliptic curve key).
27d7481078 Set up ground for E2E tests
- Use an environment variable to point at the configuration file while
  strating gpg-mailgate.py.

- Unify paths: store temporary config, logs and anything else under 'test'
  directory.

- Configure more tests (RSA, Ed25519).

- Add test descriptions to be shown before they're started.
f1a799d864 Adjust E2E tests to work with all scenarios
Since it's not so easy to encrypt a message exactly the same way twice, we
only verify if the message has been encrypted or not.

Introduce minor changes to the library itself, because it doesn't work very
well with modern GnuPG.

Also, include GnuPG directory (pointed at by --homedir option).
ff3f6aa793 Add a test overview, extract constants
To let the user know that tests produce logs, include a message at the end of
the test output informing about locations of E2E and Mailgate logs.

Also, extract some constants.
pfm added 1 commit 2022-01-08 13:44:21 +01:00
fc2779ef7d Improve test code structure
- Move things to configuration file where appropriate (logging format, etc.).

- Rework execute_e2e_test signature to simplify it and get rid of keyword
arguments.

- Simplify output.

- Include a header comment in configuration file.
muppeth was assigned by pfm 2022-01-08 13:44:45 +01:00
Author
Collaborator

Hi @muppeth, please take a look if the tests work on your machine and if so, consider accepting the change.

Hi @muppeth, please take a look if the tests work on your machine and if so, consider accepting the change.
pfm added 1 commit 2022-01-09 21:39:20 +01:00
2cf60dec40 Add unit tests for GnuPG command-line generator
Extract a function to calculate GPG commands to be executed and cover it with
unit tests.
pfm added 1 commit 2022-01-09 22:00:47 +01:00
1002da78fa Clean up test messages
Remove unused msgout files, fix addresses in msgin files.
muppeth approved these changes 2022-01-10 15:34:19 +01:00
@ -29,0 +29,4 @@
# GPG-Mailgate test files
test/logs
test/tmp
test/gpg-mailgate.conf
Owner

shouldn't we also have test/keyhome/random_seed?

shouldn't we also have `test/keyhome/random_seed`?
Author
Collaborator

You're right - I've fixed that in the newest commit.

You're right - I've fixed that in the newest commit.
pfm added 1 commit 2022-01-10 17:48:08 +01:00
3b9f714cdb Ignore random_seed
Do not keep test/keyhome/random_seed in repository.
pfm merged commit ee0d65f6bb into master 2022-01-10 18:10:01 +01:00
pfm deleted branch 39-add-tests 2022-01-10 18:10:01 +01:00
Sign in to join this conversation.
No description provided.