summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2025-01-21 14:44:00 +0100
committerSebastian Holmin <sebastian.holmin@mullvad.net>2025-01-22 13:32:09 +0100
commite7743d9e71f602e39345075773afa6a4b2263bb6 (patch)
treecaa491429e17139dd690d1d537388083868d2551 /test
parentdea8be7d42d4da67b61f70bb5cc44f3022e51118 (diff)
downloadmullvadvpn-e7743d9e71f602e39345075773afa6a4b2263bb6.tar.xz
mullvadvpn-e7743d9e71f602e39345075773afa6a4b2263bb6.zip
Document per-test-relay-selection feature in `docs/`
Small update to docs
Diffstat (limited to 'test')
-rw-r--r--test/test-manager/docs/config.md50
1 files changed, 40 insertions, 10 deletions
diff --git a/test/test-manager/docs/config.md b/test/test-manager/docs/config.md
index 8c4db7fce4..09d4f110ce 100644
--- a/test/test-manager/docs/config.md
+++ b/test/test-manager/docs/config.md
@@ -2,39 +2,68 @@
This document outlines the format of the configuration used by `test-manager` to perform end-to-end tests in virtualized environments.
-# Format
+## Format
+
+The configuration is a JSON document with three values:
-The configuration is a JSON document with two values:
```json
{
"mullvad_host": <optional string>,
- "vms": <document>
+ "vms": <document>,
+ "test_locations": [ {"test_name": ["relay"] }, .. ],
}
```
The configurable values are prone to change, and for the time being it is probably a good idea to get acquainted with the [Rust struct called "Config"](../src/config.rs) from which the configuration is serialized.
-To get started, `test-manager` provides the `test-manager set` command to add and edit VM configurations.
+To get started, `test-manager` provides the `test-manager config vm set` command to add and edit VM configurations.
It is also recommended to view the [example section](#Examples) further down this document.
-# Location
+## Location
The configuration is assumed to exist in `$XDG_CONFIG_HOME/mullvad-test/config.json` (most likely `$HOME/.config/mullvad-test/config.json`) on Linux and `$HOME/Library/Application Support/mullvad-test/config.json` on macOS.
-# Examples
+## Per-test relay selection
+
+It is possible to configure which relay(s) should be selected on a test-per-test basis by providing the `test_locations`
+configuration option. If no explicit configuration is given, no assumption will be made from within the tests themselves.
+
+The format is a list of maps with a single key-value pair, where the key is a [glob pattern](<https://en.wikipedia.org/wiki/Glob_(programming)>)
+that will be matched against the test name, and the value is a list of locations to use for the matching tests.
+The name of the locations are the same as for the `mullvad relay set location` CLI-command.
+
+### Example
+
+```json
+{
+ // other fields
+ "test_locations": [
+ { "*daita*": ["se-got-wg-001", "se-got-wg-002"] },
+ { "*": ["se"] }
+ ]
+}
+```
+
+The above example will set the locations for the test `test_daita` to a custom list
+containing `se-got-wg-001` and `se-got-wg-002`. The `*` is a wildcard that will match
+any test name. The configuration is read from top-to-bottom, and the first match will be used.
+
+## Example configurations
-## Minimal
+### Minimal
The minimal valid configuration does not contain any virtual machines
+
```json
{
- "mullvad_host": "stagemole.eu",
- "vms": { }
+ "mullvad_host": "stagemole.eu",
+ "vms": {}
}
```
-## Complete
+### Complete
A configuration containing one Debian 12 VM and one Windows 11 VM
+
```json
{
"mullvad_host": "stagemole.eu",
@@ -68,5 +97,6 @@ A configuration containing one Debian 12 VM and one Windows 11 VM
"tpm": false
}
}
+ }
}
```