Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/Help-with-waiting-for-expression.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Help with waiting for expression

Posted by newbie (newbie), 6 December 2005
Hello all.  I have a script that is run on one machine and then spawns a telnet to another machine where it sources another script.  This second script takes approximately 20 minutes to run and will either log a PASS or FAIL message when it is complete.

The problem I am experiencing is that when I start my script it telnets to the second machine and sources the second script fine.  However after about 5 minutes the script aborts without any indication why it aborts.  I have a large timeout value that is not reached.  If the timeout was reached I would see an error message reporting the timeout has exceeded. I do not see this message.

Also if I am on the second machine and manually source the second script it is able to run to completion. I only experience the problem when my first script runs and then telnets to the second machine and sources the second script.

Am I running out of some resources somewhere that I am not aware of?

Any help would be appreciated.  Thanks so much.

newbie

Posted by admin (Graham Ellis), 7 December 2005
The process runs correctly to completion when you log in directly on the box on which it runs, and it fails via telnet and expect from a remote box.

What happens when you run it with telnet but without expect fromthe remote box?   I suspect it will fail; I suspect that the telnet daemon on the server drops conenctions if there's been no activity for a certain period.

Posted by newbie (newbie), 8 December 2005
Thanks for the tip.  I do not expect that it is the telnet that is timing out.  I check and the tcp_keepalive_time is set to 7200 which is two hours on both systems.  

I do suspect that the expect buffer is filling up waiting to match the PASS or FAIL options.  The second script on the second machine generates alot of output.  I tried running the script without expecting the FAIL or PASS regexp.  I just sent the command to source the second script after telnetting to the second machine and then waited for 20 minutes.  This worked fine.

So now I am trying to figure out how to detect a full expect buffer and clear it while waiting for the PASS or FAIL keywords.  Any suggestions on achieving this would be appreciated.

Thanks again for your assistance!

newbie

Posted by admin (Graham Ellis), 8 December 2005
If the ouput is many, many lines long, why not write a loop which expects a \n OR the word PASS or FAIL ... and drop out of the loop only in the latter cases?    Even if that does not sort your problem out, it will let you understand where it's failing much better and help led you to a solution



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho