Eutester
An interesting tool based on Boto is Eutester it was created by the folks at Eucalyptus to provide a framework to create functional tests for AWS zones and Eucalyptus based clouds. What is interesting with eutester
is that it could be used to compare the AWS compatibility of multiple clouds. Therefore the interesting question that you are going to ask is: Can we use Eutester with CloudStack ? And the answer is Yes. Certainly it could use more work but the basic functionality is there.
Install eutester
with:
pip install eutester
Then start Python/iPython interactive shell or write a script that will import ec2ops
and create a connection object to your AWS EC2 compatible endpoint. For example, using ec2stack:
#!/usr/bin/env python
from eucaops import ec2ops
from IPython.terminal.embed import InteractiveShellEmbed
accesskey="my api key"
secretkey="my secret key"
conn.ec2ops.EC2ops(endpoint="localhost",
aws_access_key_id=apikey,
aws_secret_access_key=secretkey,
is_secure=False,
port=5000,
path="/",
APIVersion="2014-02-01")
ipshell = InteractiveShellEmbed(banner1="Hello Cloud Shell !!")
ipshell()
Eutester at the time of this writing has 145 methods. Only the methods available through the CloudStack AWS EC2 interface will be availble. For example, get_zones
and get_instances
would return:
In [3]: conn.get_zones()
Out[3]: [u'ch-gva-2']
In [4]: conn.get_instances()
[2014-05-21 05:39:45,094] [EUTESTER] [DEBUG]:
--->(ec2ops.py:3164)Starting method: get_instances(self, state=None,
idstring=None, reservation=None, rootdevtype=None, zone=None,
key=None, pubip=None, privip=None, ramdisk=None, kernel=None,
image_id=None, filters=None)
Out[4]:
[Instance:5a426582-3aa3-49e0-be3f-d2f9f1591f1f,
Instance:95ee8534-b171-4f79-9e23-be48bf1a5af6,
Instance:f18275f1-222b-455d-b352-3e7b2d3ffe9d,
Instance:0ea66049-9399-4763-8d2f-b96e9228e413,
Instance:7b2f63d6-66ce-4e1b-a481-e5f347f7e559,
Instance:46d01dfd-dc81-4459-a4a8-885f05a87d07,
Instance:7158726e-e76c-4cd4-8207-1ed50cc4d77a,
Instance:14a0ce40-0ec7-4cf0-b908-0434271369f6]
This example shows that I am running eight instances at the moment in a zone called ch-gva-2, our familiar exoscale. Selecting one of these instance objects will give you access to all the methods available for instances. You could also list, delete and create keypairs. List, delete and create security groups etc.
Eutester is meant for building integration tests and easily creating test scenarios. If you are looking for a client to build an application with, use Boto.
The master branch of eutester may still cause problems to list images from a CloudStack cloud. I recently patched a fork of the testing branch and opened an issue on their github page. You might want to check its status if you want to use eutester heavily.
No comments:
Post a Comment