summaryrefslogtreecommitdiff
path: root/perl/t/stanford-naming.t
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2013-02-05 20:18:35 -0800
committerRuss Allbery <rra@stanford.edu>2013-02-05 20:23:00 -0800
commit4948053f7fd8a19f5c645d535ea3fa96f9539f4e (patch)
tree4faec59a28abb9032474c70ce2eae436dd88fe6d /perl/t/stanford-naming.t
parent271896c3a9dee9108e021519e340e4547ef5ab93 (diff)
Add default owner for group-based files in Stanford policy
In Wallet::Policy::Stanford, add support for setting a default owner of file objects whose names are based on a group that has an ACL mapping. Change-Id: I4f63815621d81e26ba4779d10f249cb31eef2b5e Reviewed-on: https://gerrit.stanford.edu/759 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/t/stanford-naming.t')
-rwxr-xr-xperl/t/stanford-naming.t14
1 files changed, 11 insertions, 3 deletions
diff --git a/perl/t/stanford-naming.t b/perl/t/stanford-naming.t
index 00c7121..9473ed5 100755
--- a/perl/t/stanford-naming.t
+++ b/perl/t/stanford-naming.t
@@ -16,7 +16,7 @@ use 5.008;
use strict;
use warnings;
-use Test::More tests => 95;
+use Test::More tests => 97;
use lib 't/lib';
use Util;
@@ -136,6 +136,11 @@ is(
'...and krb5 ACL line'
);
+# Create a group/its-idg ACL, which will be used for autocreation of file
+# objects.
+is($server->acl_create('group/its-idg'), 1, 'Created group/its-idg ACL');
+is($server->acl_add('group/its-idg', 'krb5', $ADMIN), 1, '...with member');
+
# Now we can test default ACLs. First, without a root instance.
local $ENV{REMOTE_USER} = $ADMIN;
is_deeply(
@@ -225,8 +230,11 @@ is_deeply(
);
# Check for a file object that isn't host-based.
-is(default_owner('file', 'config/its-idg/example/foo'), undef,
- 'No default owner for non-host-based file type');
+is_deeply(
+ [default_owner('file', 'config/its-idg/example/foo')],
+ ['group/its-idg', ['krb5', $ADMIN]],
+ 'Default owner for file config/its-idg/example/foo',
+);
# Check for legacy autocreation mappings for file objects.
for my $type (qw(htpasswd ssh-rsa ssh-dsa ssl-key tivoli-key)) {