File: config.t

package info (click to toggle)
webauth 4.7.0-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,932 kB
  • sloc: ansic: 28,341; sh: 12,031; perl: 8,361; xml: 6,856; makefile: 459; php: 7
file content (46 lines) | stat: -rwxr-xr-x 1,291 bytes parent folder | download | duplicates (5)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/perl -w
#
# Basic tests for WebKDC::Config.
#
# Written by Jon Robertson <jonrober@stanford.edu>
# Copyright 2010
#     The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.

use strict;
use Test::More tests => 8;

# Silence warnings since we're not using use.
package WebKDC::Config;
our $BYPASS_CONFIRM;
our $KEYRING_PATH;
our $REMUSER_ENABLED;
our $REMUSER_EXPIRES;
our $REMUSER_REALMS;
our $REMUSER_REDIRECT;
our $TEMPLATE_PATH;
package main;

BEGIN {
    $ENV{WEBKDC_CONFIG} = 't/data/webkdc.conf';
}
use_ok ('WebKDC::Config');

# Compare the values there to the values we know.
is ($WebKDC::Config::KEYRING_PATH, 't/data/test.keyring',
    'KEYRING_PATH correctly set');
is ($WebKDC::Config::TEMPLATE_PATH, 't/data/templates',
    'TEMPLATE_PATH correctly set');
is ($WebKDC::Config::REMUSER_ENABLED, 1,
    'REMUSER_ENABLED correctly set');
is ($WebKDC::Config::REMUSER_EXPIRES, 60 * 60 * 8,
    'REMUSER_EXPIRES correctly set');

my @realms = ('TEST.ORG', 'WIN.TEST.ORG');
is (@WebKDC::Config::REMUSER_REALMS, @realms,
    'REMUSER_REALMS correctly set');
is ($WebKDC::Config::REMUSER_REDIRECT, '/login-spnego',
    'REMUSER_REDIRECT correctly set');
is ($WebKDC::Config::BYPASS_CONFIRM, undef,
    'BYPASS_CONFIRM not set');