Skip to content

Commit 67e5181

Browse files
rybushkindmitryDmitry Rybushkin
andauthored
Task add working dir feature (#52)
* task: add working_dir feature * fix * add example for sipp with tls transport --------- Co-authored-by: Dmitry Rybushkin <[email protected]>
1 parent 033f5dc commit 67e5181

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

docs/tasks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ container's `/etc/hosts` file; the keys are the hostnames, and the values
127127
are the IP addresses;
128128
* `sysctls`: a dictionary of kernel sysctl parameters to add to the container;
129129
keys are the names of the kernel parameters and values are their values;
130+
* `working_dir`: can be used to overwrite the default working_dir of the image;
130131

131132
You can find the specific settings for each task type in their corresponding
132133
file in the [tasks](tasks) directory.

docs/tasks/sipp.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ usually `sipp` (see `sipp -s` parameter for more information).
4242
added to the `keys` dictionary as well, but the default value is the name of
4343
the SIPssert scenario
4444

45-
## Example
45+
## Examples
46+
47+
### SIPp scenario with config_file
4648

4749
Execute a sipp scenario defined in the `cancel.xml` file, with a domain key:
4850

@@ -53,3 +55,30 @@ Execute a sipp scenario defined in the `cancel.xml` file, with a domain key:
5355
keys:
5456
domain: opensips.org
5557
```
58+
59+
### SIPp with TLS transport
60+
61+
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.
62+
63+
Create a docker volume and place the certificate files in it.
64+
Mount volume with certificates to the container and setup working_dir to that folder.
65+
Specify in the args to use the TLS transport with options "-t l1".
66+
67+
```
68+
tasks:
69+
...
70+
- name: tls client
71+
type sipp
72+
config_file: invite.xml
73+
working_dir: /certs
74+
args: "-t l1"
75+
volumes:
76+
- sipp-certs
77+
...
78+
79+
volumes:
80+
sipp-certs:
81+
bind: /certs
82+
mode: ro
83+
84+
```

sipssert/task.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __init__(self, test_dir, configuration):
5959
self.checklogs = self.get_checklogs()
6060
self.extra_hosts = self.config.get("extra_hosts", {})
6161
self.sysctls = self.config.get("sysctls", {})
62+
self.working_dir = self.config.get("working_dir")
6263
self.deps = dependencies.parse_dependencies(self.config.get("require"))
6364
# keep this for backwards compatibility
6465
self.delay_start = self.config.get("delay_start", 0)
@@ -171,6 +172,7 @@ def create(self, controller, prefix=None):
171172
'stop_signal': self.stop_signal,
172173
'network_mode': self.host_network,
173174
'extra_hosts': self.extra_hosts,
175+
'working_dir': self.working_dir,
174176
'sysctls': self.sysctls
175177
}
176178

0 commit comments

Comments
 (0)