From: Prasad J. <pra...@sy...> - 2007-06-25 10:05:36
|
Hi All, This problem is being solved. But, there is one more problem that I am facing now. push (@match_patterns, 'Enter the system names separated by spaces on which to install \w+' ) ; this is matching the line ===> Enter the system names separated by spaces on which to install SFCFS But, push (@match_patterns, 'Enter a \w+ license key for \w+' ); Why this is not matching the line ==> Enter a SFCFS license key for swlx44: Why? I am not getting, Is there anything wrong that I have done. Please help. Thanks and Regards, Prasad. Prasad Joshi wrote: > Hi All, > > I am running in to a problem which is something I am not able to understand. > > Here, is the part of code. > > > my @match_patterns ; > > push (@match_patterns, 'Enter the system names separated by spaces > on which to install \w+' ) ; > push (@match_patterns, 'Enter a \w+ license key for \w+' ); > push (@match_patterns, "Do you want to enter another license key" ) ; > push (@match_patterns, "Select the rpms to be installed" ) ; > push (@match_patterns, "Press [Enter] to continue" ) ; > push (@match_patterns, "Are you ready to configure" ) ; > push (@match_patterns, "Will you be configuring I/O Fencing" ) ; > push (@match_patterns, "Enter the unique cluster name" ) ; > push (@match_patterns, "Enter the unique Cluster ID" ) ; > push (@match_patterns, "Enter the NIC for the first private > heartbeat link" ) ; > push (@match_patterns, 'Are you sure you want to use \w+ for the > first private heartbeat link' ) ; > push (@match_patterns, "Would you like to configure a second private > heartbeat link" ) ; > push (@match_patterns, "Enter the NIC for the low priority heartbeat > link" ) ; > push (@match_patterns, "Are you using the same NICs for private > heartbeat links on all systems" ) ; > push (@match_patterns, "Is this information correct" ) ; > push (@match_patterns, "Do you want to set up the enclosure-based > naming scheme" ) ; > push (@match_patterns, "Do you want to set up a default disk group > for each system" ) ; > push (@match_patterns, "Is the fully qualified hostname of system" ) ; > push (@match_patterns, "Enable Storage Foundation Management Server > Management" ) ; > > my $timeout = 1000 ; > my $expect = $cluster->getExpect ($hosts[0]); > $expect->expect($timeout, '-re', "MyPrompt>"); > $expect->send("ls -l\r"); > $expect->expect($timeout, '-re', "MyPrompt>"); > $expect->send ( "cd $buildarea\r" ) ; > $expect->expect($timeout, '-re', "MyPrompt>"); > $expect->send ( "./installsfcfs\r" ) ; > > > while (1) > { > my ( $matched_pattern_pos, $error, $matched_string, $before_match, > $after_match) = $expect->expect( $timeout, '-re', @match_patterns ) ; > $testEc->log ( "\n\nMatched String : $matched_string\n\n" ) ; > $testEc->log ( "\n\nMatched String : ", $matched_string, "\n\n" ) ; > } > <<<<<<<<<<<<<<<<<< > > The first line the "./installsfcfs" script prints is "Enter the > system names separated by spaces on which to install SFCFS:", now the > problem is > > $testEc->log ( "\n\nMatched String : $matched_string\n\n" ) ; ===> is > printing following message in the log files. > Matched String : Enter the system names separated by spaces on which to > install SFCFS > > and > > $testEc->log ( "\n\nMatched String : ", $matched_string, "\n\n" ) ; ==> > is printing > Matched String : > > This is something unexpected behavior, I am not getting why the > variable $matched_string is getting printed only if it is > included in the quotes. > > I think I am doing something wrong here, so Please help? > > Thanks and Regards, > Prasad. > > > |