The getUserApiClient attribute in cloudstackTestClient provides a user level
api client that executes all API calls with permissions of a given user instead
of the default admin
To compile marvin using maven any standard python interpreter above 2.4
is sufficient. The tests under test/integration will need 2.7 to run.
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1354929362 -0800
Detail: VM Life cycle tests needed minor changes to run them against a
devcloud - basic zone, local storage envrioment.
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1354760111 -0800
Detail: The listOsTypes API will filter when given the ostype name as
centOS 5.3. There is now no need to hardcode the uuids into the test
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1354228309 -0800
Patch moves config. info from cfg file to .sql file. Adds more options so DevCloud
can run on host-only IPs and cidr.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
There are two duplicates for the script cloud-set-guest-password:
> setup/bindir/cloud-set-guest-password.in
> tools/guest_password/cloud-set-guest-password
The one in tools/guest_password is older and all other scripts are in
setup/bindir. Therefore, keeping the former, removing the latter.
BUG-ID : CLOUDSTACK-504
Reviewed-by: Rohit Yadav <bhaisaab@apache.org>
Reported-by: Rohit Yadav
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This is the second half of making cloudmonkey and marvin more
flexible in environments that may have https enabled and / or
a different path for the cloudstack API.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
This is the first part of fixing CLOUDSTACK-514, and is hopefully
backward compatible with previous use of Marvin. I added two new
parameters to the cloudstackConnection module, protocol and path.
Both have been defaulted to the previously *assumed* values.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
- Move config, grammar to common
- Cleanup cloudmonkey.py, import from common
- Import precached verbs, if fails init to {}
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Posix mode allows the parse to:
- split by whitespace but value="between quotes are retained or enclose"
- quotes are stripped out
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
The old way of parsing involved complex object loading and traversing, in
new implementation json is used directly and authenticated requests via port
8080 making use of api and secret keys are recommended.
All args on shell are created in {"key": "value"} pairs which are used to create
url with &key=value. This way maps can be passed as args, example:
create networkoffering name=unique-name guestiptype=Isolated traffictype=GUEST
supportedservices=Dhcp,Dns serviceproviderlist[0].service=Dhcp
serviceproviderlist[0].provider=VirtualRouter serviceproviderlist[1].service=Dns
serviceproviderlist[1].provider=VirtualRouter
Added new conf variables:
- timeout: the no. of seconds after which an async job query timeouts
default value of 3600 seconds
- asycnblock: if user wants their async commands to be tracked
default value is 'true', if set to false, user can query using jobid which is
returned by the async command and queried using:
query asyncjobresult jobid=<jobid>
BUG-ID : CLOUDSTACK-499
Reviewed-by: Rohit Yadav <bhaisaab@apache.org>
Reported-by: Dave Cahill
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Detail: Every new API that doesn't have a valid category prefix needs
to be include in the gen_toc.py script for apidocs, marvin and
cloudmonkey to build.
BUG-ID: CLOUDSTACK-501
Reviewed-by: mvn clean install -P developer
Reported-by: Rohit Yadav <bhaisaab@apache.org>
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1353063359 +0530
Detail: unittest-xml-reporting 1.4 - the verbose option is available via
settings.py.
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1352448075 +0530
Due to whitespaces, apidocs was not able to process and generate commands.xml
with APIs listed in ext and virtualrouter .in files. This in turn affects marvin
code generation of cloudstackAPI and cloudmonkey.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Makes commands pipe-able like bash.
Example while inside shell:
> list virtualmachines | grep id
> list accounts | more
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Detail: This reminds us to tag commits that should be considered for a bugfix
release, making them easier to find/apply and less likely to slip through the
cracks. Individual committers really should know best which things need to be
pushed as an immediate bugfix anyway, this makes it easy to tag things as such.
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1352308027 -0700
- fix weird autocompletion bug which won't let you enter the letter b [0]
- make set params, api and secret key vars lowercase
- use partition to get strings for do_set
- while installing, check and only then add readline (requires gcc and can fail)
- show monkey prompt by default, let users change if needed
[0] http://superuser.com/questions/297527/cant-type-the-b-letter-in-python-shell-in-os-x
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Patch makes cloudmonkey installable and redistributable using source dist from
pypi under apache compliant license. Most visible issues have been solved and
cloudmonkey should work well with CloudStack 4.0 and master, also until APIs do
not change.
To install now:
pip install cloudmonkey
or, if you have to:
easy_install cloudmonkey
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Use partition instead of splitting on whitespace. This is little robust, but
may still fail for parameters whose values have whitespaces such as names etc.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
- autocompletions for help docs
- more verbose doc strings with __doc__ import from the module and list of
required args and all args
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
cached verb dictionary stores the following as a list:
- name of the API
- params (list of args)
- docstring
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Search verb in apis takes more time than filtering out apis that start with
that verb from the grammar.
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Version are named in reflection of CloudStack.
<cli major-version>.<cloudstack minor>.<cloudstack.major>
So, for CloudStack 4.1.0, version for cli should be 0.1.4
To create distribution:
python setup.py sdist
python setup.py install
Using pip:
pip install dist/cloudmonkey*
Or pretty soon, from cheese shop:
pip install cloudmonkey
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
cloudmonkey
-----------
Apache CloudStack's very own monkey powered command line interface based on Marvin.
The neglected robot and monkey should rule the world!
Features:
- it's a shell and also a terminal tool
- scalable to find and run old and new APIs
- intuitive grammar and verbs
- autocompletion (functional hack)
- shell execution using ! or shell
- cfg support: user defined variables, like prompt, ruler, host, port etc.
- history
- colors
- dynamic API loading and rule generation
- leverages Marvin to get latest autogenerated APIs
- emacs like shortcuts on prompt
- uses apiKey and secretKey to interact with mgmt server
- logs all client commands
- PEP-8 compliant code
TODOs:
- Reverse search
- Fix input and output processing
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Detail: Integration tests use these libraries (base,utils,common) for
simplifying the usage of the API. These define the verbs of each
entity's usage (create, delete, add etc). For the CLI to present the
simplified API we'll leverage the integration libraries.
+ Fixes to setup-test-data.sh - kvm and xen each use a different version
of the built-in Cent OS template, 5.5 and 5.3 namely.
At a later point the setup-test-data script needs to be obsoleted.
ostypeids in tests should directly be determined from listOsTypes API
calls
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1351520707 +0530
- Fix the default builtin template url. The previous url is not reachable by
public network.
- Remove INSERT statement which already gets inserted in cloud.configuration
by mvn -P developer -Ddeploydb
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
Detail: Create tarball of apidocs for distribution from jenkins
% mvn -Pdeveloper package
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1351321002 +0530
It seems that all the work is going into the installation guide instead
of the "-all" docs.
With this commit we build the installation guide documentation.
Detail: mysql-connector-python developed by Oracle will replace the MIT
licensed pymysql. mysql-connector-python is developed by Oracle and is
more favourable, faster and actively developed.
With this commit - the dbConnection object is also auto managed by
contextlib. Each transaction requests its own connection rather than
sharing one single connection for all the test runs.
BUG-ID : None
Reviewed-by: timeit comparison of pymysql and mysql-connector-python
Reported-by: dbExceptions and timeouts from Marvin test runs
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350732083 +0530
Detail:
Sometimes tests need ssh access to the management server to perform
verification such as:
1. Pings from mgmt_server to agents
2. snapshots exist on secondary storage - mountable from mgmt server
For these the tests will need access to the config of the deployment and
the ip address of the mgmt server.
Egs: integration/component/test_egress.py and integration/component/test_snapshots.py
BUG-ID : CLOUDSTACK-377
Reported-by: Prasanna Santhanam
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1350624903 +0530
Detail: prepare-commit-msg now is skipped if -m flag is supplied, if user has
a template defined, if commit is a squash or a merge.
BUG-ID : none
Reviewed-by: Marcus Sorensen <marcus@betterservers.com>
Reported-by: Marcus Sorensen <marcus@betterservers.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1350600822 -0600
Detail: CloudStack committers can optionally use this file to prepopulate their
commits with a standard form. The idea was that it would help us get better
commit messages. It is set up locally up by running the following from the root
of the repo:
'ln -s ../../tools/git/prepare-commit-msg .git/hooks/prepare-commit-msg'
Additionally, a different prepare-commit-msg could potentially be committed for
each branch and the link will always point to the one that's checked out.
BUG-ID : none
Reviewed-by: Marcus Sorensen <marcus@betterservers.com>
Reported-by: Rohit Yadav <rohit.yadav@citrix.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1350596087 -0600
This is due to the nature of ASF release votes,
and the desire to see each individual artifact be tested.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
There are various READMEs under Cloudstack. This makes it confusing for
finding the purpose of each directory and tool within the project. All
the necessary information can now be found in the top-level README.tools
that is markdown editable. For the most updated information however it
is best to provide a wiki link to the tool you have added. Each tool
lies in a seperate section, please keep formatting unchanged.
There is currently no script to build the docs with, this is an easy script
to build them.
An example how I use it:
$ cd ~wido/repos/cloudstack
$ tools/build/build_docs.sh -s $(echo ~wido/repos/cloudstack)
Signed-off-by: Chip Childers <chip.childers@gmail.com>
I've assumed that Gavin's commit is appropriate, based
on an assumption that we will keep these files in the source
tree. If https://issues.apache.org/jira/browse/LEGAL-146
results in a different opionion from the members, then we
will end up having to do something more drastic anyway.
* traffictypes = 'Guest', 'Management', 'Public', 'Storage'
- corresponding nic labels are given in the labeldict
* External device providers JuniperSrx, NetScaler and F5 load balancing
can now be configured
* examples are shown in the configGenerator.py script for basic,
advanced and EIP/ELB based zones
Conflicts:
tools/marvin/marvin/configGenerator.py
tools/marvin/marvin/deployDataCenter.py
* setup.py is the installer for marvin-nose plugin
* marvin-nose drive all tests using nose with other plugins like xunit, coverage, multiprocess execution etc
* -n option deprecated. All tests driven by nosetests --with-marvin
Using this plugin Nose will drive tests and this also allows using other
nose plugins. Cmd Line plugin support to be added
Conflicts:
tools/marvin/marvin/NoseTestExecuteEngine.py
Using this via Vagrant assumes that Vagrant is patched with the changes
made by Edison. The pull request to upstream these changes into the
Vagrant project are here: https://github.com/mitchellh/vagrant/pull/1043 )
* ant run-simulator - will seed the simulator jar and start CS
* ant run-marvin -Dmarvin.config="/path/config/file" - will
* configure a
cloudstack as per the given configuration. marvin.config - defaults
to a
two host simulator in an advanced zone
You can then connect your debugger over localhost:8787 or use the CS
ui
at localhost:8080/client for testing.
From: Prasanna Santhanam(Prasanna.Santhanam@citrix.com)
Fixed deployDataCenter.py to select the correct network offering based on if security groups are enabled. Also added default value to configGenerator.py for basic setup.
I would like to add an command line option to choose between advanced or basic networking configuration. This would allow me or others to choose advanced networking without having to edit the python code.
CS-14025: Status - Resolved Fixed
1. Packaging the marvin test client into an installable egg
2. There is a hudson job (marvin) that creates eggs for a specified
branch
3. Alternatively you can use the package-marvin ant target to get a
source tarball.
$ant package-marvin
will create a packaged source tarball of the testclient that is
redistributable and decoupled from the rest of the cloudstack build
reviewed-by: unittest
status 14608: resolved fixed
reviewed-by: Chirag Jog (chirag@clogeny.com)
Set the timeout countdown to start from beginning of each pollAsync instead
of setting it once for the entire run.
status 13234: resolved fixed
reviewed-by: unittest
When multiple tests in a user-decorator suite are run only the first
test runs successfully since the apiKey has been altered to that of a
regular user. Preventing failure of other tests by detecting user
context - user, admin, domain-admin.
@UserName decorator applies to a testSuite class not a testMethod
status 13234: resolved fixed
Uncomment each decorator to test
- tests run as existing admin
- tests run as new user in new domain
- tests run as new user in existing domain
- tests run as old user in existing domain
- tests run as new domain admin in new domain
reviewed-by: Chirag Jog
Each testCase class will use its own logger to distinguish log
messages when multiple suites are run. This will aid debugging
Every cloudstackTestCase will also contiain a class level attr of the
testClient which was previously available only to setUp/tearDown. Now
even setUpClass/tearDownClass can use this attribute.
http://confluence.cloudstack.org/display/QA/Testing+with+python
demo.cfg: sample configuration file containing the mgmt server location
testDeployVM.py : simple example demonstrated on confluence tutorial
testSshDeployVM.py : advanced example to demonstrate backend verification
depends on python's internal socket implementation. Added an explicit 3m
timeout. Test code MUST NOT induce sleeps longer than 3m, instead check status
periodically to keep the HTTPConnection alive.
reviewed-by: Chirag Jog <chirag@clogeny.com>
reviewed-by: Kishan
* Revert back to old guestCidrAddress
* Add default traffic types
* fixed typo when creating physical network, specifid wrong zone
* correctly specifying the guest VLAN as part of updating physical network
* zones now have to be configured with physical networks and providers
* enabling the virtual router and configuring it are sperate API action
* create networks of shared type with SG network offering is done implicitly
* SSVM to act as a direct connect agent
* Storage Resources handle SSVM commands
* create-schema.sql already has simulator_network_label. removing the label from create-schema-simulator.sql
from dicts only, lists and tuples which don't contain dicts will be directly
set to the attribute
- eg: listnetworkserviceproviderresponse : servicelist = ['vpn', 'dhcp',
'firewall'] contains no name,value combination to make attributes. So we make
self.servicelist = ['vpn','dhcp','firewall']
1.load hosts that in maintenance mode because maintenance is no longer an agent status now
2.don't disconnect agent when entering maintenance mode, again it's no longer an agent status now