use strict;
use warnings;
-use Test::More tests => 43;
+use Test::More tests => 47;
use Data::Dump qw(dump);
use lib 'lib';
my $hostname = `hostname -s`;
chomp $hostname;
-my $user = $ARGV[0] || 2001;
-
sub gearman {
my ( $function, $args ) = @_;
ok( my $o = CloudStore::Gearman->gearman_do( @_ ), join(' ',@_) );
my $u3 = gearman 'create_user' => 'slice2@example.com secret 0';
like $u3, qr/u\d+/, "login $u2 (on other slice)";
-my $o = gearman $hostname . '_s1_quota_get' => $user;
-diag dump $o;
-cmp_ok $o, '=~', qr/^(\d+)\s+(\d+)$/, 'format: used quota';
+foreach my $login ( $u1, $u2, $u3 ) {
+ my $o = gearman $hostname . '_s1_quota_get' => $login;
+ diag dump $o;
+ cmp_ok $o, '=~', qr/^(\d+)\s+(\d+)$/, 'format: used quota';
+}
-gearman( 'user_usage' => $user );
+gearman( 'user_usage' => $u1 );
gearman( $hostname . '_s1_torrent_list' );