You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@apache.org on 2013/12/23 13:30:35 UTC
[2/2] git commit: updated refs/heads/4.3 to 80ab47c
CLOUDSTACK-4780: Changes related to checking snapshot path
on NFS server, also made marvin import paths specific
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/80ab47c8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/80ab47c8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/80ab47c8
Branch: refs/heads/4.3
Commit: 80ab47c86945f8949612cbea0e169c4ca9e096bb
Parents: 0faf772
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Mon Dec 23 17:58:51 2013 +0530
Committer: Girish Shilamkar <gi...@clogeny.com>
Committed: Mon Dec 23 18:00:21 2013 +0530
----------------------------------------------------------------------
.../component/test_add_remove_network.py | 6 +-
test/integration/component/test_assign_vm.py | 2 +-
.../component/test_cpu_domain_limits.py | 2 +-
test/integration/component/test_cpu_limits.py | 2 +-
.../component/test_cpu_max_limits.py | 4 +-
.../component/test_cpu_project_limits.py | 2 +-
.../component/test_egress_fw_rules.py | 2 +-
test/integration/component/test_haproxy.py | 2 +-
.../component/test_mm_domain_limits.py | 2 +-
.../integration/component/test_mm_max_limits.py | 4 +-
.../component/test_mm_project_limits.py | 2 +-
test/integration/component/test_snapshots.py | 5 +-
.../component/test_vpc_network_lbrules.py | 5 +-
.../component/test_vpc_network_pfrules.py | 33 +++++-----
.../component/test_vpc_network_staticnatrule.py | 35 +++++-----
test/integration/component/test_vpn_users.py | 4 +-
tools/marvin/marvin/integration/lib/common.py | 68 ++++++++++++++------
tools/marvin/marvin/integration/lib/utils.py | 31 +++++++--
18 files changed, 130 insertions(+), 81 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index f1508e1..4529ec7 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -42,17 +42,17 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
list_virtual_machines,
list_events,
list_zones,
get_free_vlan,
- get_hypervisor_type,
update_resource_limit
)
from marvin.integration.lib.utils import (validateList,
- random_gen)
+ random_gen,
+ get_hypervisor_type,
+ cleanup_resources)
from marvin.cloudstackAPI import (addNicToVirtualMachine,
removeNicFromVirtualMachine,
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_assign_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_assign_vm.py b/test/integration/component/test_assign_vm.py
index cbdce73..400d5f2 100644
--- a/test/integration/component/test_assign_vm.py
+++ b/test/integration/component/test_assign_vm.py
@@ -32,12 +32,12 @@ from marvin.integration.lib.base import (Account,
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
list_volumes,
update_resource_limit,
list_networks,
list_snapshots,
list_virtual_machines)
+from marvin.integration.lib.utils import cleanup_resources
def log_test_exceptions(func):
def test_wrap_exception_log(self, *args, **kwargs):
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_cpu_domain_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_domain_limits.py b/test/integration/component/test_cpu_domain_limits.py
index 4e8fc6d..c427e4f 100644
--- a/test/integration/component/test_cpu_domain_limits.py
+++ b/test/integration/component/test_cpu_domain_limits.py
@@ -30,10 +30,10 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
find_suitable_host,
get_resource_type
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
"""Test resource limit services
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_cpu_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_limits.py b/test/integration/component/test_cpu_limits.py
index d721a45..bdf2869 100644
--- a/test/integration/component/test_cpu_limits.py
+++ b/test/integration/component/test_cpu_limits.py
@@ -30,10 +30,10 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
find_suitable_host,
get_resource_type
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_cpu_max_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_max_limits.py b/test/integration/component/test_cpu_max_limits.py
index 9161cee..317df16 100644
--- a/test/integration/component/test_cpu_max_limits.py
+++ b/test/integration/component/test_cpu_max_limits.py
@@ -30,9 +30,9 @@ from marvin.integration.lib.base import (
)
from marvin.integration.lib.common import (get_domain,
get_zone,
- get_template,
- cleanup_resources
+ get_template
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
"""Test resource limit services
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_cpu_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_cpu_project_limits.py b/test/integration/component/test_cpu_project_limits.py
index 63d1a98..a8a1b3c 100644
--- a/test/integration/component/test_cpu_project_limits.py
+++ b/test/integration/component/test_cpu_project_limits.py
@@ -30,10 +30,10 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
find_suitable_host,
get_resource_type
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
"""Test resource limit services
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_egress_fw_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py
index 09e1dd6..919725f 100644
--- a/test/integration/component/test_egress_fw_rules.py
+++ b/test/integration/component/test_egress_fw_rules.py
@@ -35,8 +35,8 @@ from marvin.integration.lib.common import (get_domain,
rebootRouter,
list_routers,
wait_for_cleanup,
- cleanup_resources,
list_virtual_machines)
+from marvin.integration.lib.utils import cleanup_resources
from marvin.cloudstackAPI.createEgressFirewallRule import createEgressFirewallRuleCmd
from marvin.cloudstackAPI.deleteEgressFirewallRule import deleteEgressFirewallRuleCmd
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_haproxy.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_haproxy.py b/test/integration/component/test_haproxy.py
index c734012..1c8dc63 100644
--- a/test/integration/component/test_haproxy.py
+++ b/test/integration/component/test_haproxy.py
@@ -34,9 +34,9 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
random_gen
)
+from marvin.integration.lib.utils import cleanup_resources
from marvin.cloudstackAPI import createLBStickinessPolicy
from marvin.sshClient import SshClient
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_mm_domain_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_domain_limits.py b/test/integration/component/test_mm_domain_limits.py
index c856087..68660c1 100644
--- a/test/integration/component/test_mm_domain_limits.py
+++ b/test/integration/component/test_mm_domain_limits.py
@@ -29,12 +29,12 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
wait_for_cleanup,
find_suitable_host,
get_resource_type,
update_resource_count
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
"""Test memory resource limit services
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_mm_max_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_max_limits.py b/test/integration/component/test_mm_max_limits.py
index b1ebbb4..e10c119 100644
--- a/test/integration/component/test_mm_max_limits.py
+++ b/test/integration/component/test_mm_max_limits.py
@@ -29,9 +29,9 @@ from marvin.integration.lib.base import (
)
from marvin.integration.lib.common import (get_domain,
get_zone,
- get_template,
- cleanup_resources
+ get_template
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
"""Test memory resource limit services
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_mm_project_limits.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_mm_project_limits.py b/test/integration/component/test_mm_project_limits.py
index ffeb20a..c314011 100644
--- a/test/integration/component/test_mm_project_limits.py
+++ b/test/integration/component/test_mm_project_limits.py
@@ -29,11 +29,11 @@ from marvin.integration.lib.base import (
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
wait_for_cleanup,
find_suitable_host,
get_resource_type
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
"""Test memory resource limit services
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_snapshots.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py
index d3fac42..17579d6 100644
--- a/test/integration/component/test_snapshots.py
+++ b/test/integration/component/test_snapshots.py
@@ -36,12 +36,13 @@ from marvin.integration.lib.common import (get_domain,
list_snapshots,
list_templates,
list_virtual_machines,
- get_hypervisor_type)
+ )
from marvin.integration.lib.utils import (cleanup_resources,
format_volume_to_ext3,
random_gen,
- is_snapshot_on_nfs)
+ is_snapshot_on_nfs,
+ get_hypervisor_type)
from marvin.cloudstackAPI import detachVolume
import time
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_vpc_network_lbrules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_network_lbrules.py b/test/integration/component/test_vpc_network_lbrules.py
index e7cb823..d623fb9 100644
--- a/test/integration/component/test_vpc_network_lbrules.py
+++ b/test/integration/component/test_vpc_network_lbrules.py
@@ -18,11 +18,8 @@
""" Component tests for VPC network functionality - Load Balancing Rules
"""
#Import Local Modules
-#import marvin
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
-#from marvin.cloudstackAPI import
-#from marvin.integration.lib.utils import
from marvin.integration.lib.base import (stopRouter,
startRouter,
Account,
@@ -40,8 +37,8 @@ from marvin.integration.lib.base import (stopRouter,
from marvin.integration.lib.common import (get_domain,
get_zone,
get_template,
- cleanup_resources,
list_routers)
+from marvin.integration.lib.utils import cleanup_resources
import socket
import time
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_vpc_network_pfrules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_network_pfrules.py b/test/integration/component/test_vpc_network_pfrules.py
index 0d8e2f1..c65da41 100644
--- a/test/integration/component/test_vpc_network_pfrules.py
+++ b/test/integration/component/test_vpc_network_pfrules.py
@@ -20,24 +20,23 @@
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
from marvin.integration.lib.base import (stopRouter,
- startRouter,
- Account,
- VpcOffering,
- VPC,
- ServiceOffering,
- NATRule,
- NetworkACL,
- PublicIPAddress,
- NetworkOffering,
- Network,
- VirtualMachine,
- LoadBalancerRule,
- StaticNATRule)
+ startRouter,
+ Account,
+ VpcOffering,
+ VPC,
+ ServiceOffering,
+ NATRule,
+ NetworkACL,
+ PublicIPAddress,
+ NetworkOffering,
+ Network,
+ VirtualMachine,
+ LoadBalancerRule)
from marvin.integration.lib.common import (get_domain,
- get_zone,
- get_template,
- cleanup_resources,
- list_routers)
+ get_zone,
+ get_template,
+ list_routers)
+from marvin.integration.lib.utils import cleanup_resources
import socket
import time
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_vpc_network_staticnatrule.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_network_staticnatrule.py b/test/integration/component/test_vpc_network_staticnatrule.py
index dd3d249..46e3479 100644
--- a/test/integration/component/test_vpc_network_staticnatrule.py
+++ b/test/integration/component/test_vpc_network_staticnatrule.py
@@ -19,25 +19,24 @@
"""
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
-from marvin.integration.lib.base import (stopRouter,
- startRouter,
- Account,
- VpcOffering,
- VPC,
- ServiceOffering,
- NATRule,
- NetworkACL,
- PublicIPAddress,
- NetworkOffering,
- Network,
- VirtualMachine,
- LoadBalancerRule,
- StaticNATRule)
+from marvin.integration.lib.base import (Account,
+ VpcOffering,
+ VPC,
+ ServiceOffering,
+ NetworkACL,
+ PublicIPAddress,
+ NetworkOffering,
+ Network,
+ VirtualMachine,
+ LoadBalancerRule,
+ StaticNATRule)
+from marvin.cloudstackAPI import (stopRouter,
+ startRouter)
from marvin.integration.lib.common import (get_domain,
- get_zone,
- get_template,
- cleanup_resources,
- list_routers)
+ get_zone,
+ get_template,
+ list_routers)
+from marvin.integration.lib.utils import cleanup_resources
import socket
import time
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/test/integration/component/test_vpn_users.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpn_users.py b/test/integration/component/test_vpn_users.py
index 9ee907b..02dd026 100644
--- a/test/integration/component/test_vpn_users.py
+++ b/test/integration/component/test_vpn_users.py
@@ -33,9 +33,9 @@ from marvin.integration.lib.base import (
)
from marvin.integration.lib.common import (get_domain,
get_zone,
- get_template,
- cleanup_resources,
+ get_template
)
+from marvin.integration.lib.utils import cleanup_resources
class Services:
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/tools/marvin/marvin/integration/lib/common.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py
index 096b073..d23d745 100644
--- a/tools/marvin/marvin/integration/lib/common.py
+++ b/tools/marvin/marvin/integration/lib/common.py
@@ -18,11 +18,56 @@
"""
#Import Local Modules
-from marvin.cloudstackAPI import *
+from marvin.cloudstackAPI import (listConfigurations,
+ listPhysicalNetworks,
+ listRegions,
+ addNetworkServiceProvider,
+ updateNetworkServiceProvider,
+ listDomains,
+ listZones,
+ listPods,
+ listOsTypes,
+ listTemplates,
+ updateResourceLimit,
+ listRouters,
+ listNetworks,
+ listClusters,
+ listSystemVms,
+ listStoragePools,
+ listVirtualMachines,
+ listLoadBalancerRuleInstances,
+ listFirewallRules,
+ listVolumes,
+ listIsos,
+ listAccounts,
+ listSnapshotPolicies,
+ listDiskOfferings,
+ listVlanIpRanges,
+ listUsageRecords,
+ listNetworkServiceProviders,
+ listHosts,
+ listPublicIpAddresses,
+ listPortForwardingRules,
+ listLoadBalancerRules,
+ listSnapshots,
+ listUsers,
+ listEvents,
+ listServiceOfferings,
+ listVirtualRouterElements,
+ listNetworkOfferings,
+ listResourceLimits,
+ listVPCOfferings)
+from marvin.integration.lib.base import (Configurations,
+ NetScaler,
+ Template,
+ Resources,
+ PhysicalNetwork,
+ Host)
+from marvin.integration.lib.utils import (get_process_status,
+ xsplit)
+
from marvin.sshClient import SshClient
-from utils import *
-from base import *
-from marvin.codes import PASS
+import random
#Import System modules
import time
@@ -91,7 +136,7 @@ def add_netscaler(apiclient, zoneid, NSservice):
cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
cmd.id = netscaler_provider.id
cmd.state = 'Enabled'
- response = apiclient.updateNetworkServiceProvider(cmd)
+ apiclient.updateNetworkServiceProvider(cmd)
return netscaler
@@ -199,19 +244,6 @@ def get_template(apiclient, zoneid, ostype, services=None):
ostypeid)
return
-def get_hypervisor_type(apiclient):
-
- """Return the hypervisor type of the hosts in setup"""
-
- hosts = list_hosts(apiclient, type='Routing', listall=True)
-
- hosts_list_validation_result = validateList(hosts)
-
- assert hosts_list_validation_result[0] == PASS, "host list validation failed"
-
- return hosts_list_validation_result[1].hypervisor
-
-
def download_systemplates_sec_storage(server, services):
"""Download System templates on sec storage"""
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/80ab47c8/tools/marvin/marvin/integration/lib/utils.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py
index d046235..25ebe28 100644
--- a/tools/marvin/marvin/integration/lib/utils.py
+++ b/tools/marvin/marvin/integration/lib/utils.py
@@ -28,10 +28,13 @@ import email
import socket
import urlparse
import datetime
-from marvin.cloudstackAPI import *
+from marvin.cloudstackAPI import cloudstackAPIClient, listHosts
from marvin.sshClient import SshClient
-from marvin.codes import *
-
+from marvin.codes import (FAIL,
+ PASS,
+ MATCH_NOT_FOUND,
+ INVALID_INPUT,
+ EMPTY_LIST)
def restart_mgmt_server(server):
"""Restarts the management server"""
@@ -237,6 +240,18 @@ def xsplit(txt, seps):
txt = txt.replace(sep, default_sep)
return [i.strip() for i in txt.split(default_sep)]
+def get_hypervisor_type(apiclient):
+
+ """Return the hypervisor type of the hosts in setup"""
+
+ cmd = listHosts.listHostsCmd()
+ cmd.type = 'Routing'
+ cmd.listall = True
+ hosts = apiclient.listHosts(cmd)
+ hosts_list_validation_result = validateList(hosts)
+ assert hosts_list_validation_result[0] == PASS, "host list validation failed"
+ return hosts_list_validation_result[1].hypervisor
+
def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid):
"""
Checks whether a snapshot with id (not UUID) `snapshotid` is present on the nfs storage
@@ -248,8 +263,12 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid):
@param snapshotid: uuid of the snapshot
@return: True if snapshot is found, False otherwise
"""
+ # snapshot extension to be appended to the snapshot path obtained from db
+ snapshot_extensions = {"vmware": ".ovf",
+ "kvm": "",
+ "xenserver": ".vhd"}
- from base import ImageStore, Snapshot
+ from base import ImageStore
secondaryStores = ImageStore.list(apiclient, zoneid=zoneid)
assert isinstance(secondaryStores, list), "Not a valid response for listImageStores"
@@ -281,7 +300,9 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid):
#Snapshot does not exist
return False
- snapshotPath = qresultset[0][0]
+ hypervisor = get_hypervisor_type(apiclient)
+ # append snapshot extension based on hypervisor, to the snapshot path
+ snapshotPath = str(qresultset[0][0]) + snapshot_extensions[str(hypervisor).lower()]
nfsurl = secondaryStore.url
from urllib2 import urlparse