1 2use strict; 3 4use ExtUtils::testlib; 5 6use GSSAPI qw(:all); 7use Test::More tests => 3; 8 9 10 11#-------------------------------------------------------- 12{ 13 my ($name, $display); 14 my $keystring = 'chpasswd@mars.gac.edu'; 15 my $status = GSSAPI::Name->import($name, $keystring); 16 ok ( $status, 'GSSAPI::Name->import() ' . $status ); 17 SKIP: { 18 if ( $status->major != GSS_S_COMPLETE ) { 19 skip('GSSAPI::Name->import() failed ' . $status, 2 ); 20 } 21 22 my $status = $name->display($display); 23 # 24 # The lc is needed for implementations that uppercase 25 # the realm - part of $display 26 # see <http://rt.cpan.org/Public/Bug/Display.html?id=18531> 27 # 28 ok ( $status, '$name->display() GSS_S_COMPLETE ' . $status); 29 SKIP: { 30 if ( $status->major != GSS_S_COMPLETE ) { 31 skip('$name->display() failed', 1 ); 32 } 33 cmp_ok ( lc $display, 'eq', $keystring, 'check bugfix of <http://rt.cpan.org/Public/Bug/Display.html?id=5681>'); 34 } 35 } 36} 37diag( "\n\n if you want to run tests that do a realworld *use* of your GSSAPI", 38 "\n start a kinit and try to run", 39 "\n\n./examples/getcred_hostbased.pl \n\n" ); 40#--------------------------------------------------------