From: Jonathan <jws...@gm...> - 2010-07-21 13:48:21
|
I have an application, a client module that control a server module, that my group is automating tests for. This may be a cygwin problem, I will have to try on a cross platform system as the server/client model runs on Windows/Linux/Mac. However, does anyone have any insight into why I can't send a password to this application with cygwin. Output: VPN> connect as5505-1.testbed >> contacting host as5505-1.testbed.cisco.com) for login information... >> notice: Contactingas5505-1.testbed VPN> >> Please enter your username and password. Group: SSLVPNClient Username: [userA] userA Password: test123 ************************* this is the password, it picked up the password prompt but never is accepted.... I can enter keystroke right when displaying as test123 and it will connect. No prompt. Code: sub connect { if ($VpnHelper::Debug){ print "Entering VpnHelper::connect\n"; } my ($self, $hostname, $username, $password, $group) = @_; my $exp = $self->{exp}; my $connected = 0; if ($VpnHelper::Debug){ print "Username is $username\n"; print "Password is $password\n"; print "Group is $group\n"; print "Hostname is $hostname\n"; } #Make sure VPN is not already up if ($self->connected){ return $connected; } $exp->send("connect $hostname\r"); $exp->expect(15, [ '-re','Username:\s*(.*)', sub { my $fh = shift; $fh->send("$username\r"); exp_continue; } ], [ '-re','Password:\s*', sub { my $fh = shift; $fh ->send("$password\r"); exp_continue; } ], [ '-re','state:\sConnected', sub { my $fh = shift; $connected = 1; exp_continue; } ], [ '-re','VPN>', sub { my $fh = shift; exp_continue; } ], [ eof => sub { die "ERROR: premature EOF in vpn shell.\n"; } ], [ timeout => sub { die "No prompt.\n"; } ] ); } Thank you in advance, Jonathan |