From: Roland G. <RGi...@CP...> - 2001-09-29 18:37:02
|
Hoang Ngo wrote: > - Spawn a telnet session into a term server (DigiBoard 8 ports) and obtain > a object handle from that. > > At this point, what happens to my STDIN, STDOUT? How can i print > to the screen that i started the script. Expect gives you a separate file handle for communicationg with the spawned program, so your STDIN and STDOUT are unchanged. The spawned telnets STDIN and STDOUT are connected to the filehandle that Expect->spawn returns, so you send a string to telnet by printing to the returned handle. > - Goes through the normal login procedure with user name and such > - Enter a forever loop. In this loop > get input from keyboard. $command=<stdin> > If the command is one that the script understands - process it > else send the command to the UUT (unit under test), capture the out > put from the command and wait for prompt. > > At this point, i encountered a few problems with capturing the output > of the UUT. Not all the output of the UUT is captured regardless of variations > that i tried. Is it possible that the output of UUT is buffered somewhere? in > Expect? in Xterm? I don't have this problem if i go into interactive mode > ($object->interact()). It would help if you post your code. It might be just a slight semantical misunderstanding or a wrong regexp. > If you have done somthing like this before please drop me a line. Yes, I have written a regression testsuite that does something similar. Hope this helps, Roland -- RGi...@cp... |