354 Commits

Author SHA1 Message Date
Prasanna Santhanam
ceea53cd8f marvin: remoteSSHClient logger handler
send the logs to the console stream
2012-12-13 19:22:49 -08:00
Prasanna Santhanam
fb5ea25a4d marvin: remoteSSHclient logs
Adding logging for commands sent, and executed with results returned
frmo the remote host.
2012-12-13 15:58:36 -08:00
Prasanna Santhanam
f05cd36634 marvin: assertions with messages for common.py 2012-12-13 15:25:39 -08:00
Prasanna Santhanam
fd6be7a37b marvin: establishing some defaults
when logging in just use defaults if no service dict values are provided
2012-12-13 14:09:20 -08:00
Rohit Yadav
1551b982c4 cli: Handle command breaks, ctrl+c, don't break the shell
- Fix handles shell loop
- Handles any control breaks without breaking the shell
- Handles ctrl+c to start afresh on the shell

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-12 15:21:03 -08:00
Prasanna Santhanam
864ab37e13 marvin lib: changes for accomodating vpc related apis
new apis for the integration lib for VPCOffering, VPC, NetworkACL Apis.
Also some extra checks from for avoiding KeyErrors in the Services dict.
2012-12-12 11:07:28 -08:00
Prasanna Santhanam
e49b3b27de marvin: storagetype reference only when attr present
reference the storagetype only when present. storagetype is reqd only for
devcloud style tests
2012-12-09 23:13:24 -08:00
Prasanna Santhanam
7d4e65740b marvin: assertion check when fetching featured templates 2012-12-09 22:15:38 -08:00
Prasanna Santhanam
3ba8dc455f Smoke Tests: incorrect self reference in setUpClass
should be cls.apiClient and not self.apiClient
2012-12-09 22:15:37 -08:00
Prasanna Santhanam
8466ff1e1f Marvin: Provide a userApiClient for executing with user permissions
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
2012-12-09 22:15:30 -08:00
Prasanna Santhanam
a7d7f85e40 Marvin doesn't require python 2.7, the tests do
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
2012-12-07 17:17:02 -08:00
Prasanna Santhanam
d1e49a0500 Marvin: testClient close calls try to close the dbConnection
dbConnections are auto-managed do not need explicit closing

Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1354919683 -0800
2012-12-07 14:35:53 -08:00
Prasanna Santhanam
21819dafb5 Summary: Devcloud tests for vm life cycle
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
2012-12-05 18:15:11 -08:00
Prasanna Santhanam
2c561dd3a8 Summary: Removing ostypeid dependencies from tests
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
2012-11-29 15:41:56 -08:00
Rohit Yadav
51a5919be1 devcloud: fix configuations for default devcloud.sql
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>
2012-11-28 23:32:31 -08:00
Rohit Yadav
af12a25a60 devcloud: Update IP as per new DevCloud appliance
The new DevCloud nic (host-only) IP is 192.168.56.10 by default

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-27 18:15:24 -08:00
Rohit Yadav
3e8655b580 cli: Handle badline http error
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-21 18:27:11 +05:30
Rohit Yadav
3b2e715888 cli: string fixes, use the major,minor version numbers same as CloudStack
<cloudstack major>.<cloudstack minor>.<cloudmonkey increment number>

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-20 14:56:34 +05:30
Rohit Yadav
f7ba73f7d9 CLOUDSTACK-504: Remove duplicate cloud-set-guest-password script
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>
2012-11-20 12:33:35 +05:30
Rohit Yadav
5a2e15f67c CLOUDSTACK-522: Log requests in cloudmonkey's log
Patch fixes cloudmonkey to log requests in the log_file.
Summary:
  - Fixes logger
  - Fixes color print issue
  - Fixes welcome message
  - Makes code pep8 compliant

BUG-ID : CLOUDSTACK-522
Reviewed-by: Rohit Yadav <bhaisaab@apache.org>
Reported-by: Rohit Yadav

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-20 12:20:23 +05:30
Chip Childers
f7d2041056 Added exit as a cloudmonkey command, in addition to the existing quit command.
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-11-19 14:39:58 -05:00
Chip Childers
311ef69a77 CLOUDSTACK-514: Added protocol and path support to cloudmonkey.
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>
2012-11-19 14:24:10 -05:00
Chip Childers
2ee9253c78 CLOUDSTACK-514: Adding https and api path support to Marvin.
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>
2012-11-19 12:06:18 -05:00
Rohit Yadav
1169464e35 cli: add exec rule to compute precache on mvn compile
Patch adds rules in maven to create precached file using cachegen

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-19 05:28:24 +05:30
Rohit Yadav
dc3c263d0f cli: move common code to common module
- 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>
2012-11-19 05:28:23 +05:30
Rohit Yadav
9070795be0 cli: precache generator
- Adds precache generator for all verbs in grammar
- ignore precache.py

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-19 05:28:23 +05:30
Rohit Yadav
7f08c9db57 cli: rename version to common
The idea is to refactor and put common code in common module

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-19 05:28:23 +05:30
Rohit Yadav
bbb2a56acb cli: refactoring, new grammar rules and command fixes
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-17 17:38:18 +05:30
Rohit Yadav
7ce53e89aa cli: make parse in posix mode
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>
2012-11-17 04:07:35 +05:30
Rohit Yadav
aa3ae45e6b CLOUDSTACK-499: Fix cloudmonkey's request and response methods
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>
2012-11-16 22:18:32 +05:30
Rohit Yadav
8ea2cc4e57 marvin: raise error so cli can pick it up
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-16 22:18:32 +05:30
Prasanna Santhanam
6e86fac8e5 Summary: Add autoscale categories
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
2012-11-16 16:25:59 +05:30
Rohit Yadav
08d16cf4d1 cli: Handle HTTP and URL errors
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-15 18:43:51 +05:30
Rohit Yadav
7ae8c4ad7e cli: Split using only space
Patch fixes lexical parser for default argument on shell.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-15 18:43:51 +05:30
Prasanna Santhanam
c290bf6cd0 Summary: xml reports library changes
Detail: unittest-xml-reporting 1.4 - the verbose option is available via
settings.py.

Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1352448075 +0530
2012-11-09 13:31:15 +05:30
Rohit Yadav
086b2e15af apidocs: remove whitespace while passing commands.in for apidocs
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>
2012-11-08 16:33:04 +05:30
Rohit Yadav
c667eee570 cli: make commands pipe-able as on bash, on the shell
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>
2012-11-08 12:35:20 +05:30
Marcus Sorensen
6e23cad126 Summary: Add Bugfix-for line to prepare-commit-msg
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
2012-11-07 10:07:07 -07:00
Rohit Yadav
8e64f34012 cli: autocomplete to assignment, adds syntactic sugar
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-07 18:34:23 +05:30
Rohit Yadav
5e293f422d cli: add maven plugin to delete copied marvin folder on fresh install
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-07 16:06:01 +05:30
Rohit Yadav
a5ad9c3c50 cli: fix keyerror in help doc handler
- Check and then print help docs
- Add verb configure

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-07 16:05:01 +05:30
Rohit Yadav
36e7a7884e cli: fix autocompletion binding bug, make all params lowercase
- 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>
2012-11-06 19:41:07 +05:30
Rohit Yadav
ac8ae30658 cli: fix argument parsing for set command, fixes unicode monkey char
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 17:59:53 +05:30
Rohit Yadav
77e957c91b cli: fix python sdist, add readline as installation requirement
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 17:06:11 +05:30
Rohit Yadav
b713865308 cli: pip install cloudmonkey works
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>
2012-11-06 16:07:42 +05:30
Rohit Yadav
a94f6f19bb cli: make parsing robust using shlex
Parsing bug fixed using the simple lexical analysis library

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 15:19:08 +05:30
Rohit Yadav
5c24c34d7f cli: use partition instead of split to parse through args
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>
2012-11-06 14:54:35 +05:30
Rohit Yadav
9e6b366023 cli: add autocompletion and dynamic help doc
- 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>
2012-11-06 14:28:40 +05:30
Rohit Yadav
a1089c4304 cli: move code, refactor and add docstring
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-06 14:28:40 +05:30
Rohit Yadav
d0f9610355 cli: add feature to cache docstrings for an api
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>
2012-11-06 14:28:39 +05:30