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 2014/05/06 12:01:04 UTC
[30/32] git commit: updated refs/heads/4.4-forward to 8546f76
Adding missing changes to test suits and configs before merging to 4.4-forward
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/87205f95
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/87205f95
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/87205f95
Branch: refs/heads/4.4-forward
Commit: 87205f955523556a1aad5da72360c67f0b8ba697
Parents: 18367b3
Author: Girish Shilamkar <gi...@clogeny.com>
Authored: Mon May 5 19:40:47 2014 -0400
Committer: Girish Shilamkar <gi...@clogeny.com>
Committed: Mon May 5 19:40:47 2014 -0400
----------------------------------------------------------------------
.../component/test_dynamic_compute_offering.py | 18 +++++--
.../component/test_ip_reservation.py | 55 +++++++++++---------
.../component/test_multiple_ips_per_nic.py | 31 +++++++++--
.../component/test_persistent_networks.py | 39 ++++++++++----
tools/marvin/marvin/config/test_data.py | 39 ++++++++++++++
5 files changed, 139 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/87205f95/test/integration/component/test_dynamic_compute_offering.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_dynamic_compute_offering.py b/test/integration/component/test_dynamic_compute_offering.py
index 8cb6eb1..95be65f 100644
--- a/test/integration/component/test_dynamic_compute_offering.py
+++ b/test/integration/component/test_dynamic_compute_offering.py
@@ -24,13 +24,21 @@
Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Dynamic+Compute+Offering+FS
"""
from marvin.cloudstackTestCase import cloudstackTestCase
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-
+from marvin.lib.utils import cleanup_resources, validateList, random_gen
+from marvin.lib.base import (Account,
+ ServiceOffering,
+ VirtualMachine,
+ Resources,
+ AffinityGroup,
+ Host)
+from marvin.lib.common import (get_domain,
+ get_zone,
+ get_template,
+ verifyComputeOfferingCreation)
from nose.plugins.attrib import attr
-from marvin.codes import PASS, ADMIN_ACCOUNT, USER_ACCOUNT
+from marvin.codes import PASS, ADMIN_ACCOUNT, USER_ACCOUNT, FAILED
from ddt import ddt, data
+import time
@ddt
class TestDynamicServiceOffering(cloudstackTestCase):
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/87205f95/test/integration/component/test_ip_reservation.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_ip_reservation.py b/test/integration/component/test_ip_reservation.py
index dea26ab..390a959 100644
--- a/test/integration/component/test_ip_reservation.py
+++ b/test/integration/component/test_ip_reservation.py
@@ -23,10 +23,21 @@
Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/FS+-+IP+Range+Reservation+within+a+Network
"""
from marvin.cloudstackTestCase import cloudstackTestCase, unittest
-from marvin.cloudstackException import CloudstackAPIException
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
+from marvin.lib.utils import validateList, cleanup_resources, verifyRouterState
+from marvin.lib.base import (Account,
+ Network,
+ VirtualMachine,
+ Router,
+ ServiceOffering,
+ NetworkOffering)
+from marvin.lib.common import (get_zone,
+ get_template,
+ get_domain,
+ wait_for_cleanup,
+ createEnabledNetworkOffering,
+ createNetworkRulesForVM)
+from marvin.codes import (PASS, FAIL, FAILED, UNKNOWN, FAULT, MASTER,
+ NAT_RULE, STATIC_NAT_RULE)
import netaddr
import random
@@ -952,12 +963,16 @@ class TestRouterOperations(cloudstackTestCase):
self.assertEqual(validateList(routers)[0], PASS, "Routers list validation failed")
# Destroy Router
- result = Router.destroy(self.apiclient, id=routers[0].id)
- if result[0] == FAIL:
- self.fail("Failed to destroy router: %s" % result[2])
+ try:
+ Router.destroy(self.apiclient, id=routers[0].id)
+ except Exception as e:
+ self.fail("Failed to destroy router: %s" % e)
#Restart Network
- isolated_network.restart(self.apiclient)
+ try:
+ isolated_network.restart(self.apiclient)
+ except Exception as e:
+ self.fail("Failed to restart network: %s" % e)
try:
virtual_machine_2 = createVirtualMachine(self, network_id=isolated_network.id)
@@ -1072,11 +1087,9 @@ class TestFailureScnarios(cloudstackTestCase):
#
# validation
# should throw exception as network is not in implemented state as no vm is created
- try:
- update_response = Network.update(self.isolated_network, self.apiclient, id=isolated_network.id, guestvmcidr="10.1.1.0/26")
- self.fail("Network Update of guest VM CIDR is successful withot any VM deployed in network")
- except Exception as e:
- self.debug("Network Update of guest VM CIDR should fail as there is no VM deployed in network")
+ with self.assertRaises(Exception):
+ self.isolated_network.update(self.apiclient, guestvmcidr="10.1.1.0/26")
+ return
@attr(tags=["advanced", "selfservice"])
def test_vm_create_after_reservation(self):
@@ -1111,7 +1124,7 @@ class TestFailureScnarios(cloudstackTestCase):
if netaddr.IPAddress(virtual_machine_2.ipaddress) not in netaddr.IPNetwork(guest_vm_cidr):
self.fail("Newly created VM doesn't get IP from reserverd CIDR")
except Exception as e:
- self.skipTest("VM creation fails, cannot validate the condition")
+ self.skipTest("VM creation fails, cannot validate the condition: %s" % e)
@attr(tags=["advanced", "selfservice"])
def test_reservation_after_router_restart(self):
@@ -1130,19 +1143,13 @@ class TestFailureScnarios(cloudstackTestCase):
routers = Router.list(self.apiclient,
networkid=self.isolated_persistent_network.id,
listall=True)
- self.assertEqual(
- isinstance(routers, list),
- True,
- "list router should return valid response"
- )
- if not routers:
- self.skipTest("Router list should not be empty, skipping test")
+ self.assertEqual(validateList(routers)[0], PASS,
+ "routers list validation failed")
Router.reboot(self.apiclient, routers[0].id)
networks = Network.list(self.apiclient, id=self.isolated_persistent_network.id)
self.assertEqual(
- isinstance(networks, list),
- True,
+ validateList(networks)[0], PASS,
"list Networks should return valid response"
)
self.assertEqual(networks[0].cidr, guest_vm_cidr, "guestvmcidr should match after router reboot")
@@ -1163,4 +1170,4 @@ class TestFailureScnarios(cloudstackTestCase):
self.create_virtual_machine(network_id=self.isolated_persistent_network.id, ip_address=u"10.1.1.9")
self.fail("vm should not be created ")
except Exception as e:
- self.debug("exception as IP is outside of guestvmcidr")
+ self.debug("exception as IP is outside of guestvmcidr: %s" % e)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/87205f95/test/integration/component/test_multiple_ips_per_nic.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_multiple_ips_per_nic.py b/test/integration/component/test_multiple_ips_per_nic.py
index 5daa08c..1b1cd82 100644
--- a/test/integration/component/test_multiple_ips_per_nic.py
+++ b/test/integration/component/test_multiple_ips_per_nic.py
@@ -23,12 +23,33 @@
Design Document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Multiple+IP+address+per+NIC
"""
from marvin.cloudstackTestCase import cloudstackTestCase
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-
+from marvin.lib.utils import (cleanup_resources,
+ validateList,
+ random_gen)
+from marvin.lib.base import (Account,
+ VirtualMachine,
+ ServiceOffering,
+ PublicIPAddress,
+ NIC,
+ FireWallRule,
+ NATRule,
+ StaticNATRule,
+ VpcOffering,
+ Domain,
+ Network,
+ Router,
+ VPC
+ )
+from marvin.lib.common import (get_domain,
+ get_zone,
+ get_template,
+ get_free_vlan,
+ setSharedNetworkParams,
+ createEnabledNetworkOffering,
+ shouldTestBeSkipped,
+ wait_for_cleanup)
from nose.plugins.attrib import attr
-from marvin.codes import PASS, ISOLATED_NETWORK, VPC_NETWORK, SHARED_NETWORK, FAIL
+from marvin.codes import PASS, ISOLATED_NETWORK, VPC_NETWORK, SHARED_NETWORK, FAIL, FAILED
from ddt import ddt, data
import time
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/87205f95/test/integration/component/test_persistent_networks.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py
index deb0d6e..a7b95d8 100644
--- a/test/integration/component/test_persistent_networks.py
+++ b/test/integration/component/test_persistent_networks.py
@@ -15,11 +15,32 @@
# specific language governing permissions and limitations
# under the License.
""" Tests for Persistent Networks without running VMs feature"""
-from marvin.cloudstackException import CloudstackAPIException
-from marvin.lib.utils import *
-from marvin.lib.base import *
-from marvin.lib.common import *
-import netaddr
+from marvin.lib.utils import (validateList,
+ cleanup_resources,
+ get_hypervisor_type)
+from marvin.lib.base import (NATRule,
+ StaticNATRule,
+ VirtualMachine,
+ LoadBalancerRule,
+ VPC,
+ Account,
+ Network,
+ Router,
+ ServiceOffering,
+ NetworkACL,
+ VpcOffering,
+ Domain,
+ PublicIPAddress,
+ FireWallRule,
+ Host,
+ NetworkOffering,
+ Project)
+from marvin.lib.common import (get_zone,
+ get_template,
+ get_domain,
+ add_netscaler,
+ verifyNetworkState,
+ wait_for_cleanup)
from nose.plugins.attrib import attr
from marvin.codes import PASS, FAIL, FAILED
from marvin.sshClient import SshClient
@@ -937,7 +958,7 @@ class TestAssignVirtualMachine(cloudstackTestCase):
cls.services["ostype"]
)
if cls.template == FAILED:
- assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
+ assert False, "get_template() failed to return template"
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
cls.service_offering = ServiceOffering.create(
@@ -1093,7 +1114,7 @@ class TestProjectAccountOperations(cloudstackTestCase):
cls.services["ostype"]
)
if cls.template == FAILED:
- assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
+ assert False, "get_template() failed to return template"
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
cls.service_offering = ServiceOffering.create(
@@ -1250,7 +1271,7 @@ class TestRestartPersistentNetwork(cloudstackTestCase):
cls.services["ostype"]
)
if cls.template == FAILED:
- assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
+ assert False, "get_template() failed to return template"
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
cls.service_offering = ServiceOffering.create(
@@ -1508,7 +1529,7 @@ class TestVPCNetworkOperations(cloudstackTestCase):
cls.services["ostype"]
)
if cls.template == FAILED:
- assert False, "get_template() failed to return template with description %s" % cls.services["ostype"]
+ assert False, "get_template() failed to return template"
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/87205f95/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index 4e8cd50..73a5965 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -209,6 +209,18 @@ test_data = {
"name": "Isolated Network",
"displaytext": "Isolated Network"
},
+ "netscaler_VPX": {
+ "ipaddress": "10.223.240.174",
+ "username": "nsroot",
+ "password": "nsroot",
+ "networkdevicetype": "NetscalerVPXLoadBalancer",
+ "publicinterface": "1/1",
+ "privateinterface": "1/2",
+ "numretries": 2,
+ "lbdevicededicated": "True",
+ "lbdevicecapacity": 2,
+ "port": 22
+ },
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
@@ -480,6 +492,26 @@ test_data = {
"NetworkACL": "VpcVirtualRouter"
}
},
+ "nw_offering_shared_persistent": {
+ "name": "Network offering for Shared Persistent Network",
+ "displaytext": "Network offering-DA services",
+ "guestiptype": "Shared",
+ "supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
+ "traffictype": "GUEST",
+ "availability": "Optional",
+ "ispersistent": "True",
+ "serviceProviderList": {
+ "Dhcp": "VirtualRouter",
+ "Dns": "VirtualRouter",
+ "SourceNat": "VirtualRouter",
+ "PortForwarding": "VirtualRouter",
+ "Vpn": "VirtualRouter",
+ "Firewall": "VirtualRouter",
+ "Lb": "VirtualRouter",
+ "UserData": "VirtualRouter",
+ "StaticNat": "VirtualRouter"
+ }
+ },
"fwrule": {
"startport": 22,
"endport": 22,
@@ -565,6 +597,12 @@ test_data = {
"publicport": 2222,
"protocol": 'TCP'
},
+ "icmprule": {
+ "icmptype": -1,
+ "icmpcode": -1,
+ "cidrlist": "0.0.0.0/0",
+ "protocol": "ICMP"
+ },
"iso": {
"displaytext": "Test ISO",
"name": "ISO",
@@ -641,6 +679,7 @@ test_data = {
"page": 1,
"pagesize": 2,
"listall": 'true',
+ "host_password": "password",
"advanced_sg": {
"zone": {
"name": "",