Python API testing

283 views
Skip to first unread message

Ashish Kurian

unread,
Mar 3, 2017, 8:05:34 AM3/3/17
to ostinato
Dear Folks,

I wanted to use the python API to generate a traffic pattern of variable packet size and frequency of generation. So just to start learning how the API works, I was following the python API scripting tutorial and was testing the basic ostinato.example. But I am getting the following error. When I was prompted with the Drone's IP address, I typed in 127.0.0.1 and hit enter. I got the following error saying connection refused. Can some one help me in identifying what I am doing wrong.



Best Regards,
Ashish Kurian
ostinato.png

Srivats P

unread,
Mar 3, 2017, 8:15:48 AM3/3/17
to Ashish Kurian, ostinato
Ashish,

When you entered Drone address as 127.0.0.1 (the loopback address) you
specified that Drone is running on the same host (that's why the
loopback address). So looks like you are not running Drone on the same
host.

Could you please join the mailing list so that your emails don't go
into the moderation queue -
https://groups.google.com/group/ostinato/subscribe

Srivats
> --
> Get Ostinato News and Updates on Twitter - Follow @ostinato
> (http://twitter.com/ostinato)
> ---
> You received this message because you are subscribed to the Google Groups
> "ostinato" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ostinato+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://ostinato.org/
@ostinato

Ashish Kurian

unread,
Mar 3, 2017, 8:26:47 AM3/3/17
to ostinato, ashi...@gmail.com
Dear Srivats,

I am having Ubuntu as a virtual machine using virtual box. I have windows as the host.

I have opened up a terminal and gave the command "sudo python -m ostinato.example". So I think I am running the drone on the same host.

Srivats P

unread,
Mar 3, 2017, 8:27:45 AM3/3/17
to Ashish Kurian, ostinato
Assuming you are running python on the Ubuntu VM, you need to run
Drone also on the VM - not on the Windows host.

Srivats

Ashish Kurian

unread,
Mar 3, 2017, 8:42:02 AM3/3/17
to ostinato, ashi...@gmail.com
Dear Srivats,

I was doing a mistake. I was not running the drone instance at all. Now I did that and got another error regarding client version.

Drone's Hostname/IP [127.0.0.1]: 127.0.0.1
INFO:__main__:connecting to drone(127.0.0.1:7878)
INFO:ostinato.rpc:invoking RPC checkVersion(VersionInfo): VersionCompatibility
ERROR:__main__:incompatible version 0.8 (Drone needs client version 0.7.x)
Traceback (most recent call last):
  File "/home/ashish/.local/lib/python2.7/site-packages/ostinato/example.py", line 63, in <module>
    drone.connect()
  File "/home/ashish/.local/lib/python2.7/site-packages/ostinato/core.py", line 52, in connect
    (ver.version, compat.notes))
RpcError: incompatible version 0.8 (Drone needs client version 0.7.x)

Do you know how I can fix this?

Srivats P

unread,
Mar 3, 2017, 8:54:45 AM3/3/17
to Ashish Kurian, ostinato
Run the same version of Drone and Python-Ostinato

Srivats

Ashish Kurian

unread,
Mar 3, 2017, 9:10:44 AM3/3/17
to ostinato, ashi...@gmail.com
Dear Srivats,

I suppose my client version now is 0.8 and the drone is saying that it needs client version 0.7.x. When I tried to download the latest .deb packages for the ostinato, it is asking for a price. Is it not free?

Srivats P

unread,
Mar 4, 2017, 12:55:47 AM3/4/17
to Ashish Kurian, ostinato
Ashish,

>Is it not free?

I'm currently experimenting with a "Pay what you want" model for
binary downloads to help sustain the project.

The project remains open-source as always. You are free to build from source.

Srivats

Ashish Kurian

unread,
Mar 7, 2017, 4:54:54 AM3/7/17
to Srivats P, ostinato
Dear Srivats,

I am trying to build the package. But I am getting error when trying to install the dependency QT on my machine. I have searched for the error that I am getting but could not find any solution. Which version of QT did you install? Did you install the QT from a tar ball or from git hub?

Best Regards,
Ashish Kurian

Srivats P

unread,
Mar 7, 2017, 10:29:16 AM3/7/17
to Ashish Kurian, ostinato
Ashish,

Follow the build instructions in the developer guide - http://ostinato.org/docs/

As specified in the guide you need a version >= Qt4.3 but less than Qt5.

To install Qt, use your package manager if you are on Linux or use the
Qt binary packages if you are on Windows or Mac OSX.

Or skip all the hassle of installing dependencies, building from
source etc. and enjoy the ready made built binary executable by paying
the nominal amount for it.

Srivats
--
http://ostinato.org/
@ostinato

Ashish Kurian

unread,
Mar 8, 2017, 3:08:38 AM3/8/17
to Srivats P, ostinato
Dear Srivats,

Thank you for your response. Finally I managed to build it and now I can run the package. Next I need to write my python script to generate the required traffic pattern.
Is there some video tutorials or more example script to learn the scripting other than that provided in the example.py?

Best Regards,
Ashish Kurian

--
http://ostinato.org/
@ostinato

--
Get Ostinato News and Updates on Twitter - Follow @ostinato (http://twitter.com/ostinato)
---
You received this message because you are subscribed to the Google Groups "ostinato" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ostinato+unsubscribe@googlegroups.com.

Srivats P

unread,
Mar 8, 2017, 9:48:02 AM3/8/17
to Ashish Kurian, ostinato
https://userguide.ostinato.org/PythonScripting.html and example.py is
the only documentation available.

You can look at simple-ostinato which is a wrapper around
python-ostinato but has better documentation -
https://github.com/little-dude/simple-ostinato

Srivats
>> email to ostinato+u...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>



--
http://ostinato.org/
@ostinato
Reply all
Reply to author
Forward
0 new messages