Skip to content

Commit aa9cc09

Browse files
committed
Update READEME.md to include test scenario passed
via extra-vars
1 parent 50dee14 commit aa9cc09

1 file changed

Lines changed: 28 additions & 5 deletions

File tree

roles/telemetry_chargeback/README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Role Variables
5151
| `openstackpod` | `"openstackclient"` | OpenStack client pod name for exec/cp operations |
5252
| `lookback` | `6` | Days to look back for Loki query time range |
5353
| `limit` | `50` | Limit for Loki query results |
54+
| `cloudkitty_test_scenarios` | `["test_static.yml", "test_dyn_basic.yml"]` | List of test scenario files to run (can be overridden via extra-vars) |
5455

5556
How It Works
5657
------------
@@ -67,8 +68,9 @@ The role executes the following workflow:
6768
- Retrieves certificates from secrets/configmaps
6869
- Configures Loki push/query URLs
6970

70-
3. **Test Scenario Discovery**
71-
- Automatically finds all `test_*.yml` files in `files/` directory
71+
3. **Test Scenario Selection**
72+
- Uses scenarios defined in `cloudkitty_test_scenarios` variable
73+
- Can be overridden via extra-vars to run specific scenarios
7274

7375
4. **Scenario Execution Loop** (for each discovered scenario)
7476
- Generates synthetic Loki log data (`gen_synth_loki_data.py`)
@@ -204,7 +206,7 @@ When `--debug` is enabled, the script writes a `<stem>_diff.txt` file containing
204206
Scenario Configuration
205207
----------------------
206208

207-
Test scenarios are defined in YAML files located in the `files/` directory. Any file matching the pattern `test_*.yml` will be automatically discovered and executed.
209+
Test scenarios are defined in YAML files located in the `files/` directory. The scenarios to run are specified by the `cloudkitty_test_scenarios` variable.
208210

209211
### Available Scenarios
210212

@@ -265,7 +267,7 @@ This role has no direct hard dependencies on other Ansible roles.
265267
Example Playbook
266268
----------------
267269

268-
**Basic usage (auto-discover scenarios):**
270+
**Basic usage (runs default scenarios):**
269271
```yaml
270272
- name: "Run chargeback tests"
271273
hosts: controllers
@@ -293,6 +295,27 @@ Example Playbook
293295
lookback: 10
294296
```
295297

298+
**Run specific test scenarios:**
299+
```yaml
300+
- name: "Run chargeback tests with specific scenarios"
301+
hosts: controllers
302+
gather_facts: false
303+
304+
tasks:
305+
- name: "Run chargeback validation with custom scenarios"
306+
ansible.builtin.import_role:
307+
name: telemetry_chargeback
308+
vars:
309+
cloudkitty_test_scenarios:
310+
- "test_static.yml"
311+
```
312+
313+
**Run custom scenarios via extra-vars:**
314+
```bash
315+
ansible-playbook playbook.yml \
316+
-e '{"cloudkitty_test_scenarios": ["test_static.yml", "test_custom.yml"]}'
317+
```
318+
296319
License
297320
-------
298321

@@ -303,5 +326,5 @@ Author Information
303326

304327
Alex Yefimov, Red Hat
305328

306-
**Project:** RHOSO (Red Hat OpenStack Services on OpenShift)
329+
**Project:** RHOSO (Red Hat OpenStack Services on OpenShift)
307330
**Component:** Telemetry - CloudKitty Chargeback

0 commit comments

Comments
 (0)