Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Example using pseudo terminal driver

6 views
Skip to first unread message

stuie_...@yahoo.com.au

unread,
Mar 23, 2006, 3:50:19 AM3/23/06
to
Hi Group,

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

Ian Miller

unread,
Mar 23, 2006, 4:28:11 AM3/23/06
to
there is a callable interaface to mail documented in the utility
routines manual.

example of psuedo terminal use
http://h18000.www1.hp.com/support/asktima/appl_tools/18JUN93COS_C265.html

FredK

unread,
Mar 23, 2006, 7:57:44 AM3/23/06
to

<stuie_...@yahoo.com.au> wrote in message
news:1143103819.0...@i40g2000cwc.googlegroups.com...

> Hi Group,
>
> 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?
>

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.


Bob Koehler

unread,
Mar 23, 2006, 8:33:24 AM3/23/06
to
In article <1143103819.0...@i40g2000cwc.googlegroups.com>, stuie_...@yahoo.com.au writes:
> Hi Group,
>
> I was thinking of using the pseudo terminal driver to fake user input
> to test an application I have written.

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.

Hoff Hoffman

unread,
Mar 23, 2006, 12:00:19 PM3/23/06
to
In article <44229b47$1...@usenet01.boi.hp.com>, "FredK" <fred....@nospam.dec.com> writes:
:
:<stuie_...@yahoo.com.au> wrote in message

:news:1143103819.0...@i40g2000cwc.googlegroups.com...
:> Hi Group,
:>
:> I was thinking of using the pseudo terminal driver to fake user input
:> to test an application I have written.


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

Forrest Kenney

unread,
Mar 23, 2006, 11:41:39 AM3/23/06
to

Assuming you have a reasonably current installation look
in sys$examples at logger or alpha_logger.c. They are the same program
just that on VAX it ended up with a different name. It is the code for
the example in the appendix. It will get you started....

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

David J. Dachtera

unread,
Mar 23, 2006, 10:46:44 PM3/23/06
to
Forrest Kenney wrote:
>
>
> Assuming you have a reasonably current installation look
> in sys$examples at logger or alpha_logger.c. They are the same program
> just that on VAX it ended up with a different name. It is the code for
> the example in the appendix. It will get you started....
>
> 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.

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/

Jose Baars

unread,
Mar 24, 2006, 7:31:18 PM3/24/06
to
David J. Dachtera wrote:

>
> 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

0 new messages