File: macro.htt

package info (click to toggle)
httest 2.4.23-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,876 kB
  • sloc: ansic: 19,553; sh: 10,550; xml: 1,047; makefile: 510; lisp: 145; perl: 31
file content (86 lines) | stat: -rw-r--r-- 1,532 bytes parent folder | download | duplicates (7)
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
INCLUDE $TOP/test/config.htb
INCLUDE $TOP/macros/simple_request.htb
INCLUDE $TOP/macros/simple_urlenc.htb
INCLUDE $TOP/macros/simple_multipart.htb

CLIENT
_USE SIMPLE
_AUTO_COOKIE on
_GET http://$YOUR_HOST:$YOUR_PORT/bla/fasel HTTP/1.1
_EXPECT . "AS2"
_WAIT

_POST http://$YOUR_HOST:$YOUR_PORT/bla/bla HTTP/1.1
_FORM_URLENC MY 
_FORM_URLENC_ARG $MY hallo velo MY
_FORM_URLENC_ARG $MY hallo2 "velo2 velo blubi" MY
_FORM_URLENC_ARG $MY hallo3 velo3 MY
_FORM_URLENC_END $MY
_EXPECT . "AS1"
_WAIT
END

SERVER $YOUR_PORT
_RES
_WAIT
__HTTP/1.1 302 Found
__Location: http://$YOUR_HOST:$YOUR_PORT/foo/bar
__Content-Length: AUTO
__Set-Cookie: foo=bar; path=/bla/fasel
__
__REDIRECT 1

_RES
_EXPECT headers "Cookie: foo=bar"
_WAIT
__HTTP/1.1 302 Found
__Location: http://$YOUR_HOST:$YOUR_PORT/bla/bla
__Content-Length: AUTO
__Connection: close
__
__REDIRECT 1
_CLOSE

_RES
_EXPECT headers "Cookie: foo=bar"
_WAIT
__HTTP/1.1 302 Found
__Location: /foo/bar2
__Content-Length: AUTO
__
__REDIRECT 2

_RES
_EXPECT headers "Cookie: foo=bar"
_WAIT
__HTTP/1.1 302 Found
__Location: https://$YOUR_HOST:$YOUR_PORT2/foo/bar3
__Content-Length: AUTO
__Set-Cookie: foo=blubi; path=/
__Set-Cookie: bla=fasel; path=/
__Connection: close
__
__REDIRECT 3
_CLOSE

_RES
_EXPECT body "hallo=velo&hallo2=velo2\+velo\+blubi&hallo3=velo3"
_WAIT
__HTTP/1.1 200 OK
__Content-Length: AUTO
__
__==AS1 OK==
END

SERVER SSL:$YOUR_PORT2
_RES
_EXPECT headers "!Cookie"
_WAIT
__HTTP/1.1 200 OK
__Content-Length: AUTO
__Foo: Bar
__Connection: close
__
__==AS2 OK==
_CLOSE
END