-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmdprobe.yaml
85 lines (75 loc) · 2 KB
/
cmdprobe.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
---
test_name: curl json check
stages:
- name: hit the endpoint and validate+save some json
# max_retries: 3
check: 'curl http://localhost/json'
matchers:
- json:
slideshow:
slides:
- title: "Wake up to WonderWidgets!"
save:
author: slideshow.slides[0].title
- name: send the author as a header
# max_retries: 3
check: 'curl http://localhost/headers -H "Author: {{ author }}"'
matchers:
- json:
headers:
Author: "{{ author }}"
---
test_name: curl regex check
stages:
- name: find the path
max_retries: 3
check: 'curl http://localhost/robots.txt'
matchers:
- regex: 'Disallow: (?P<path>\S*)'
- name: hit the path with numbered capture group
max_retries: 3
check: 'curl http://localhost/{{ 1 }}'
matchers:
- regex: "(YOU SHOULDN'T BE HERE)"
- name: hit the path with named capture group and use previous numbered group in matcher
max_retries: 3
check: 'curl http://localhost/{{ path }}'
matchers:
- regex: "{{ 1 }}"
---
test_name: json save without matcher test
stages:
- name: request the anything page and save a value
check: 'curl http://localhost/anything'
matchers:
- save:
example: headers."user-agent"
- name: insert the agent into the query string
check: 'curl http://localhost/anything?agent={{example}}'
matchers:
- json:
args:
agent: "{{example}}"
---
test_name: http request test
stages:
- name: hit the anything endpoint using http
check:
url: http:/localhost/anything
method: GET
headers:
foo: bar
matchers:
- json:
headers:
Foo: bar
- name: hit the json endpoint and evaluate using jmespath
check:
url: http:/localhost/json
method: GET
headers:
foo: bar
matchers:
- jmespath: slideshow.slides[1].items[0]
operation: eq
value: "Why <em>WonderWidgets</em> are great"