aboutsummaryrefslogtreecommitdiff
path: root/perl/t/general
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2014-07-15 20:29:19 -0700
committerRuss Allbery <rra@stanford.edu>2014-07-15 21:10:37 -0700
commitb1bd88daea1dde6de9e6a8688c6190cdc0b5c617 (patch)
treeb6a9cf2a7dd3ef14b28ec0f83067359db09c8b7a /perl/t/general
parent0b97ce27ea443be1e4b63fb5ebffa8a274a00f40 (diff)
Record the ACL name in the acl_history table
Store the current name of the ACL with each history row, and index the name. This will eventually allow retrieval of history by name for ACLs that have been deleted, although the rest of the code is not yet in place. The initial creation and membership of the ADMIN ACL during database initialization or reinitialization is no longer recorded in the acl_history table, since otherwise it produces errors due to the missing ah_name field when building the database with schema 0.07. There should be some better solution to this, but this will be okay for the time being. Change-Id: I015a00c972e0c2730c3d449952fcfe9b79c6e54f Reviewed-on: https://gerrit.stanford.edu/1553 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/t/general')
-rwxr-xr-xperl/t/general/server.t18
1 files changed, 4 insertions, 14 deletions
diff --git a/perl/t/general/server.t b/perl/t/general/server.t
index 0a527a5..b270733 100755
--- a/perl/t/general/server.t
+++ b/perl/t/general/server.t
@@ -54,18 +54,8 @@ is ($server->acl_show ('ADMIN'),
is ($server->acl_show (1),
"Members of ACL ADMIN (id: 1) are:\n krb5 $admin\n",
' including by number');
-my $history = <<"EOO";
-DATE create
- by $admin from $host
-DATE add krb5 $admin
- by $admin from $host
-EOO
-my $result = $server->acl_history ('ADMIN');
-$result =~ s/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d/DATE/gm;
-is ($result, $history, ' and displaying history works');
-$result = $server->acl_history (1);
-$result =~ s/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d/DATE/gm;
-is ($result, $history, ' including by number');
+is ($server->acl_history ('ADMIN'), '', ' and initial history is empty');
+is ($server->acl_history (1), '', ' 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');
@@ -117,7 +107,7 @@ is ($server->acl_add ('both', 'krb5', $user2), 1,
is ($server->acl_show ('both'),
"Members of ACL both (id: 4) are:\n krb5 $user1\n krb5 $user2\n",
' and show returns the correct result');
-$history = <<"EOO";
+my $history = <<"EOO";
DATE create
by $admin from $host
DATE add krb5 $user1
@@ -125,7 +115,7 @@ DATE add krb5 $user1
DATE add krb5 $user2
by $admin from $host
EOO
-$result = $server->acl_history ('both');
+my $result = $server->acl_history ('both');
$result =~ s/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d/DATE/gm;
is ($result, $history, ' as does history');
is ($server->acl_add ('empty', 'krb5', $user1), 1, ' and another to empty');