]>
Commit | Line | Data |
---|---|---|
90d226ab | 1 | #!/usr/bin/perl |
52713981 DM |
2 | |
3 | use lib '../../'; | |
4 | use strict; | |
90d226ab | 5 | use warnings; |
52713981 DM |
6 | use Time::HiRes qw( usleep ualarm gettimeofday tv_interval ); |
7 | use PVE::INotify; | |
8 | use PVE::AccessControl; | |
9 | ||
10 | my $hostname = PVE::INotify::read_file("hostname"); | |
11 | ||
12 | # normally you use username/password, | |
13 | # but we can simply create a ticket if we are root | |
14 | my $ticket = PVE::AccessControl::assemble_ticket('root@pam'); | |
15 | ||
26dccfdb | 16 | my $cmd = "ab -c 10 -n 1000 -k -C 'PVEAuthCookie=$ticket' https://$hostname:8006/api2/json"; |
52713981 DM |
17 | print "$cmd\n"; |
18 | system($cmd) == 0 || die "command failed - $!\n"; |