view mod_lib_ldap/dev/t/00-login.t @ 4430:71c495fa03f3

mod_groups_internal: allow force-emitting group member addition events This is useful when a new plugin was loaded which handles that event to add some value. Then the command can be called (**not** from the plugin but from an upcoming admin shell module) to synchronise things.
author Jonas Schäfer <jonas@wielicki.name>
date Fri, 05 Feb 2021 15:45:28 +0100
parents 512e31cd8b70
children
line wrap: on
line source

use strict;
use warnings;
use lib 't';

use TestConnection;
use Test::More;

my @users = (
    'one',
    'two',
    'three',
    'four',
    'five',
    'six',
);

plan tests => scalar(@users) + 3;

foreach my $username (@users) {
    my $conn = TestConnection->new($username);

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok(! $error) or diag("$username login failed: $error");
}

do {
    my $conn = TestConnection->new('one', password => '23451');

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok($error);
};

do {
    my $conn = TestConnection->new('invalid', password => '12345');

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok($error);
};

do {
    my $conn = TestConnection->new('seven', password => '1234567');

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok($error);
};