1
%% ``The contents of this file are subject to the Erlang Public License,
2
%% Version 1.1, (the "License"); you may not use this file except in
3
%% compliance with the License. You should have received a copy of the
4
%% Erlang Public License along with this software. If not, it can be
5
%% retrieved via the world wide web at http://www.erlang.org/.
7
%% Software distributed under the License is distributed on an "AS IS"
8
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
%% the License for the specific language governing rights and limitations
12
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
%% AB. All Rights Reserved.''
18
%%----------------------------------------------------------------------
19
%% Purpose: Verify the application specifics of the inets application
20
%%----------------------------------------------------------------------
25
-include("inets_test_lib.hrl").
28
%% These are JUST temporary
29
-ifndef(NOPROXY_HOST).
30
-define(NOPROXY_HOST, "otp.ericsson.se").
31
-define(NOPROXY_PORT, "8000").
35
-define(PROXY_HOST, "www.erlang.org").
36
-define(PROXY_PORT, undefined).
40
% t() -> megaco_test_lib:t(?MODULE).
41
% t(Case) -> megaco_test_lib:t({?MODULE, Case}).
44
%% Test server callbacks
45
init_per_testcase(Case, Config) ->
46
Timeout = inets_test_lib:get_config(tc_timeout, Config, ?SECS(10)),
47
Pid = ?WD_START(Timeout),
48
[{watchdog, Pid}|Config].
50
fin_per_testcase(Case, Config) ->
51
case ?CONFIG(watchdog, Config) of
59
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82
?EXPANDABLE(init_noproxy_ip, Cases, stop_noproxy_ip).
92
?EXPANDABLE(init_proxy_ip, Cases, stop_proxy_ip).
95
init_noproxy_ip(suite) -> [];
96
init_noproxy_ip(doc) -> [];
97
init_noproxy_ip(Config) when list(Config) ->
98
%% Here we should propably start the server...
99
[{type, ip_comm}, {host, ?NOPROXY_HOST}, {port, ?NOPROXY_PORT}|Config].
101
stop_noproxy_ip(suite) -> [];
102
stop_noproxy_ip(doc) -> [];
103
stop_noproxy_ip(Config) when list(Config) ->
106
ip_noproxy_simple_op(suite) -> [];
107
ip_noproxy_simple_op(doc) ->
108
["Perform the operations GET, POST, ... "
109
"with only the needed options (simple)"];
110
ip_noproxy_simple_op(Config) ->
113
ip_noproxy_get(suite) -> [];
114
ip_noproxy_get(doc) ->
115
["Perform the GET operation, excercising all the options"];
116
ip_noproxy_get(Config) ->
117
?SKIP(not_yet_implemented).
119
ip_noproxy_head(suite) -> [];
120
ip_noproxy_head(doc) ->
121
["Perform the HEAD operation, excercising all the options"];
122
ip_noproxy_head(Config) ->
123
?SKIP(not_yet_implemented).
125
ip_noproxy_post(suite) -> [];
126
ip_noproxy_post(doc) ->
127
["Perform the POST operation, excercising all the options"];
128
ip_noproxy_post(Config) ->
129
?SKIP(not_yet_implemented).
132
init_proxy_ip(suite) -> [];
133
init_proxy_ip(doc) -> [];
134
init_proxy_ip(Config) when list(Config) ->
135
%% Here we should propably start the server...
136
[{type, ip_comm}, {host, ?PROXY_HOST}, {port, ?PROXY_PORT},
137
{settings, [{http_useproxy,true},{http_proxy,{"proxy",82}}]}|Config].
139
stop_proxy_ip(suite) -> [];
140
stop_proxy_ip(doc) -> [];
141
stop_proxy_ip(Config) when list(Config) ->
144
ip_proxy_simple_op(suite) -> [];
145
ip_proxy_simple_op(doc) ->
146
["Perform the operations GET, POST, ... "
147
"with only the needed options (simple)"];
148
ip_proxy_simple_op(Config) ->
151
ip_proxy_get(suite) -> [];
153
["Perform the GET operation, excercising all the options"];
154
ip_proxy_get(Config) ->
155
?SKIP(not_yet_implemented).
157
ip_proxy_head(suite) -> [];
158
ip_proxy_head(doc) ->
159
["Perform the HEAD operation, excercising all the options"];
160
ip_proxy_head(Config) ->
161
?SKIP(not_yet_implemented).
163
ip_proxy_post(suite) -> [];
164
ip_proxy_post(doc) ->
165
["Perform the POST operation, excercising all the options"];
166
ip_proxy_post(Config) ->
167
?SKIP(not_yet_implemented).
178
ssl_noproxy(suite) ->
181
ssl_noproxy_simple_op,
186
?EXPANDABLE(init_noproxy_ssl, Cases, stop_noproxy_ssl).
196
?EXPANDABLE(init_proxy_ssl, Cases, stop_proxy_ssl).
199
init_noproxy_ssl(suite) -> [];
200
init_noproxy_ssl(doc) -> [];
201
init_noproxy_ssl(Config) when list(Config) ->
202
%% Here we should propably start the server...
203
[{type, ssl}, {host, ?NOPROXY_HOST}, {port, ?NOPROXY_PORT}|Config].
205
stop_noproxy_ssl(suite) -> [];
206
stop_noproxy_ssl(doc) -> [];
207
stop_noproxy_ssl(Config) when list(Config) ->
210
ssl_noproxy_simple_op(suite) -> [];
211
ssl_noproxy_simple_op(doc) ->
212
["Perform the operations GET, POST, ... "
213
"with only the needed options (simple)"];
214
ssl_noproxy_simple_op(Config) ->
217
ssl_noproxy_get(suite) -> [];
218
ssl_noproxy_get(doc) ->
219
["Perform the GET operation, excercising all the options"];
220
ssl_noproxy_get(Config) ->
221
?SKIP(not_yet_implemented).
223
ssl_noproxy_head(suite) -> [];
224
ssl_noproxy_head(doc) ->
225
["Perform the HEAD operation, excercising all the options"];
226
ssl_noproxy_head(Config) ->
227
?SKIP(not_yet_implemented).
229
ssl_noproxy_post(suite) -> [];
230
ssl_noproxy_post(doc) ->
231
["Perform the POST operation, excercising all the options"];
232
ssl_noproxy_post(Config) ->
233
?SKIP(not_yet_implemented).
236
init_proxy_ssl(suite) -> [];
237
init_proxy_ssl(doc) -> [];
238
init_proxy_ssl(Config) when list(Config) ->
239
%% Here we should propably start the server...
240
[{type, ssl}, {host, ?PROXY_HOST}, {port, ?PROXY_PORT},
241
{settings, [{http_useproxy,true},{http_proxy,{"proxy",82}}]}|Config].
243
stop_proxy_ssl(suite) -> [];
244
stop_proxy_ssl(doc) -> [];
245
stop_proxy_ssl(Config) when list(Config) ->
248
ssl_proxy_simple_op(suite) -> [];
249
ssl_proxy_simple_op(doc) ->
250
["Perform the operations GET, POST, ... "
251
"with only the needed options (simple)"];
252
ssl_proxy_simple_op(Config) ->
255
ssl_proxy_get(suite) -> [];
256
ssl_proxy_get(doc) ->
257
["Perform the GET operation, excercising all the options"];
258
ssl_proxy_get(Config) ->
259
?SKIP(not_yet_implemented).
261
ssl_proxy_head(suite) -> [];
262
ssl_proxy_head(doc) ->
263
["Perform the HEAD operation, excercising all the options"];
264
ssl_proxy_head(Config) ->
265
?SKIP(not_yet_implemented).
267
ssl_proxy_post(suite) -> [];
268
ssl_proxy_post(doc) ->
269
["Perform the POST operation, excercising all the options"];
270
ssl_proxy_post(Config) ->
271
?SKIP(not_yet_implemented).
275
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
277
simple_op(suite) -> [];
278
simple_op(doc) -> [];
280
?SKIP(not_yet_implemented),
281
URL = url("/", Config),
282
Settings = inets_test_lib:get_config(settings, Config, []),
283
io:format("simple_op -> "
285
"~nSettings: ~p~n", [URL, Settings]),
286
http:request_sync(get, {URL, []}, Settings).
290
Host = ?CONFIG(host, Config),
291
case inets_test_lib:get_config(type, Config, ip_comm) of
293
url1("http://", Host, Uri, Config);
295
url1("https://", Host, Uri, Config)
298
url1(Prot, Host, Uri, Config) ->
299
case ?CONFIG(port, Config) of
302
Port when list(Port) ->
303
Prot ++ Host ++ ":" ++ Port ++ Uri