add more libs
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d002c52a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d002c52a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d002c52a Branch: refs/heads/pytest Commit: d002c52a19033820948fdf63cbcadd6724fd9529 Parents: b155b8a Author: Edison Su <[email protected]> Authored: Mon Sep 22 18:09:45 2014 -0700 Committer: Edison Su <[email protected]> Committed: Mon Sep 22 18:09:45 2014 -0700 ---------------------------------------------------------------------- test/integration/smoke/misc/test_deploy_vm.py | 9 +- test/integration/smoke/misc/test_vm_ha.py | 8 +- test/integration/smoke/misc/test_vm_sync.py | 8 +- test/integration/smoke/test_CS-18306.py | 40 +- test/integration/smoke/test_affinity_groups.py | 10 +- .../smoke/test_deploy_vgpu_enabled_vm.py | 10 +- .../smoke/test_deploy_vm_root_resize.py | 8 +- .../smoke/test_deploy_vm_with_userdata.py | 14 +- ...deploy_vms_with_varied_deploymentplanners.py | 8 +- test/integration/smoke/test_disk_offerings.py | 8 +- test/integration/smoke/test_global_settings.py | 7 +- test/integration/smoke/test_guest_vlan_range.py | 8 +- test/integration/smoke/test_hosts.py | 10 +- test/integration/smoke/test_internal_lb.py | 9 +- test/integration/smoke/test_iso.py | 12 +- test/integration/smoke/test_loadbalance.py | 10 +- .../smoke/test_multipleips_per_nic.py | 8 +- test/integration/smoke/test_network_acl.py | 9 +- test/integration/smoke/test_nic.py | 17 +- .../integration/smoke/test_over_provisioning.py | 6 +- test/integration/smoke/test_primary_storage.py | 10 +- test/integration/smoke/test_privategw_acl.py | 5 +- test/integration/smoke/test_public_ip_range.py | 8 +- test/integration/smoke/test_pvlan.py | 10 +- test/integration/smoke/test_regions.py | 8 +- .../smoke/test_reset_vm_on_reboot.py | 9 +- test/integration/smoke/test_resource_detail.py | 8 +- test/integration/smoke/test_routers.py | 10 +- test/integration/smoke/test_scale_vm.py | 9 +- .../integration/smoke/test_secondary_storage.py | 10 +- .../integration/smoke/test_service_offerings.py | 7 +- test/integration/smoke/test_snapshots.py | 7 +- test/integration/smoke/test_ssvm.py | 12 +- test/integration/smoke/test_templates.py | 11 +- test/integration/smoke/test_vm_life_cycle.py | 6 +- test/integration/smoke/test_vm_snapshots.py | 11 +- test/integration/smoke/test_volumes.py | 8 +- test/integration/smoke/test_vpc_vpn.py | 8 +- tools/marvin/marvin/cloudstackTestCase.py | 2 +- tools/marvin/marvin/cloudstackTestClient.py | 5 +- tools/marvin/marvin/deployDataCenter.py | 13 +- tools/marvin/marvin/lib/base.py | 4716 ------------------ tools/marvin/marvin/lib/cloudstack/__init__.py | 1 + tools/marvin/marvin/lib/cloudstack/account.py | 85 + tools/marvin/marvin/lib/cloudstack/autoscale.py | 175 + tools/marvin/marvin/lib/cloudstack/base.py | 336 ++ tools/marvin/marvin/lib/cloudstack/cluster.py | 68 + tools/marvin/marvin/lib/cloudstack/common.py | 1374 +++++ .../marvin/lib/cloudstack/diskoffering.py | 77 + tools/marvin/marvin/lib/cloudstack/domain.py | 72 + tools/marvin/marvin/lib/cloudstack/host.py | 159 + tools/marvin/marvin/lib/cloudstack/iam.py | 149 + .../marvin/marvin/lib/cloudstack/imagestore.py | 93 + tools/marvin/marvin/lib/cloudstack/iso.py | 148 + tools/marvin/marvin/lib/cloudstack/network.py | 1708 +++++++ .../marvin/lib/cloudstack/networkoffering.py | 95 + tools/marvin/marvin/lib/cloudstack/pod.py | 53 + tools/marvin/marvin/lib/cloudstack/project.py | 146 + tools/marvin/marvin/lib/cloudstack/region.py | 61 + .../marvin/lib/cloudstack/serviceoffering.py | 99 + tools/marvin/marvin/lib/cloudstack/snapshot.py | 125 + .../marvin/marvin/lib/cloudstack/storagepool.py | 122 + tools/marvin/marvin/lib/cloudstack/template.py | 277 + tools/marvin/marvin/lib/cloudstack/user.py | 95 + tools/marvin/marvin/lib/cloudstack/utils.py | 504 ++ tools/marvin/marvin/lib/cloudstack/vm.py | 706 +++ tools/marvin/marvin/lib/cloudstack/volume.py | 198 + tools/marvin/marvin/lib/cloudstack/zone.py | 67 + tools/marvin/marvin/lib/common.py | 1378 ----- tools/marvin/marvin/lib/utils.py | 504 -- tools/marvin/marvin/lib/utils/__init__.py | 1 + tools/marvin/marvin/lib/utils/account.py | 31 + tools/marvin/marvin/lib/utils/domain.py | 26 + .../marvin/marvin/lib/utils/serviceoffering.py | 84 + tools/marvin/marvin/lib/utils/snapshot.py | 37 + tools/marvin/marvin/lib/utils/template.py | 26 + tools/marvin/marvin/lib/utils/vm.py | 87 + tools/marvin/marvin/lib/utils/volume.py | 41 + tools/marvin/marvin/lib/utils/zone.py | 22 + tools/marvin/marvin/marvinLog.py | 3 +- tools/marvin/marvin/marvinPlugin.py | 8 +- tools/marvin/marvin/pytest/VM.py | 104 - tools/marvin/marvin/pytest/fixtures/__init__.py | 1 + tools/marvin/marvin/pytest/fixtures/vm.py | 61 + .../marvin/pytest/pytest_marvin_plugin.py | 35 +- tools/marvin/marvin/utils.py | 8 +- 86 files changed, 7618 insertions(+), 6944 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/misc/test_deploy_vm.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/misc/test_deploy_vm.py b/test/integration/smoke/misc/test_deploy_vm.py index 20ea90e..bd5d8e7 100644 --- a/test/integration/smoke/misc/test_deploy_vm.py +++ b/test/integration/smoke/misc/test_deploy_vm.py @@ -22,15 +22,14 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries -from marvin.codes import FAILED -#base - contains all resources as entities and defines create, delete, list operations on them -from marvin.lib.base import Account, VirtualMachine, ServiceOffering, SimulatorMock +#cloudstack - contains all resources as entities and defines create, delete, list operations on them +from marvin.lib.cloudstack import Account, VirtualMachine, ServiceOffering, SimulatorMock #utils - utility classes for common cleanup, external library wrappers etc -from marvin.lib.utils import cleanup_resources +from marvin.lib.cloudstack.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template import pytest http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/misc/test_vm_ha.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/misc/test_vm_ha.py b/test/integration/smoke/misc/test_vm_ha.py index 0ba0da5..581252f 100644 --- a/test/integration/smoke/misc/test_vm_ha.py +++ b/test/integration/smoke/misc/test_vm_ha.py @@ -24,14 +24,14 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries -#base - contains all resources as entities and defines create, delete, list operations on them -from marvin.lib.base import Account, VirtualMachine, Cluster, Host, ServiceOffering, Configurations, SimulatorMock +#cloudstack - contains all resources as entities and defines create, delete, list operations on them +from marvin.lib.cloudstack import Account, VirtualMachine, Cluster, Host, ServiceOffering, Configurations, SimulatorMock #utils - utility classes for common cleanup, external library wrappers etc -from marvin.lib.utils import cleanup_resources, validateList +from marvin.lib.cloudstack.utils import cleanup_resources, validateList #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template from marvin.codes import PASS import pytest http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/misc/test_vm_sync.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/misc/test_vm_sync.py b/test/integration/smoke/misc/test_vm_sync.py index 538a1a3..4eeec42 100644 --- a/test/integration/smoke/misc/test_vm_sync.py +++ b/test/integration/smoke/misc/test_vm_sync.py @@ -24,14 +24,14 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries -#base - contains all resources as entities and defines create, delete, list operations on them -from marvin.lib.base import Account, VirtualMachine, Cluster, Host, ServiceOffering, Configurations, SimulatorMock +#cloudstack - contains all resources as entities and defines create, delete, list operations on them +from marvin.lib.cloudstack import Account, VirtualMachine, Cluster, Host, ServiceOffering, Configurations, SimulatorMock #utils - utility classes for common cleanup, external library wrappers etc -from marvin.lib.utils import cleanup_resources +from marvin.lib.cloudstack.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template import pytest http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_CS-18306.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_CS-18306.py b/test/integration/smoke/test_CS-18306.py index 93d2d39..971fd78 100644 --- a/test/integration/smoke/test_CS-18306.py +++ b/test/integration/smoke/test_CS-18306.py @@ -16,37 +16,25 @@ # specific language governing permissions and limitations # under the License. import pytest +from marvin.lib.cloudstack.base import SimulatorMock +from marvin.cloudstackException import CloudstackAPIException -''' [email protected](tags=["advanced"], required_hardware="false") -def test_01_create_disk_offering(vm): - assert vm is not None -''' +#volume stucks in creating state if creating volume from snapshot failed [email protected](hypervisor_in=["simulator"]) +def test_CS_18306(vm, api_client): + nvm = vm.vm + mock = SimulatorMock.create(api_client,"CreateSnapshotCmd", zoneid=vm.zone.id) -import time + rootVol = nvm.getRootVolume() + snapshot = rootVol.takeSnapshot() + + with pytest.raises(CloudstackAPIException) as snapshotFailure: + nvol = snapshot.createVolume() + + assert snapshotFailure is not None -class TestP: - def test_a(self): - assert True == True - def test_b(self): - assert True == True - def test_aaa(self): - assert True == True -def test_aa(): - assert True == True -def test_bb(): - assert True == True -class TestA: - def test_aaa(self): - assert True == True - def test_bbb(self): - assert True == True - def test_ccc(self): - assert True == True -def test_cc(): - assert True == True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_affinity_groups.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py index 772ea3d..33adad5 100644 --- a/test/integration/smoke/test_affinity_groups.py +++ b/test/integration/smoke/test_affinity_groups.py @@ -16,14 +16,12 @@ # specific language governing permissions and limitations # under the License. -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from marvin.sshClient import SshClient -import pytest +from marvin.lib.cloudstack.common import * + class TestDeployVmWithAffinityGroup(cloudstackTestCase): """ http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py index 1fbf70e..f59f6c8 100644 --- a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py +++ b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py @@ -22,18 +22,18 @@ from marvin.cloudstackTestCase import cloudstackTestCase, unittest #Import Integration Libraries -#base - contains all resources as entities and defines create, delete, list operations on them -from marvin.lib.base import Account, VirtualMachine, ServiceOffering +#cloudstack - contains all resources as entities and defines create, delete, list operations on them +from marvin.lib.cloudstack import Account, VirtualMachine, ServiceOffering #utils - utility classes for common cleanup, external library wrappers etc -from marvin.lib.utils import cleanup_resources +from marvin.lib.cloudstack.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template, list_hosts +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template, list_hosts from marvin.sshClient import SshClient -from marvin.codes import FAILED, XEN_SERVER +from marvin.codes import FAILED import pytest class TestDeployvGPUenabledVM(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_deploy_vm_root_resize.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py index 39d50c1..649f74f 100644 --- a/test/integration/smoke/test_deploy_vm_root_resize.py +++ b/test/integration/smoke/test_deploy_vm_root_resize.py @@ -22,14 +22,14 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries -#base - contains all resources as entities and defines create, delete, list operations on them -from marvin.lib.base import Account, VirtualMachine, ServiceOffering +#cloudstack - contains all resources as entities and defines create, delete, list operations on them +from marvin.lib.cloudstack import Account, VirtualMachine, ServiceOffering #utils - utility classes for common cleanup, external library wrappers etc -from marvin.lib.utils import cleanup_resources +from marvin.lib.cloudstack.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template, list_volumes +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template, list_volumes from marvin.codes import FAILED http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_deploy_vm_with_userdata.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_deploy_vm_with_userdata.py b/test/integration/smoke/test_deploy_vm_with_userdata.py index 95c1d3d..f08fa9c 100644 --- a/test/integration/smoke/test_deploy_vm_with_userdata.py +++ b/test/integration/smoke/test_deploy_vm_with_userdata.py @@ -15,17 +15,19 @@ # specific language governing permissions and limitations # under the License. +import random +import string + +import pytest + from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.lib.base import (ServiceOffering, +from marvin.lib.cloudstack import (ServiceOffering, VirtualMachine, Account) -from marvin.lib.common import get_template, get_zone, list_virtual_machines +from marvin.lib.cloudstack.common import get_template, get_zone, list_virtual_machines from marvin.lib.utils import cleanup_resources - from marvin.codes import FAILED -import random -import string -import pytest + class TestDeployVmWithUserData(cloudstackTestCase): """Tests for UserData http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py index 09a43f5..13facd7 100644 --- a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py +++ b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py @@ -15,12 +15,14 @@ # specific language governing permissions and limitations # under the License. +import pytest + from marvin.codes import FAILED from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.lib.base import Account, VirtualMachine, ServiceOffering, Host, Cluster -from marvin.lib.common import get_zone, get_domain, get_template +from marvin.lib.cloudstack import Account, VirtualMachine, ServiceOffering, Host, Cluster +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template from marvin.lib.utils import cleanup_resources -import pytest + class TestDeployVmWithVariedPlanners(cloudstackTestCase): """ Test to create services offerings for deployment planners http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_disk_offerings.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index 6ac617e..cfaa5b1 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -17,13 +17,13 @@ """ BVT tests for Disk offerings""" #Import Local Modules -import marvin +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + _multiprocess_shared_ = True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_global_settings.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_global_settings.py b/test/integration/smoke/test_global_settings.py index 8e10140..bcbb7e4 100644 --- a/test/integration/smoke/test_global_settings.py +++ b/test/integration/smoke/test_global_settings.py @@ -17,12 +17,13 @@ """ P1 tests for updating the granular Configuration parameter with scope and resource id provided. """ #Import Local Modules +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + #Import System modules class TestUpdateConfigWithScope(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_guest_vlan_range.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_guest_vlan_range.py b/test/integration/smoke/test_guest_vlan_range.py index 83d6d88..0b5c881 100644 --- a/test/integration/smoke/test_guest_vlan_range.py +++ b/test/integration/smoke/test_guest_vlan_range.py @@ -17,14 +17,12 @@ """ P1 tests for Dedicating Guest Vlan Ranges """ #Import Local Modules -import marvin import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import datetime +from marvin.lib.cloudstack.common import * + class TestDedicateGuestVlanRange(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_hosts.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py index d4fddc4..5e4960d 100644 --- a/test/integration/smoke/test_hosts.py +++ b/test/integration/smoke/test_hosts.py @@ -17,17 +17,15 @@ """ BVT tests for Hosts and Clusters """ #Import Local Modules -import marvin +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * +from marvin.lib.cloudstack.common import * from marvin.lib.utils import (random_gen) -import pytest + #Import System modules -import time _multiprocess_shared_ = True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_internal_lb.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_internal_lb.py b/test/integration/smoke/test_internal_lb.py index 37c3f5f..9203401 100644 --- a/test/integration/smoke/test_internal_lb.py +++ b/test/integration/smoke/test_internal_lb.py @@ -17,13 +17,12 @@ """ Tests for configuring Internal Load Balancing Rules. """ #Import Local Modules -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + class TestInternalLb(cloudstackTestCase): """Test Internal LB http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_iso.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index 2645a31..0b785e9 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -17,15 +17,15 @@ """ BVT tests for Templates ISO """ #Import Local Modules -import marvin +import urllib + +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest -import urllib -from random import random +from marvin.lib.cloudstack.common import * + #Import System modules import time http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_loadbalance.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py index 3b72d4f..78b1a32 100644 --- a/test/integration/smoke/test_loadbalance.py +++ b/test/integration/smoke/test_loadbalance.py @@ -15,14 +15,12 @@ # specific language governing permissions and limitations # under the License. -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + #Import System modules import time http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_multipleips_per_nic.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_multipleips_per_nic.py b/test/integration/smoke/test_multipleips_per_nic.py index 4d5b697..50fa7aa 100644 --- a/test/integration/smoke/test_multipleips_per_nic.py +++ b/test/integration/smoke/test_multipleips_per_nic.py @@ -23,14 +23,14 @@ from marvin.cloudstackTestCase import cloudstackTestCase #Import Integration Libraries -#base - contains all resources as entities and defines create, delete, list operations on them -from marvin.lib.base import Account, VirtualMachine, ServiceOffering +#cloudstack - contains all resources as entities and defines create, delete, list operations on them +from marvin.lib.cloudstack import Account, VirtualMachine, ServiceOffering #utils - utility classes for common cleanup, external library wrappers etc -from marvin.lib.utils import cleanup_resources +from marvin.lib.cloudstack.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template +from marvin.lib.cloudstack.common import get_zone, get_domain, get_template from marvin.cloudstackAPI.addIpToNic import addIpToNicCmd from marvin.cloudstackAPI.removeIpFromNic import removeIpFromNicCmd http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_network_acl.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_network_acl.py b/test/integration/smoke/test_network_acl.py index ac0db19..2912d51 100644 --- a/test/integration/smoke/test_network_acl.py +++ b/test/integration/smoke/test_network_acl.py @@ -17,13 +17,12 @@ """ Tests for Network ACLs in VPC """ #Import Local Modules -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + class TestNetworkACL(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_nic.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index ed9e3c5..6b3467e 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -15,20 +15,17 @@ # specific language governing permissions and limitations # under the License. """ NIC tests for VM """ -import marvin -from marvin.codes import FAILED -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest - import signal import sys import time +import pytest + +from marvin.cloudstackTestCase import * +from marvin.lib.utils import * +from marvin.lib.cloudstack.common import * + + class TestNic(cloudstackTestCase): def setUp(self): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_over_provisioning.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_over_provisioning.py b/test/integration/smoke/test_over_provisioning.py index 60f846e..64f4a46 100644 --- a/test/integration/smoke/test_over_provisioning.py +++ b/test/integration/smoke/test_over_provisioning.py @@ -17,12 +17,12 @@ """ Test for storage.overprovisioning.factor update """ #Import Local Modules +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest + #Import System modules class TestUpdateOverProvision(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_primary_storage.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 28362f8..a35c572 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -17,16 +17,14 @@ """ BVT tests for Primary Storage """ #Import Local Modules -import marvin +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + #Import System modules -import time _multiprocess_shared_ = True class TestPrimaryStorageServices(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_privategw_acl.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index 00078de..33fb99c 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -17,12 +17,11 @@ """ Tests for Network ACLs in VPC """ #Import Local Modules +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest class TestPrivateGwACL(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_public_ip_range.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py index 31569ab..97b6ccc 100644 --- a/test/integration/smoke/test_public_ip_range.py +++ b/test/integration/smoke/test_public_ip_range.py @@ -17,14 +17,12 @@ """ P1 tests for Dedicating Public IP addresses """ #Import Local Modules -import marvin import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import datetime +from marvin.lib.cloudstack.common import * + class TestDedicatePublicIPRange(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_pvlan.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index afce454..4e6f9d2 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -17,18 +17,14 @@ """ test for private vlan isolation """ #Import Local Modules -import marvin +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest -import telnetlib + #Import System modules -import time _multiprocess_shared_ = True class TestPVLAN(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_regions.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_regions.py b/test/integration/smoke/test_regions.py index 77da8b5..c3e7abf 100644 --- a/test/integration/smoke/test_regions.py +++ b/test/integration/smoke/test_regions.py @@ -15,12 +15,12 @@ # specific language governing permissions and limitations # under the License. +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + class TestRegions(cloudstackTestCase): """Test Regions - basic region creation http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_reset_vm_on_reboot.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_reset_vm_on_reboot.py b/test/integration/smoke/test_reset_vm_on_reboot.py index e7cc5ac..e54bf3a 100644 --- a/test/integration/smoke/test_reset_vm_on_reboot.py +++ b/test/integration/smoke/test_reset_vm_on_reboot.py @@ -17,14 +17,13 @@ """ P1 tests for reset Vm on reboot """ #Import Local Modules -import marvin -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + _multiprocess_shared_ = True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_resource_detail.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_resource_detail.py b/test/integration/smoke/test_resource_detail.py index 912a99e..4b7fde1 100644 --- a/test/integration/smoke/test_resource_detail.py +++ b/test/integration/smoke/test_resource_detail.py @@ -17,16 +17,14 @@ """ P1 tests for Scaling up Vm """ #Import Local Modules -import marvin import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * +from marvin.lib.cloudstack.common import * + #Import System modules -import time _multiprocess_shared_ = True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_routers.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 784392e..d1db7d2 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -17,15 +17,13 @@ """ BVT tests for routers """ #Import Local Modules -import marvin -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + #Import System modules import time http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_scale_vm.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py index 9948aa8..899f803 100644 --- a/test/integration/smoke/test_scale_vm.py +++ b/test/integration/smoke/test_scale_vm.py @@ -17,14 +17,13 @@ """ P1 tests for Scaling up Vm """ #Import Local Modules -import marvin -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + _multiprocess_shared_ = True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_secondary_storage.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index fdec177..a3b686e 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -17,16 +17,14 @@ """ BVT tests for Secondary Storage """ #Import Local Modules -import marvin +import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * + #Import System modules -import time _multiprocess_shared_ = True class TestSecStorageServices(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_service_offerings.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py index 4e8c057..d395980 100644 --- a/test/integration/smoke/test_service_offerings.py +++ b/test/integration/smoke/test_service_offerings.py @@ -17,21 +17,22 @@ """ BVT tests for Service offerings""" #Import Local Modules +import pytest + from marvin.codes import FAILED from marvin.cloudstackTestCase import cloudstackTestCase from marvin.cloudstackAPI import changeServiceForVirtualMachine,updateServiceOffering from marvin.lib.utils import (isAlmostEqual, cleanup_resources, random_gen) -from marvin.lib.base import (ServiceOffering, +from marvin.lib.cloudstack import (ServiceOffering, Account, VirtualMachine) -from marvin.lib.common import (list_service_offering, +from marvin.lib.cloudstack.common import (list_service_offering, list_virtual_machines, get_domain, get_zone, get_template) -import pytest _multiprocess_shared_ = True http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_snapshots.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 17f78ee..7813d3b 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -15,13 +15,12 @@ # specific language governing permissions and limitations # under the License. -from marvin.codes import FAILED import pytest + from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * +from marvin.lib.cloudstack.common import * + class TestSnapshotRootDisk(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_ssvm.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index 35aba50..100dca6 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -17,15 +17,15 @@ """ BVT tests for SSVM """ #Import Local Modules -import marvin +import telnetlib + +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest -import telnetlib +from marvin.lib.cloudstack.common import * + #Import System modules import time http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_templates.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index 427e6e3..4a94535 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -17,6 +17,10 @@ """ BVT tests for Templates ISO """ #Import Local Modules +import urllib + +import pytest + from marvin.codes import FAILED from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.cloudstackAPI import (updateTemplate, @@ -26,17 +30,16 @@ from marvin.cloudstackAPI import (updateTemplate, deleteTemplate, copyTemplate) from marvin.lib.utils import random_gen, cleanup_resources -from marvin.lib.base import (Account, +from marvin.lib.cloudstack import (Account, ServiceOffering, VirtualMachine, DiskOffering, Template, Volume) -from marvin.lib.common import (get_domain, +from marvin.lib.cloudstack.common import (get_domain, get_zone, get_template) -import pytest -import urllib + #Import System modules import time http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_vm_life_cycle.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 2962ad4..ff403f6 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -22,17 +22,17 @@ from marvin.cloudstackAPI import (recoverVirtualMachine, destroyVirtualMachine, attachIso, detachIso) -from marvin.lib.utils import (cleanup_resources, +from marvin.lib.cloudstack.utils import (cleanup_resources, validateList, get_hypervisor_type) -from marvin.lib.base import (Account, +from marvin.lib.cloudstack import (Account, ServiceOffering, VirtualMachine, Host, Iso, Router, Configurations) -from marvin.lib.common import (get_domain, +from marvin.lib.cloudstack.common import (get_domain, get_zone, get_template) from marvin.codes import FAILED, PASS http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_vm_snapshots.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py index 8246188..efa78cb 100644 --- a/test/integration/smoke/test_vm_snapshots.py +++ b/test/integration/smoke/test_vm_snapshots.py @@ -16,20 +16,23 @@ # under the License. # Import Local Modules -from marvin.codes import FAILED, KVM +import time + import pytest + +from marvin.codes import FAILED, KVM from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.cloudstackAPI import startVirtualMachine from marvin.lib.utils import random_gen, cleanup_resources -from marvin.lib.base import (Account, +from marvin.lib.cloudstack import (Account, ServiceOffering, VirtualMachine, VmSnapshot) -from marvin.lib.common import (get_zone, +from marvin.lib.cloudstack.common import (get_zone, get_domain, get_template, list_virtual_machines) -import time + class TestVmSnapshot(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_volumes.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index de0905c..123c33a 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -23,19 +23,19 @@ from marvin.cloudstackAPI import (deleteVolume, extractVolume, resizeVolume) #from marvin.sshClient import SshClient -from marvin.lib.utils import (cleanup_resources, +from marvin.lib.cloudstack.utils import (cleanup_resources, format_volume_to_ext3) -from marvin.lib.base import (ServiceOffering, +from marvin.lib.cloudstack import (ServiceOffering, VirtualMachine, Account, Volume, Host, DiskOffering, StoragePool) -from marvin.lib.common import (get_domain, +from marvin.lib.cloudstack.common import (get_domain, get_zone, get_template) -from marvin.lib.utils import checkVolumeSize +from marvin.lib.cloudstack.utils import checkVolumeSize from marvin.codes import SUCCESS, FAILED, XEN_SERVER import pytest #Import System modules http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/test/integration/smoke/test_vpc_vpn.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 7d13a2d..201d62d 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -17,15 +17,13 @@ """ Tests for VPN in VPC """ #Import Local Modules -from marvin.codes import FAILED +import pytest + from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -import pytest +from marvin.lib.cloudstack.common import * -import time class TestVpcRemoteAccessVpn(cloudstackTestCase): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/tools/marvin/marvin/cloudstackTestCase.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/cloudstackTestCase.py b/tools/marvin/marvin/cloudstackTestCase.py index f5da5b2..21dccc1 100644 --- a/tools/marvin/marvin/cloudstackTestCase.py +++ b/tools/marvin/marvin/cloudstackTestCase.py @@ -17,7 +17,7 @@ import unittest -from marvin.lib.utils import verifyElementInList +from marvin.lib.cloudstack.utils import verifyElementInList from marvin.codes import PASS from marvin.utils import initTestClass http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/tools/marvin/marvin/cloudstackTestClient.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 8d505fa..7338e1d 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -15,6 +15,8 @@ # specific language governing permissions and limitations # under the License. +import copy + from marvin.cloudstackConnection import CSConnection from marvin.asyncJobMgr import asyncJobMgr from marvin.dbConnection import DbConnection @@ -23,9 +25,8 @@ from marvin.codes import (FAILED, PASS, ADMIN, DOMAIN_ADMIN, USER, SUCCESS, XEN_SERVER) from marvin.configGenerator import ConfigManager from marvin.cloudstackException import GetDetailExceptionInfo -from marvin.lib.utils import (random_gen, validateList) +from marvin.lib.cloudstack.utils import (random_gen, validateList) from marvin.cloudstackAPI.cloudstackAPIClient import CloudStackAPIClient -import copy class CSTestClient(object): http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d002c52a/tools/marvin/marvin/deployDataCenter.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 85057d2..88034c2 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -25,19 +25,20 @@ class DeleteDataCenters: Deletes a DataCenter based upon the dc cfg configuration from DeployDataCenters post its success """ +from sys import exit +import os +import pickle +from time import sleep, strftime, localtime +from optparse import OptionParser + from marvin import configGenerator from marvin.cloudstackException import ( InvalidParameterException, GetDetailExceptionInfo) from marvin.cloudstackAPI import * from marvin.codes import (FAILED, SUCCESS) -from marvin.lib.utils import (random_gen) +from marvin.lib.cloudstack.utils import (random_gen) from marvin.config.test_data import test_data -from sys import exit -import os -import pickle -from time import sleep, strftime, localtime -from optparse import OptionParser class DeployDataCenters(object):
