Commit Graph

860 Commits

Author SHA1 Message Date
Prasanna Santhanam d84535ee10 marvin_refactor: Working around CLOUDSTACK-2126
Marvin deserializes by matching attributes of the response with the
responseObject expected. In case the object's attributes don't mirror
the response Marvin assumes the response is invalid and can't return a
proper first class entity. This makes it difficult for tests to
reference the object's attributes in a sensible way.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:16 +05:30
Prasanna Santhanam 7c60c563d1 marvin_refactor: make the module structure more relevant and simple
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:16 +05:30
Prasanna Santhanam 580aa13e25 marvin_refactor: SubFactory or RelatedFactory
Can't make up my mind!!???
2013-10-31 13:54:16 +05:30
Prasanna Santhanam 7663f620e0 marvin_refactor: use _adjust_kwargs for cleaning
_adjust_kwargs is useful for any pre-generation cleaning of **kwargs by
factory_boy
2013-10-31 13:54:16 +05:30
Prasanna Santhanam a8f7364127 marvin_refactor: register is the real create
createTemplateCmd does a template of a VM
while
registerTemplateCmd does the actual creation of the template in CS
2013-10-31 13:54:16 +05:30
Prasanna Santhanam b862772e46 marvin_refactor: decode the response as first class python object
createAccountResponse is now an instance of createAccountResponse and
not just a plain dict.

TODO:
1. nested entities don't work yet.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:16 +05:30
Prasanna Santhanam c6f0876fe9 marvin_refactor: one shot creation of factories
Build phase will init the bare minimum object required to make the web
request to the mgmt server

Create phase will make the actual request and fill the attributes of the
entity after recieving the response

This allows for one shot creation of the entity using:
EntityFactory.create(apiclient)

over two steps:
factory = EntityFactory()
entity = Entity.create(apiclient, factory)

TODO:
Figure out howto perform related factory creation.
eg: UserFactory.create() inits AccountFactory.create()

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam 0af09a4843 marvin_refactor: call the EntityFactory simply factory 2013-10-31 13:54:15 +05:30
Prasanna Santhanam 414bf4f625 marvin_refactor: subfactory support for users
UserFactory will call on AccountFactory when it needs to be
instantiated.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam c1fd1eb0f6 marvin_refactor: adding isolation methods l3/vlan/gre
also some defaults for factories:
cluster, domain, user, vpn, zone

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam a2ecc162cf marvin_refactor: fix the setup.py for marvin to include factories
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam ea9019abd8 marvin_refactor: remove redundant assignment
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam d2b3c7f100 marvin_refactor: not all factories are required.
Factories are reqd. for entities that come into existense through the
process of a CLoudStack API create command. Some entities are added from
external sources for which factories are not reqd.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:15 +05:30
Prasanna Santhanam aa4651bcc3 marvin_refactor: removing redundant entities
Some entities do not conform to the CRUD format and define extra verbs -
eg: markDefaultNicForVirtualMachine, ldapConfig, ldapRemove etc.

These are refactored and combined into their respective entities.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam cb35216f80 marvin_refactor: working virtulmachine test
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam dcd96afd16 marvin_refactor: sg offering test
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam 0f8a9ae4b9 marvin_refactor: actions on entity object require id for performing the action
For eg:
1. nf = NetworkOffering.create(apiClient, NetworkOfferingFactory())
2. nf.update(apiClient, state='Enabled')

Operation #2 requires that nf's id be supplied to enable the network
offering

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam b4ecf77de2 marvin_refactor: Factories for DiskOffering, ServiceOffering
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam e0968d6937 marvin_refactor: VNS device APIs, VMSnapshot APIs, changes to factory creation
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam 776124914b marvin_refactor: create takes factories not reqd args
- Let all entities inherit from CloudStackEntity
- create and list are classmethods since they work without need for an
  entity to exist
- create takes only factories by default. no need for long param list.
    Entitiy.create(apiclient) will give entity out of default factory
- Use entityFactory.attributes() to init entities

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:13 +05:30
Prasanna Santhanam dda9ae28f3 marvin_refactor: factories for each api entity
factories will help define default test data for each entity. So a

Account.create(apiclient) returns a default account
VirtualMachine.deploy(apiclient) returns a virtualmachine etc

WIP: only skeletons, no flesh

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:13 +05:30
Prasanna Santhanam a5bd827c24 marvin_refactor: update the entity dict but not through optional kwargs
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:13 +05:30
Prasanna Santhanam 35c7c5713a marvin_refactor: fixing unittests
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:13 +05:30
Prasanna Santhanam 5ee671fc9a marvin_refactor: base dict object updated as **kwargs from factory
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:13 +05:30
Prasanna Santhanam f0b9b274ee marvin_refactor: VNS device APIs, VMSnapshot APIs, changes to factory creation
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:13 +05:30
Prasanna Santhanam ae49eb9d27 marvin_factories: inherit from ABSTRACT_FACTORY
This is done to remove dependency on an ORM.

+ Additional APIs from multiple ip per nic.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam fa00dc9f9b marvin_refactor: add body to all the entities in base
- don't do package import of cloudstackentity
- create() and list() method will return obj(s) of type(Entity)

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam 93438f2df0 marvin_refactor: create takes factories not reqd args
- Let all entities inherit from CloudStackEntity
- create and list are classmethods since they work without need for an
  entity to exist
