diff options
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | tests/TESTS | 1 | ||||
| -rw-r--r-- | tests/kasetkey/basic-t.in | 127 | 
3 files changed, 0 insertions, 129 deletions
| diff --git a/configure.ac b/configure.ac index de998c0..8d00229 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,6 @@ AC_CONFIG_FILES([tests/client/full-t], [chmod +x tests/client/full-t])  AC_CONFIG_FILES([tests/client/pod-t], [chmod +x tests/client/pod-t])  AC_CONFIG_FILES([tests/client/prompt-t], [chmod +x tests/client/prompt-t])  AC_CONFIG_FILES([tests/data/cmd-wrapper], [chmod +x tests/data/cmd-wrapper]) -AC_CONFIG_FILES([tests/kasetkey/basic-t], [chmod +x tests/kasetkey/basic-t])  AC_CONFIG_FILES([tests/server/admin-t], [chmod +x tests/server/admin-t])  AC_CONFIG_FILES([tests/server/backend-t], [chmod +x tests/server/backend-t])  AC_CONFIG_FILES([tests/server/keytab-t], [chmod +x tests/server/keytab-t]) diff --git a/tests/TESTS b/tests/TESTS index c94cce0..a446643 100644 --- a/tests/TESTS +++ b/tests/TESTS @@ -2,7 +2,6 @@ client/basic  client/full  client/pod  client/prompt -kasetkey/basic  portable/asprintf  portable/snprintf  portable/strlcat diff --git a/tests/kasetkey/basic-t.in b/tests/kasetkey/basic-t.in deleted file mode 100644 index bb086d6..0000000 --- a/tests/kasetkey/basic-t.in +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/perl -w -# -# Tests for basic kasetkey functionality. -# -# We only test creation (with a random key), deletion, enable, disable, and -# examine.  That's enough to verify that kasetkey is basically working, and -# since AFS kaservers are becoming scarce, it's probably not worth the effort -# to do anything more comprehensive. -# -# We do test creation of a principal with a known key given a srvtab from -# inside the wallet server test suite already. -# -# Written by Russ Allbery <rra@stanford.edu> -# Copyright 2008 Board of Trustees, Leland Stanford Jr. University -# -# See LICENSE for licensing terms. - -BEGIN { our $total = 27 } -use Test::More tests => $total; - -use lib '@abs_top_builddir@/perl/blib/lib'; -use lib '@abs_top_srcdir@/perl/t/lib'; -use Util; - -# Global variables used for the kasetkey configuration. -our $ADMIN; -our $SRVTAB; - -# Make a call to the kasetkey client and returns the standard output, the -# standard error, and the exit status as a list. -sub kasetkey { -    my @command = @_; -    my $pid = fork; -    if (not defined $pid) { -        die "cannot fork: $!\n"; -    } elsif ($pid == 0) { -        open (STDOUT, '>', 'kasetkey.out') -            or die "cannot create kasetkey.out: $!\n"; -        open (STDERR, '>', 'kasetkey.err') -            or die "cannot create kasetkey.err: $!\n"; -        exec ('@abs_top_builddir@/kasetkey/kasetkey', '-a', $ADMIN, -              '-k', $SRVTAB, @command) -            or die "cannot run @abs_top_builddir@/kasetkey/kasetky: $!\n"; -    } else { -        waitpid ($pid, 0); -    } -    my $status = ($? >> 8); -    local $/; -    open (OUT, '<', 'kasetkey.out') or die "cannot open kasetkey.out: $!\n"; -    my $output = <OUT>; -    close OUT; -    open (ERR, '<', 'kasetkey.err') or die "cannot open kasetkey.err: $!\n"; -    my $error = <ERR>; -    close ERR; -    unlink ('kasetkey.out', 'kasetkey.err'); -    return ($output, $error, $status); -} - -SKIP: { -    skip 'no AFS kaserver configuration', $total -        unless -f '@abs_top_builddir@/tests/data/test.srvtab'; -    skip 'no AFS kaserver support', $total, -        unless -x '@abs_top_builddir@/kasetkey/kasetkey'; - -    # Set up the configuration. -    $ADMIN  = contents ('@abs_top_builddir@/tests/data/test.admin'); -    $SRVTAB = '@abs_top_builddir@/tests/data/test.srvtab'; -    my $realm = $ADMIN; -    $realm =~ s/^[^\@]+\@//; -    my $principal = "wallet.one\@$realm"; - -    # Now we can start manipulating principals.  Test examine and create. -    my ($out, $err, $status) = kasetkey ('-e', $principal); -    is ($status, 1, 'Examining a non-existent principal fails'); -    is ($out, '', ' with no output'); -    is ($err, "no such entry in the database\n", ' and the right error'); -    ($out, $err, $status) = kasetkey ('-s', $principal, '-r'); -    is ($status, 0, 'Creating a principal succeeds'); -    is ($out, '', ' with no output'); -    is ($err, '', ' and no error'); -    ($out, $err, $status) = kasetkey ('-e', $principal); -    is ($status, 0, 'Examining a principal succeeds'); -    $out =~ s/: (Sun|Mon|Tue|Wed|Thu|Fri|Sat).*/: DATE/g; -    my $shortadmin = $ADMIN; -    $shortadmin =~ s/\@.*//; -    my $enabled = <<"EOE"; -status: enabled -account expiration: never -password last changed: DATE -modification time: DATE -modified by: $shortadmin -EOE -    is ($out, $enabled, ' with the right output'); -    is ($err, '', ' and no error'); - -    # Test enable and disable. -    ($out, $err, $status) = kasetkey ('-s', $principal, '-n'); -    is ($status, 0, 'Disabling a principal succeeds'); -    is ($out, '', ' with no output'); -    is ($err, '', ' and no error'); -    ($out, $err, $status) = kasetkey ('-e', $principal); -    is ($status, 0, ' and examining it still succeeds'); -    $out =~ s/: (Sun|Mon|Tue|Wed|Thu|Fri|Sat).*/: DATE/g; -    my $disabled = $enabled; -    $disabled =~ s/enabled/disabled/; -    is ($out, $disabled, ' with the right output'); -    is ($err, '', ' and no error'); -    ($out, $err, $status) = kasetkey ('-s', $principal, '-t'); -    is ($status, 0, 'Enabling a principal succeeds'); -    is ($out, '', ' with no output'); -    is ($err, '', ' and no error'); -    ($out, $err, $status) = kasetkey ('-e', $principal); -    is ($status, 0, ' and examining it still succeeds'); -    $out =~ s/: (Sun|Mon|Tue|Wed|Thu|Fri|Sat).*/: DATE/g; -    is ($out, $enabled, ' with the right output'); -    is ($err, '', ' and no error'); - -    # Test deletion. -    ($out, $err, $status) = kasetkey ('-D', $principal); -    is ($status, 0, 'Deleting the principal succeeds'); -    is ($out, '', ' with no output'); -    is ($err, '', ' and no error'); -    ($out, $err, $status) = kasetkey ('-e', $principal); -    is ($status, 1, ' and now examining it fails'); -    is ($out, '', ' with no output'); -    is ($err, "no such entry in the database\n", ' and the right error'); -} | 
