Skip to content

Commit fa5ab23

Browse files
committed
tests: clarify variables directive in README.md
1 parent 370a947 commit fa5ab23

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

tests/README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ The header consists of comments (starting by `#`). Possible keys are:
179179
restricted. Use this only if the scenario makes sense only in a specific
180180
profile. Typically, a rule doesn't depend on a profile and behaves the same
181181
way regardless the profile it's a part of. If the rule is parametrized by
182-
variables (XCCDF Values), use the `variables` key instead. This key is
182+
variables (XCCDF `<Value>` elements), use the `variables` key instead. This key is
183183
intended to be used in regression testing of bugs in profiles, it isn't
184184
intended for casual use.
185185
- `check` is a string specifying one of the available check engine types
@@ -193,11 +193,16 @@ The header consists of comments (starting by `#`). Possible keys are:
193193
scenario would break test runs, because OpenSCAP generates reports into the
194194
/tmp directory).
195195
- `templates` has no effect at the moment.
196-
- `variables` is a comma-separated list of XCCDF values that sets a different
197-
default value for XCCDF variables in a form `<variable name>=<value>`.
198-
Typically, you use only one of `profile` or `variables` in scenario metadata -
199-
default values are effective only if the variable is not defined using a
200-
selector, which is exactly what profiles do.
196+
- `variables` overrides the default value of XCCDF `<Value>` elements
197+
in the data stream:
198+
- Comma-separated, in the form `<variable name>=<value>`
199+
- The variable must already exist as a `<Value>` element in the
200+
data stream
201+
- Use the actual value (e.g. `no|delayed`), not the option name
202+
from the `.var` file (e.g. `stig`)
203+
- Do not combine with `profile` in the same scenario -- the profile
204+
selects variable values on its own, overriding the `variables`
205+
directive
201206

202207
Examples of test scenario:
203208

@@ -211,7 +216,7 @@ Using `platform` and `variables` metadata:
211216
echo "KerberosAuthentication $auth_enabled" >> /etc/ssh/sshd_config
212217
```
213218

214-
### Augmenting using Jinja macros
219+
### Augmenting using Jinja macros
215220

216221
Each scenario script is processed under the same jinja context as the
217222
corresponding OVAL and remediation content. This means that product-specific

0 commit comments

Comments
 (0)