- create takes only factories by default. no need for long param list.
    Entitiy.create(apiclient) will give entity out of default factory
- Use entityFactory.attributes() to init entities

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam 23a2042df0 marvin_refactor: fixing the imports
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam 6ffe0c42a8 marvin_refactor: split base into multiple modules
Each entity goes into its own module
Append ASF license header to the entity

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam c03c700a64 marvin_refactor: factory info required only for create-able entities
entities come in to life on 'create', 'deploy', 'associate', 'register'

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam d6cf83ebb4 marvin_refactor: factories for each api entity
factories will help define default test data for each entity. So a

Account.create(apiclient) returns a default account
VirtualMachine.deploy(apiclient) returns a virtualmachine etc

WIP: only skeletons, no flesh

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:12 +05:30
Prasanna Santhanam 60a255b6a4 marvin_refactor: code generator for marvin base library
The generateBase.py will give out Entity.(create|update|list|delete)
style python modules for use by the integration library.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:11 +05:30
Gaurav Aradhye 1972d6121d Adding missing test cases: Snapshots Improvement 2013-10-29 23:42:38 +05:30
Daan Hoogland 30aea0b308 forgot about rat 2013-10-29 14:35:45 +01:00
Rajani Karuturi 4c6add84d8 eclipse code formatter settings xml file 2013-10-29 14:03:27 +01:00
Prasanna Santhanam 6a904d2f9b fix pep8
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-29 16:19:48 +05:30
Prasanna Santhanam ddf4dfa60a marvin: enable the nose-marvin plugin using the --with-marvin directive
enable the marvin plugin when the --with-marvin directive is given to nose. The
enableOpt value is set from the command line directive and self.enabled
(True|False) determines whether marvin's tests will run.  By default
non-default plugins like marvin will be disabled"

This fixes regression from 03830c5

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-29 15:46:50 +05:30
Min Chen 6be228a438 CLOUDSTACK-4024:Provide a way to upgrade from existing NFS secondary
storage to S3.
2013-10-28 21:01:31 -07:00
Santhosh Edukulla 03830c570e Adding few changes and cleaning up the code
- Added few common naming conventions
- Cleanedup code
- Added a simple utility function

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
2013-10-28 12:49:41 +05:30
Santhosh Edukulla b4ceefa469 Adding readable start and end time stamps
Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
2013-10-28 11:29:27 +05:30
Abhinandan Prateek 499a8c0915 syncing 64 bit svm scripts 2013-10-24 18:52:13 +05:30
Santhosh Edukulla 0780604503 CLOUDSTACK-4885: basic timing profiler for tests
This will add time taken in seconds along with start and end timestamp
logging facility for test cases.Currently this is not
available for console logs

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
2013-10-24 14:52:53 +05:30
John Kinsella 45e4d4fc3b Summary: Updated sudoers approved commands for cloud user
Detail: Previously the cloud user has full password-less sudo access.
This commit changes that to only allow access to a specific list of
commands. Been tested in production on ACS 4.0 and 4.2 mangement servers.

BUG-ID: CLOUDSTACK-967
Bugfix-for:
Reviewed-by:
Reported-by:
Signed-off-by: John Kinsella <jlk@stratosec.co> 1382560936 -0700
2013-10-23 13:42:16 -07:00
Santhosh Edukulla d4072c6daa Added few changes related to bug 4920. Removed unwanted code
There were few unwanted calls as part of test client, did some clean up
Made the test client API uniform to accept both mgmt and dbsvr details
Did some minor bug fixes as well.

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
2013-10-23 13:53:43 +05:30
Santhosh Edukulla 3f656b0434 The code module represents enum for constant comparison
This module provides facilitation to use uniform codes across various test
features. Users can import this  module and use these codes to maintain
readability and one point of change.

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
2013-10-22 15:38:48 +05:30
Prasanna Santhanam dfa0678fc6 marvin: a1b979da8 breaks formatting and pep8.
setup/dev/advanced.cfg is used by the simulator deployments that are
usually not https. disabled the http within this config file.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-22 11:59:14 +05:30
Santhosh Edukulla a1b979da86 CLOUDSTACK-4832. Added support for https to marvin.
advanced.cfg: Contains three additional flags "useHttps,certCAPath,certPath"
for https usage in marvin for establishing cs connection. We will use the
configuraiton under advanced.cfg provided by user to establish connection over
https. If establishing the connection over https failed, then the default certs
will be used.  or else raise the exception, the existing http will work as it
is when useHttps flag set to "False"

Signed-off-by: Santhosh Edukulla <Santhosh.Edukulla@citrix.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-22 11:32:10 +05:30
Hugo Trippaers c94c0b53fd Rename the definition to we avoid grep problems as grepping for systemvmtemplate would include systemvmtemplate64 2013-10-17 16:05:11 +02:00
Hugo Trippaers 789438651a Fix systemvm build scripts with the new location of the systemvm patches.
And wondering why they are included here and not in the systemvm.iso.

Also giving the systemvm a little more space to fix the out-of-diskspace error during the build
2013-10-17 14:57:33 +02:00