File: node_list.t

package info (click to toggle)
libauthen-radius-perl 0.33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: perl: 1,057; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 950 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
use strict;
use warnings;
use Test::More tests => 10;
use Test::NoWarnings;

BEGIN { use_ok('Authen::Radius') };

my @nodes = ('127.0.0.1:1820', '127.0.0.2:1830');

my $auth = Authen::Radius->new(NodeList => \@nodes, Secret => 'secret', Debug => 0);
ok($auth, 'object created');
ok(!$auth->get_active_node, 'active node is not selected');

$auth = Authen::Radius->new(Host => '127.0.0.3:1840', NodeList => \@nodes, Secret => 'secret', Debug => 0);
ok($auth, 'object created');
ok(!$auth->get_active_node, 'Host must be from NodeList');

$auth = Authen::Radius->new(Host => '127.0.0.2:1830', NodeList => \@nodes, Secret => 'secret', Debug => 0);
ok($auth, 'object created');
is($auth->get_active_node, '127.0.0.2:1830', 'active node pre-set by Host option');

$auth = Authen::Radius->new(Host => 'aaa.radius', NodeList => \@nodes, Secret => 'secret', Debug => 0);
ok($auth, 'object created');
ok(!$auth->get_active_node, , 'unresolved Host ignored');