use Test::More tests => 9;
BEGIN { use_ok( 'P4' ); }
# Load test utils
unshift( @INC, "." );
unshift( @INC, "t" );
require_ok( "p4test" );
my $test = P4::Test->new();
my $p4 = $test->InitClient();
ok( defined( $p4 ) );
$p4->SetProg( $0 );
ok( $p4->Connect() );
$p4->Debug( 0 );
# First set a password on our account
$p4->RunPassword( "", "foo" );
ok( $p4->ErrorCount() == 0 );
# Now disconnect, and reconnect to force authentication update
$p4->Disconnect();
$p4->Connect();
# Now attempt login with bad password. Note, if P4Perl is built
# with an API older than 2010.2, this will fail.
$p4->SetPassword( "bar" );
$p4->RunLogin();
ok( $p4->ErrorCount() == 1 );
@e = $p4->Errors();
ok( $e[0] =~ /invalid/ );
# Now login with the correct password
$p4->SetPassword( "foo" );
$p4->RunLogin();
ok( $p4->ErrorCount() == 0 );
# Now see how long the ticket is valid for...
$p4->Tagged( 0 );
my @r = $p4->RunLogin( '-s' );
ok( $r[0] =~ /ticket expires in/ );
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #2 | 19592 | jmash | Convert uses of indirect object construction syntax to use direct syntax in the test modules. | ||
| #1 | 19582 | jmash | Initial fork of P4Perl. | ||
| //guest/perforce_software/p4perl/main/t/11-login.t | |||||
| #1 | 15920 | Matt Attaway | Move p4perl files into the main directory | ||
| //guest/perforce_software/p4perl/t/11-login.t | |||||
| #1 | 8486 | Paul Allen |
Initial population of P4PERL from: //depot/main/p4-perl/...@565514 //depot/main/p4-doc/user/p4perlnotes.txt@565514 |
||