File: sshd-test-conf.pl

package info (click to toggle)
libconfig-model-openssh-perl 1.241-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 672 kB
  • sloc: perl: 3,198; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download
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
47
48
#
# This file is part of Config-Model-OpenSsh
#
# This software is Copyright (c) 2008-2018 by Dominique Dumont.
#
# This is free software, licensed under:
#
#   The GNU Lesser General Public License, Version 2.1, February 1999
#

$model_to_test = "Sshd" ;

my $map = {
   'darwin' => '/etc/sshd_config',
   'default' => '/etc/ssh/sshd_config',
} ;

my $target = $map->{$^O} || $map->{default} ;

@tests = (
    { 
        name => 'debian-bug-671367' ,
        setup => {
            'system_sshd_config' => $map,
        },
        check => { 
            'AuthorizedKeysFile:0' => '/etc/ssh/userkeys/%u',
            'AuthorizedKeysFile:1' => '/var/lib/misc/userkeys2/%u',
        },
        file_contents_like => {
            $target , qr!/etc/ssh/userkeys/%u /var/lib/misc/userkeys2/%u! ,
        }
    },
    {
        # test that check value is indeed passed when loading Match block
        # that contain a bad value. The bad value is skipped.
        name => 'bad-password-authentication',
        setup => {
            'system_sshd_config' => $map,
        },
        load_check => 'skip',
        check => {
            'Match:0 Settings PermitRootLogin' => 'no',
        }
    }
);

1;