-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f249db6
commit 06ced84
Showing
3 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Tests | ||
|
||
## Tester dependencies | ||
|
||
```bash | ||
python3 -m pip install -r requirements_test.txt | ||
``` | ||
|
||
## Firewall dependencies | ||
|
||
The Firewall used for testing should be a dedicated VM for testing. You can use the official [ova image](https://docs.opnsense.org/manual/how-tos/installova.html). | ||
|
||
**THE TESTS WILL OVERRIDE THE EXISTING CONFIG!** | ||
|
||
Most tests fail if some other config is found. | ||
|
||
### Packages | ||
|
||
Some tests need packages to be pre-installed: | ||
|
||
* rule* - `os-firewall` | ||
* wireguard_* - `os-wireguard` | ||
* frr_* - `os-frr` | ||
* bind_* - `os-bind` | ||
|
||
### Interfaces | ||
|
||
Some tests benefit from having a second network-interface available. | ||
|
||
You need to add a `opt1` dummy-interface named `TEST`. The assigned IPs do not matter. | ||
|
||
### Internet access | ||
|
||
To perform some tests (package/firmware, ids) the test firewall needs to reach some public service: | ||
|
||
* package/firmware - `pkg.opnsense.org` | ||
* ids - `rules.emergingthreats.net` | ||
|
||
---- | ||
|
||
## Run | ||
|
||
### Single module | ||
|
||
```bash | ||
bash scripts/test_single.sh | ||
> Arguments: | ||
> 1: firewall | ||
> 2: api key file | ||
> 3: path to local collection - set to '0' to clone from github | ||
> 4: name of test to run | ||
> 5: if check-mode should be ran (optional; 0/1; default=1) | ||
> 6: path to virtual environment (optional) | ||
``` | ||
### All modules | ||
```bash | ||
bash scripts/test.sh | ||
> Arguments: | ||
> 1: firewall | ||
> 2: api key file | ||
> 3: path to local collection - set to '0' to clone from github | ||
> 4: path to virtual environment (optional) | ||
``` | ||
---- | ||
## Logs of automatic tests | ||
The tests are run automatically using the [AnsibleGuy infrastructure](https://github.com/ansibleguy/_meta_cicd)! | ||
Logs for those functional tests can be found here: [Short](https://badges.ansibleguy.net/log/collection_opnsense_test_short.log), [Full](https://badges.ansibleguy.net/log/collection_opnsense_test.log) |
This file was deleted.
Oops, something went wrong.