2015-12-04 08:10:44 -05:00
# letstest
2017-09-19 13:25:36 -04:00
Simple AWS testfarm scripts for certbot client testing
2015-12-04 09:32:24 -05:00
- Launches EC2 instances with a given list of AMIs for different distros
2016-04-14 20:10:27 -04:00
- Copies certbot repo and puts it on the instances
- Runs certbot tests (bash scripts) on all of these
2015-12-04 09:32:24 -05:00
- Logs execution and success/fail for debugging
## Notes
- Some AWS images, e.g. official CentOS and FreeBSD images
require acceptance of user terms on the AWS marketplace
website. This can't be automated.
- AWS EC2 has a default limit of 20 t2/t1 instances, if more
are needed, they need to be requested via online webform.
2019-05-17 04:41:11 -04:00
## Installation and configuration
2017-09-19 13:25:36 -04:00
2021-05-03 20:42:30 -04:00
This package is installed in the Certbot development environment that is
created by following the instructions at
https://certbot.eff.org/docs/contributing.html#running-a-local-copy-of-the-client.
2022-11-16 20:10:18 -05:00
These tests use the AWS SDK for Python (boto3) to manipulate EC2 instances.
Before running the tests, you'll need to set up credentials by following the
instructions at
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration.
You will also want to create a `~/.aws/config` file setting the region for your
profile to `us-east-1` , following the instructions in the boto3 quickstart guide above.
2017-09-19 13:25:36 -04:00
2022-11-16 20:10:18 -05:00
Lastly, you will want to create a file on your system containing a trusted SSH key
by following the instructions at
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html.
2017-09-19 13:25:36 -04:00
2019-05-17 04:41:11 -04:00
## Usage
2021-05-03 20:42:30 -04:00
To run tests, activate the virtual environment you created above and from this directory run:
2015-12-04 09:32:24 -05:00
```
2021-05-03 20:42:30 -04:00
>letstest targets/targets.yaml /path/to/your/key.pem < profile name > scripts/< test to run >
2017-09-19 13:25:36 -04:00
```
2021-05-03 20:42:30 -04:00
A temporary directory whose name is output by the tests is also created with a log file from each instance of the test and a file named "results" containing the output above.
2017-09-19 13:25:36 -04:00
The tests take quite a while to run.
2015-12-10 09:44:07 -05:00
## Scripts
2017-09-19 13:25:36 -04:00
Example scripts are in the 'scripts' directory, these are just bash scripts that have a few parameters passed
2015-12-10 09:40:20 -05:00
to them at runtime via environment variables. test_apache2.sh is a useful reference.
2021-04-27 18:27:21 -04:00
test_apache2 runs the dev venv and does local tests.
2015-12-10 09:44:07 -05:00
2017-09-19 13:25:36 -04:00
See:
2015-12-09 19:52:02 -05:00
- https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
- https://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html
2015-12-04 09:32:24 -05:00
2017-09-19 13:25:36 -04:00
Main repos:
2023-06-07 20:27:28 -04:00
- https://github.com/certbot/certbot