testing asynchronous events in RF

127 views
Skip to first unread message

Steve

unread,
Nov 7, 2011, 11:48:59 PM11/7/11
to robotframework-users
I'm a noob so any advice is welcome.

Can anyone advise the best approach to driving and recording tests for
a system of asynchronous processes?

Broadly my scenario is
1) Send test data to external equipment
2) Check responses from a number of sensors.
3) Avoid race conditions (response arriving before the capture is
ready)

The classic programmed approach would be to
1) Launch asynchronous processes to capture responses
2) Send stimulus
3) Await responses

The only implementation that I can see is to use OperatingSystem
library to spawn external non-framework processes.
I am reluctant to code outside RF for this because this would raise
issues about validating that test code.

Any suggestions?

Steve

Pekka Klärck

unread,
Nov 12, 2011, 3:52:44 PM11/12/11
to stevecg...@gmail.com, robotframework-users
2011/11/8 Steve <stevecg...@gmail.com>:

> I'm a noob so any advice is welcome.

Welcome aboard!

It seems to me you cannot avoid creating your own test library for
this purpose. If you have a suitable command line tool, you might be
able to send messages fairly easy using Run keyword from
OperatingSystem, but I doubt listening for replies works that way.

You didn't tell much details about your use case, but if it is some
kind of protocol testing the new Rammbock library [1] might work for
you or at least help writing your custom libraries. It is in very
early alpha state at the moment, though, and also likely to go through
a big internal change in the near future. If you tell a bit more about
your use case then we might be able to help more.

[1] https://github.com/robotframework/Rammbock

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Steve

unread,
Nov 18, 2011, 7:07:37 PM11/18/11
to robotframework-users
Peke,

May thanks for your response.

Yes my SUT is a protocol conversion box.
I propose to send stimulus to a serial port on the box and check the
responses on another serial port on the box.

I need to ensure that I see responses immediately following my
stimulus.

My initial thought was to use external OS facilities to launch a
parallel response reader process before sending the stimulus.

My current thinking is to use the standard OS file open to start
buffering the responses; and then write the stimulus then read the
responses from the file system buffers.


Steve


On Nov 13, 7:52 am, Pekka Klärck <p...@iki.fi> wrote:
> 2011/11/8 Steve <stevecgelli...@gmail.com>:

Pekka Klärck

unread,
Nov 20, 2011, 5:52:34 PM11/20/11
to stevecg...@gmail.com, robotframework-users
2011/11/19 Steve <stevecg...@gmail.com>:

>
> Yes my SUT is a protocol conversion box.
> I propose to send stimulus to a serial port on the box and check the
> responses on another serial port on the box.
>
> I need to ensure that I see responses immediately following my
> stimulus.
>
> My initial thought was to use external OS facilities to launch a
> parallel response reader process before sending the stimulus.
>
> My current thinking is to use the standard OS file open to start
> buffering the responses; and then write the stimulus then read the
> responses from the file system buffers.

Sounds like this should be pretty easy to implement in your custom
test library. For the serial port connection part you probably should
take a look at this Python module:
http://pyserial.sourceforge.net/

Reply all
Reply to author
Forward
0 new messages