I was thinking of using the pseudo terminal driver to fake user input
to test an application I have written.
Are there any examples using pseudo terminal driver to fake input to a
program such as VMS mail etc? I would be thinking doing dir, set folder
etc and capture results.
In the end I wish to run my program and read commands from a file and
enter them to my program and capture the results.
Any hints on how to implement such a program?
Just as a note in the latest version of the I/O Reference guide in
Appendix D Control Connection Routines are the pseudo driver routines
incorrectly labelled as PDT?
Thanks
Stuart
example of psuedo terminal use
http://h18000.www1.hp.com/support/asktima/appl_tools/18JUN93COS_C265.html
Well, the simplest is to run it from a command file and do something like
$ define/user sys$output test.log
$ run myprogram
input 1
input 2
input 3
...
$ exit
The most common form of what you are asking for (a test harness) from a
program tends to create a subprocess and then send commands to it through a
mailbox (you can find examples of this on code on the freeware CD) and reads
the output from a mailbox.
In DECset there is a tool called DTM. It does this.
I cannot recommend using it in X windows mode on a VAXstation,
unless you have lots of time to kill. In character terminal mode
on just about any VMS system, or in X windows mode on an Alpha or
IA64 it should be fine.
The DTM test manager (part of the DECset package) has this testing
capability, and can perform the verification of the output and other
related tasks. I'd expect there are other options here, as well.
..
:> In the end I wish to run my program and read commands from a file and
:> enter them to my program and capture the results.
:>
:> Any hints on how to implement such a program?
:>
:
:Well, the simplest is to run it from a command file and do something like
:
:$ define/user sys$output test.log
:$ run myprogram
:input 1
:input 2
:input 3
:...
:$ exit
Or you can use PIPE with the < input file specifier, assuming V7.1
or later.
---------------------------- #include <rtfaq.h> -----------------------------
For additional, please see the OpenVMS FAQ -- www.hp.com/go/openvms/faq
--------------------------- pure personal opinion ---------------------------
Hoff (Stephen) Hoffman OpenVMS Engineering hoff[\0100]hp.com
DTM which was mentioned used the pseudo terminal code. They
take advantage of the start middle and end read notification. They need
that so they can make terminal reads starts and ends.
Forrest
I wonder if DTM can be used in combination with other strategies to
provide the long sought-after automation capability for such things as
SET HOST/DUP...
--
David J. Dachtera
dba DJE Systems
http://www.djesys.com/
Unofficial Affordable OpenVMS Home Page:
http://www.djesys.com/vms/soho/
>
> I wonder if DTM can be used in combination with other strategies to
> provide the long sought-after automation capability for such things as
> SET HOST/DUP...
>
Yes and no. I 've written a kind of FTP wrapper using pseudo terminals.
FTP communicates using lines, i.e. a string of ascii followed by CR/LF.
I gave up playing with such a wrapper for a telnet session, mainly
because
telnet ( or set host/...) is more character based, and I couldn't get
the middle of read
and end of read ast fire at the middle or end of the read reliably.
They seemed sometimes to lag behind the actual characters coming in.
Probably I did something wrong, but it wasn't straightforward.
Jose