cfn-guard-test is a wrapper for cfn-guard that allows you to run unit tests for your cfn-guard rules.
Project description
cfn-guard-test
This tool allows you to easily run your cfn-guard tests against your cfn-guard rules.
cfn-guard-test
is a tool that converts various reports into the JUnit format.
Installation
You can install the cfn-guard-test
tool by running the following command:
pip install cfn_guard_test
Installation in venv
Typically, you would want to run your dependencies isolated. You can install cfn-guard-test in a venv
using the following commands:
python -m venv .venv
source .venv/bin/activate
pip install cfn_guard_test
Alternative installation: Docker
Build the docker image
docker build -t cfn-guard-test-docker .
Docker usage
Run the cfn-guard-test
command as follows
docker run --rm -it -v `pwd`:/tests cfn-guard-test-docker cfn-guard-test
Usage
To use cfn-guard-test
you just execute the following command:
cfn-guard-test
This will (by default) look for a test file in tests/reports
and it there is a yaml file that matches the same name in
the reports
folder. It will then validate the rules defined in the reports
folder against the test definition.
You can get a more verbose output if you add one of the following commands:
cfn-guard-test -v
cfn-guard-test --verbose
If you use a different folder structure you can define the rules and test paths as followed:
cfn-guard-test \
--rules-path reports \
--test-path tests/reports
When you do not have the cfn-guard
binary installed, and you need to supply an alternative path you can do that with
the following command:
cfn-guard-test \
--cfn-guard-path "/my/custom/path/cfn-guard"
Generate a JUnit XML Report
You can generate a JUnit XML Report using the --junit-path
option. Once given it will generate a JUnit XML compatible
report at the given location. Example:
cfn-guard-test \
--junit-path "reports/cfn-guard.xml"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cfn-guard-test-0.4.1.tar.gz
.
File metadata
- Download URL: cfn-guard-test-0.4.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e729f92e585893c993110376543bcfe69eb455a391d97104e553961d5788a960 |
|
MD5 | 6525f97689652c0b99f65ec090378a97 |
|
BLAKE2b-256 | 2553e2361f7c0b488e9cd440a0f60bc8723ef50b908eb574318127c6b77ffb66 |