I'm trying to write a taurus test in .yml that will include multiple scenarios (like ping host request, change hostname on machine, install java,..). Every scenario has a request that is an API call, with url, POST method and body.
Problem 1:
Every scenario should be developed in a separate files, and tests should be called this way: "bzt scenario_1.yml scenario_2.yml,...".
Is there a solution like include_scenario, import?
For example in Ansible there is include_tasks, so I can just call other .yml scripts and everything works great.
Problem 2:
How can I create some kind of loop for body, so that my API request will use different parameters for each distribution. Cause I'm trying to write a test with high concurrency that will for example ping, change hostname and install Java for Ubuntu, Debian, Centos,..
Current code sample:
---
execution:
- iterations: 2
concurrency: 1000
ramp-up: 20m
scenarios:
ping:
requests:
- url: http://127.0.0.1:12121/ping/
method: POST
label: ping
body-file: ./vars/"{{ping}}"
headers:
Content-Type: application/json
parameters:
- /debian/ping.json
- /ubuntu/ping.json
- /centos7/ping.json
changeHostname:
requests:
- url: http://127.0.0.1:12121/changeHostname/
method: POST
label: ping
body-file: ./vars/"{{change_hostname}}"
headers:
Content-Type: application/json
parameters:
- /debian/hostnameDto.json
- /ubuntu/hostnameDto.json
- /centos7/hostnameDto.json
changeRootPassword:
requests:
- url: http://127.0.0.1:12121/changeRootPassword/
method: POST
label: ping
body-file: ./varss/"{{change_root_password}}"
headers:
Content-Type: application/json
parameters:
- /debian/changeRootPasswordDto.json
- /ubuntu/changeRootPasswordDto.json
- /centos7/changeRootPasswordDto.json
reporting:
- module: console
- module: final-stats
settings:
check-interval: 5s
default-executor: jmeter
provisioning: local
Thank you.
There is a setting in YAML to include other config files:
http://gettaurus.org/docs/ConfigSyntax/#Included-Configs