File: 40connect.t

package info (click to toggle)
libnet-ldap-perl 1%3A0.6500%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,660 kB
  • ctags: 731
  • sloc: perl: 15,059; sh: 76; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 738 bytes parent folder | download | duplicates (3)
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
#!perl

use Test::More;

BEGIN { require "t/common.pl" }


start_server()
? plan tests => 3
: plan skip_all => 'no server';


$ldap = client();
ok($ldap, 'client with IPv4/IPv6 auto-selection' .
   ($ldap ? (', bound to ' . $ldap->{net_ldap_socket}->peerhost) : ''));

$ldap = client(inet4 => 1);
ok($ldap, 'client with IPv4' .
   ($ldap ? (', bound to ' . $ldap->{net_ldap_socket}->peerhost) : ''));


SKIP: {
  skip('No IPv6 capable IO::Socket module installed', 1)
    unless (eval { require IO::Socket::INET6; } or
            eval { require IO::Socket::IP; IO::Socket::IP->VERSION(0.20); });

  $ldap = client(inet6 => 1);
  ok($ldap, 'client with IPv6' .
     ($ldap ? (', bound to ' . $ldap->{net_ldap_socket}->peerhost) : ''));
}