Commit Graph

21197 Commits

Author SHA1 Message Date
Prasanna Santhanam 048352f2f6 marvin_refactor: AccountFactory doesn't need hashing
SHA encryption is applied by the server
2013-10-31 13:54:17 +05:30
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 47807e8452 marvin_refactor: Fix merge issues with remoteAccessVPNResponse, and server
Duplicated methods creep in from bad merge

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 e88d2fcf5d simulator: removing cyclic dependency from simulator
The database creator caused a cyclic dependecny in the simulator which
is removed with this commit. Additionally the simulator profile is now
merged with developer profile and a test for server health is included

Steps to run:
$ mvn -Pdeveloper clean install
$ mvn -Pdeveloper -pl developer -Ddeploydb
$ mvn -Pdeveloper -pl developer -Ddeploydb-simulator
$ mvn -pl client jetty:run

To deploy an adv. zone and test the server health:
$ mvn -Pdeveloper,marvin -Dmarvin.config=`find . -name simulator.cfg` -pl :cloud-marvin test
2013-10-31 13:54:14 +05:30
Prasanna Santhanam 9c78bd5bc6 removing unused commented dependencies
removing the spring related dependencies that were commented out.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2013-10-31 13:54:14 +05:30
Prasanna Santhanam 940c0508df new pom for dbcreator classes
reuse the setup as a cloudstack-setup-db project
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 676997c8a3 simulator: removing cyclic dependency from simulator
The database creator caused a cyclic dependecny in the simulator which
is removed with this commit. Additionally the simulator profile is now
merged with developer profile and a test for server health is included

Steps to run:
$ mvn -Pdeveloper clean install
$ mvn -Pdeveloper -pl developer -Ddeploydb
$ mvn -Pdeveloper -pl developer -Ddeploydb-simulator
$ mvn -pl client jetty:run

To deploy an adv. zone and test the server health:
$ mvn -Pdeveloper,marvin -Dmarvin.config=`find . -name simulator.cfg` -pl :cloud-marvin test
2013-10-31 13:54:13 +05:30
Prasanna Santhanam c7a46a8995 removing unused commented dependencies
removing the spring related dependencies that were commented out.

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
Sheng Yang 3205cd42b5 CLOUDSTACK-730: Site-to-site VPN between VPC VR to VR
Now VPN connection can be created as "passive", which would enable the ability
of remote peer initiate the connection. So it's possible for VPC VR to
establish the connection to another VPC VR of CloudStack.

Test case also included.

The test case would create 2 vpcs and using VPN to connect them.
2013-10-30 19:30:22 -07:00
Darren Shepherd 1460196496 Centralize loading of db.properties to one place
There is now a method DbProperites.getDbProperties() that will load the
db.properties in one place and do the proper decryption of values if needed
2013-10-30 17:03:13 -07:00
Anthony Xu 27294a3827 CLOUDSTACK-4750
use interface wildcard "+" in iptables to cover potential used VLAN interface to allow output on physical interface.

you will see
 0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           PHYSDEV match --physdev-out bond2+ --physdev-is-bridged
instead of
 0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           PHYSDEV match --physdev-out bond2.1234 --physdev-is-bridged

Anthony
2013-10-30 15:12:21 -07:00
Hugo Trippaers 9d2271d115 Revert "fixed m2eclipse error" because it breaks packaging
This reverts commit 5bcd8280fd.
2013-10-30 20:17:59 +01:00
Brian Federle 25d4333d45 Rename 'socket info' title to 'hypervisors'
Rename 'socket info' title to 'hypervisors' to make it more generic, as
the dashboard section contains hypervisor host counts which are useful
in other contexts.
2013-10-30 11:37:54 -07:00
Brian Federle 2189da6c72 CLOUDSTACK-4758: Make root disk size a text field 2013-10-30 11:20:02 -07:00
Will Stevens  8871cdc03a Add support for multiple networks in the 'per account' source nat type setting in external network devices
Signed-off-by: Sheng Yang <sheng.yang@citrix.com>
2013-10-30 10:16:00 -07:00
ynojima a6b6fa65fa CLOUDSTACK-4932: bugfix : listNetworks API doesn't return VLAN ID (VNI)
Signed-off-by: ynojima <mail@ynojima.net>
Signed-off-by: Toshiaki Hatano <haeena@haeena.net>
2013-10-31 00:37:04 +09:00
ynojima 089026f6af CLOUDSTACK-4984: decrement MAX_VXLAN_VNI to be aligned with Linux kernel
Linux vxlan interface doesn't accept VNI:16777215 now.

Signed-off-by: Toshiaki Hatano <haeena@haeena.net>
2013-10-31 00:13:54 +09:00
Sowmya Krishnan af4f78ecca CLOUDSTACK-4776: New Tests for Netscaler as external device 2013-10-30 16:57:21 +05:30