bump version to 4.0-5
[pve-access-control.git] / test.pl
CommitLineData
2c3a6c0a
DM
1#!/usr/bin/perl -w
2
3use strict;
4use PVE::AccessControl;
5
6# create ticket using username and password
7#my $ticket = PVE::AccessControl::create_ticket(undef, $username, $password);
8
9# create ticket using ident auth
10my $login = getpwuid($<);
11my $username = ($< == 0) ? 'root' : "$login\@localhost";
12my $ticket = PVE::AccessControl::create_ticket(undef, $username);
13print "got ticket using ident auth: $ticket\n";
14
15for (my $i = 0; $i < 1; $i++) {
16 $ticket = PVE::AccessControl::create_ticket($ticket, $username);
17 print "renewed ticket: $ticket\n";
18}
19
20my $user = 'testuser';
21
22PVE::AccessControl::add_user($ticket, $user, 'testpw');