aws / aws-nitro-enclaves-cli

Tooling for Nitro Enclave Management
Apache License 2.0
116 stars 78 forks source link

scripts/run_tests.sh: Add check dependencies #625

Closed foersleo closed 1 month ago

foersleo commented 1 month ago

Issue #, if available: -

Description of changes:

scripts/run_tests.sh: Add check dependencies

Check that all the dependencies to run the test script are in place and bail out early before spending time on needless work.

The dependencies are:
* running as root
* docker has to function
* pytest-3 needs to be installed

When testing builds for https://github.com/aws/aws-nitro-enclaves-sdk-bootstrap/pull/28 I struggled through some hardships with the dependencies needed to run the test scripts. Let's make this easier for the next person by bailing out early if dependencies are not met.

Testing done:

Tested all cases starting from a vanilla Ubuntu instance running without root privileges, adding another dependency with each iteration.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.