3 no warnings qw(redefine once);
8 use Test::More tests => 34;
14 require './l7directord';
17 #...............................................
22 my $got = get_check_func();
23 is $got, \&main::check_off, 'get_check_func - virtual is undef';
28 my $got = get_check_func($v);
29 is $got, \&main::check_none, 'get_check_func - no checktype';
34 checktype => 'negotiate',
37 my $got = get_check_func($v);
38 is $got, \&main::check_http, 'get_check_func - negotiate http';
43 checktype => 'negotiate',
46 my $got = get_check_func($v);
47 is $got, \&main::check_http, 'get_check_func - negotiate https';
52 checktype => 'negotiate',
55 my $got = get_check_func($v);
56 is $got, \&main::check_pop, 'get_check_func - negotiate pop';
61 checktype => 'negotiate',
64 my $got = get_check_func($v);
65 is $got, \&main::check_imap, 'get_check_func - negotiate imap';
70 checktype => 'negotiate',
73 my $got = get_check_func($v);
74 is $got, \&main::check_smtp, 'get_check_func - negotiate smtp';
79 checktype => 'negotiate',
82 my $got = get_check_func($v);
83 is $got, \&main::check_ftp, 'get_check_func - negotiate ftp';
88 checktype => 'negotiate',
91 my $got = get_check_func($v);
92 is $got, \&main::check_ldap, 'get_check_func - negotiate ldap';
97 checktype => 'negotiate',
100 my $got = get_check_func($v);
101 is $got, \&main::check_nntp, 'get_check_func - negotiate nntp';
106 checktype => 'negotiate',
109 my $got = get_check_func($v);
110 is $got, \&main::check_dns, 'get_check_func - negotiate dns';
115 checktype => 'negotiate',
118 my $got = get_check_func($v);
119 is $got, \&main::check_sip, 'get_check_func - negotiate sip';
124 checktype => 'negotiate',
127 my $got = get_check_func($v);
128 is $got, \&main::check_mysql, 'get_check_func - negotiate mysql';
133 checktype => 'negotiate',
136 my $got = get_check_func($v);
137 is $got, \&main::check_pgsql, 'get_check_func - negotiate pgsql';
142 checktype => 'negotiate',
145 my $got = get_check_func($v);
146 is $got, \&main::check_none, 'get_check_func - negotiate unknown';
149 todo_skip 'should check closure.', 1 if 1;
152 checktype => 'combined',
155 my $got = get_check_func($v);
156 is $got, \&main::check_http, 'get_check_func - combined http';
159 todo_skip 'should check closure.', 1 if 1;
162 checktype => 'combined',
165 my $got = get_check_func($v);
166 is $got, \&main::check_http, 'get_check_func - combined https';
169 todo_skip 'should check closure.', 1 if 1;
172 checktype => 'combined',
175 my $got = get_check_func($v);
176 is $got, \&main::check_pop, 'get_check_func - combined pop';
179 todo_skip 'should check closure.', 1 if 1;
182 checktype => 'combined',
185 my $got = get_check_func($v);
186 is $got, \&main::check_imap, 'get_check_func - combined imap';
189 todo_skip 'should check closure.', 1 if 1;
192 checktype => 'combined',
195 my $got = get_check_func($v);
196 is $got, \&main::check_smtp, 'get_check_func - combined smtp';
199 todo_skip 'should check closure.', 1 if 1;
202 checktype => 'combined',
205 my $got = get_check_func($v);
206 is $got, \&main::check_ftp, 'get_check_func - combined ftp';
209 todo_skip 'should check closure.', 1 if 1;
212 checktype => 'combined',
215 my $got = get_check_func($v);
216 is $got, \&main::check_ldap, 'get_check_func - combined ldap';
219 todo_skip 'should check closure.', 1 if 1;
222 checktype => 'combined',
225 my $got = get_check_func($v);
226 is $got, \&main::check_nntp, 'get_check_func - combined nntp';
229 todo_skip 'should check closure.', 1 if 1;
232 checktype => 'combined',
235 my $got = get_check_func($v);
236 is $got, \&main::check_dns, 'get_check_func - combined dns';
239 todo_skip 'should check closure.', 1 if 1;
242 checktype => 'combined',
245 my $got = get_check_func($v);
246 is $got, \&main::check_sip, 'get_check_func - combined sip';
249 todo_skip 'should check closure.', 1 if 1;
252 checktype => 'combined',
255 my $got = get_check_func($v);
256 is $got, \&main::check_mysql, 'get_check_func - combined mysql';
259 todo_skip 'should check closure.', 1 if 1;
262 checktype => 'combined',
265 my $got = get_check_func($v);
266 is $got, \&main::check_pgsql, 'get_check_func - combined pgsql';
271 checktype => 'combined',
274 my $got = get_check_func($v);
275 is $got, \&main::check_none, 'get_check_func - combined unknown';
280 checktype => 'connect',
282 my $got = get_check_func($v);
283 is $got, \&main::check_ping, 'get_check_func - connect, but no protocol';
288 checktype => 'connect',
291 my $got = get_check_func($v);
292 is $got, \&main::check_ping, 'get_check_func - connect, protocol is not tcp';
297 checktype => 'connect',
300 my $got = get_check_func($v);
301 is $got, \&main::check_connect, 'get_check_func - connect, protocol is tcp';
308 my $got = get_check_func($v);
309 is $got, \&main::check_ping, 'get_check_func - ping';
316 my $got = get_check_func($v);
317 is $got, \&main::check_off, 'get_check_func - off';
324 my $got = get_check_func($v);
325 is $got, \&main::check_on, 'get_check_func - on';
328 #...............................................
335 *ld_log = \&__ld_log;