aboutsummaryrefslogtreecommitdiff
path: root/perl/t/server.t
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2012-11-04 10:38:29 -0800
committerRuss Allbery <rra@stanford.edu>2012-11-04 10:38:29 -0800
commit357532f312aea30ab5b3e459ccf19f1580b29262 (patch)
tree6cbe1caa928502a24a2e1e66c04100eb61a9e7fb /perl/t/server.t
parentad0dd8ded5cc0896f6bc41fab435026e75a72eed (diff)
Add new acl check command
Add a new acl check command which, given an ACL ID, prints yes if that ACL already exists and no otherwise. This is parallel to the check command for objects. Also fix some documentation errors in the wallet client documentation, saying that the check command doesn't require any ACL and fixing one place where "show" was used instead of "store".
Diffstat (limited to 'perl/t/server.t')
-rwxr-xr-xperl/t/server.t10
1 files changed, 7 insertions, 3 deletions
diff --git a/perl/t/server.t b/perl/t/server.t
index ad16151..8e0a30d 100755
--- a/perl/t/server.t
+++ b/perl/t/server.t
@@ -3,12 +3,12 @@
# Tests for the wallet server API.
#
# Written by Russ Allbery <rra@stanford.edu>
-# Copyright 2007, 2008, 2010, 2011
+# Copyright 2007, 2008, 2010, 2011, 2012
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
-use Test::More tests => 377;
+use Test::More tests => 381;
use POSIX qw(strftime);
use Wallet::Admin;
@@ -66,7 +66,9 @@ is ($result, $history, ' including by number');
is ($server->acl_create (3), undef, 'Cannot create ACL with a numeric name');
is ($server->error, 'ACL name may not be all numbers',
' and returns the right error');
+is ($server->acl_check ('user1'), 0, 'user1 ACL does not exist');
is ($server->acl_create ('user1'), 1, 'Can create regular ACL');
+is ($server->acl_check ('user1'), 1, 'user1 now exists');
is ($server->acl_show ('user1'), "Members of ACL user1 (id: 2) are:\n",
' and show works');
is ($server->acl_create ('user1'), undef, ' but not twice');
@@ -95,8 +97,10 @@ is ($server->acl_history ('test'), undef, ' and history fails');
is ($server->error, 'ACL test not found', ' and returns the right error');
is ($server->acl_destroy ('test'), undef, 'Destroying the old name fails');
is ($server->error, 'ACL test not found', ' and returns the right error');
-is ($server->acl_destroy ('test2'), 1, ' but destroying another one works');
+is ($server->acl_check ('test2'), 1, ' but the other ACL exists');
+is ($server->acl_destroy ('test2'), 1, ' and destroying it works');
is ($server->acl_destroy ('test2'), undef, ' but not twice');
+is ($server->acl_check ('test2'), 0, ' and now it does not exist');
is ($server->error, 'ACL test2 not found', ' and returns the right error');
is ($server->acl_add ('user1', 'krb4', $user1), undef,
'Adding with a bad scheme fails');