Skip to content

Commit

Permalink
Export scenario name in SIPP tasks. (#25)
Browse files Browse the repository at this point in the history
* Export scenario name in SIPP tasks.

* Get scenario name from test_dir in SIPP task.

* Add documentation for "scenario" setting for SIPP tasks.
  • Loading branch information
dariusstefan authored Aug 6, 2024
1 parent 1d4ea60 commit aaef3ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/tasks/sipp.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ scenario (see `sipp -d` parameter for more information).
scenario runs in UAS mode
* `service`: the destination service used to test; optional, default value is
usually `sipp` (see `sipp -s` parameter for more information).
* `scenario`: a variable that can be used in XML scenario files; it can be
added to the `keys` dictionary as well, but the default value is the name of
the SIPssert scenario

## Example

Expand Down
5 changes: 5 additions & 0 deletions sipssert/tasks/sipp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def __init__(self, test_dir, config):
if self.port:
self.port, _ = self.parse_port(self.port)
self.keys = config.get("keys", {})
if "scenario" not in self.keys:
self.scenario = config.get("scenario", None)
if not self.scenario:
self.scenario = os.path.basename(self.test_dir)
self.keys["scenario"] = self.scenario
self.calls = config.get("calls", "1")
self.duration = str(config.get("duration", "5000"))
self.proxy = config.get("proxy", None)
Expand Down

0 comments on commit aaef3ca

Please sign in to comment.