/
test_rw.yaml
95 lines (81 loc) · 2.53 KB
/
test_rw.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
file_version: stressor#0
# The run configuration defines how the `sequences` are executed in parallel
# sessions.
config:
name: Test WebDAV
# tag: Not set (pass `-o tag:TAG_NAME` to override)
details: |
This scenario runs some tests against a WebDAV server.
We use it to test stressor against a locally running WsgiDAV server:
- Open a terminal and run
$ wsgidav --root tests/stressor/htdocs --host 127.0.0.1 --port 8082 --auth anonymous --no-config
- Open a second terminal and run
$ stressor run tests/stressor/test_rw -q
verbose: 3
base_url: http://127.0.0.1:8082
# base_url: https://127.0.0.1:8082
request_timeout: 1
# Initial context value definitions.
# All used parameters must be listed here in the form:
# parameter_name: default_value
# Set `null` value to make it mandatory, i.e. must be passed by caller.
context:
sessions:
users: $load(users.yaml)
count: 10
# basic_auth: true
verify_ssl: false
# Define what actions should be performed by every session
scenario:
- sequence: init
- sequence: main
# repeat: 3
duration: 30
- sequence: end
# List of named action sequences. Used as building blocks for scenarios
sequences:
# 'init' is the reserved name for the set-up sequence.
init:
# Log-in
- activity: HTTPRequest
url: /
method: OPTIONS
assert_match_headers: ".*'DAV'.*"
- activity: GetRequest
url: /mock_login_response.json
assert_json:
result.user_guid: "{abc123}"
store_json:
user_guid: "result.user_guid"
# - activity: $debug()
# Other sections can have arbitrary names and are executed in order of appearance
main:
# Test dirbrowser for root URL
- activity: GetRequest
url: /
assert_match: ".*Index of /.*"
assert_html:
"//*[@class='logo']": true
# Plain GET (all sessions read the same file)
- activity: GetRequest
url: /private/test.html
auth: $(user.auth)
# assert_match: ".*Secret text.*"
monitor: true
# debug: true
# PUT + GET (all sessions create their own file)
- activity: PutRequest
url: /temp/wsgidav_test_file~$(session_id).txt
data: "Test"
assert_max_time: 0.5
monitor: true
# debug: true
- activity: GetRequest
url: /temp/wsgidav_test_file~$(session_id).txt
assert_match: "Test"
monitor: true
# 'end' is the reserved name for the tear-down sequence
end:
- activity: $sleep(0.1)
- activity: DeleteRequest
url: /temp/wsgidav_test_file~$(session_id).txt