File: external.t

package info (click to toggle)
libauthen-sasl-perl 2.1900-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 328 kB
  • sloc: perl: 2,249; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (2)
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
#!perl

use Test::More tests => 6;

use Authen::SASL qw(Perl);

my $sasl = Authen::SASL->new(
  mechanism => 'EXTERNAL',
  callback => {
    user => 'gbarr',
    pass => 'fred',
    authname => 'none'
  },
);
ok($sasl, 'new');

is($sasl->mechanism, 'EXTERNAL', 'sasl mechanism');

my $conn = $sasl->client_new("ldap","localhost", "noplaintext");

is($conn->mechanism, 'EXTERNAL', 'conn mechanism');

is($conn->client_start, 'gbarr', 'client_start');

is($conn->client_step("xyz"),  undef, 'client_step');

$sasl = Authen::SASL->new(mechanism => 'EXTERNAL');
$conn = $sasl->client_new("ldap","localhost", "noplaintext");
is ($conn->client_start, '', 'no user callback');