diff --git a/docs/tasks.md b/docs/tasks.md index 735221d..dacfa3a 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -127,6 +127,7 @@ container's `/etc/hosts` file; the keys are the hostnames, and the values are the IP addresses; * `sysctls`: a dictionary of kernel sysctl parameters to add to the container; keys are the names of the kernel parameters and values are their values; +* `working_dir`: can be used to overwrite the default working_dir of the image; You can find the specific settings for each task type in their corresponding file in the [tasks](tasks) directory. diff --git a/docs/tasks/sipp.md b/docs/tasks/sipp.md index be78600..ea1915e 100644 --- a/docs/tasks/sipp.md +++ b/docs/tasks/sipp.md @@ -42,7 +42,9 @@ usually `sipp` (see `sipp -s` parameter for more information). added to the `keys` dictionary as well, but the default value is the name of the SIPssert scenario -## Example +## Examples + +### SIPp scenario with config_file Execute a sipp scenario defined in the `cancel.xml` file, with a domain key: @@ -53,3 +55,30 @@ Execute a sipp scenario defined in the `cancel.xml` file, with a domain key: keys: domain: opensips.org ``` + +### SIPp with TLS transport + +When using TLS transport, SIPp will expect to have two files in the current directory: a certificate (cacert.pem) and a key (cakey.pem). If one is protected with a password, SIPp will ask for it. + +Create a docker volume and place the certificate files in it. +Mount volume with certificates to the container and setup working_dir to that folder. +Specify in the args to use the TLS transport with options "-t l1". + +``` +tasks: +... + - name: tls client + type sipp + config_file: invite.xml + working_dir: /certs + args: "-t l1" + volumes: + - sipp-certs +... + +volumes: + sipp-certs: + bind: /certs + mode: ro + +``` \ No newline at end of file diff --git a/sipssert/task.py b/sipssert/task.py index 1ec8cee..dc5b7a7 100644 --- a/sipssert/task.py +++ b/sipssert/task.py @@ -59,6 +59,7 @@ def __init__(self, test_dir, configuration): self.checklogs = self.get_checklogs() self.extra_hosts = self.config.get("extra_hosts", {}) self.sysctls = self.config.get("sysctls", {}) + self.working_dir = self.config.get("working_dir") self.deps = dependencies.parse_dependencies(self.config.get("require")) # keep this for backwards compatibility self.delay_start = self.config.get("delay_start", 0) @@ -171,6 +172,7 @@ def create(self, controller, prefix=None): 'stop_signal': self.stop_signal, 'network_mode': self.host_network, 'extra_hosts': self.extra_hosts, + 'working_dir': self.working_dir, 'sysctls': self.sysctls }