mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Merge pull request #2743 from nuagenetworks/bugfix/marvin_config_drive
CLOUDSTACK-10380: Fix startvm giving another pw after pw reset
This commit is contained in:
		
						commit
						fe10e684f9
					
				| @ -1336,7 +1336,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra | |||||||
| 
 | 
 | ||||||
|         //check if the there are no service provider other than virtualrouter. |         //check if the there are no service provider other than virtualrouter. | ||||||
|         for(Provider provider : providers) { |         for(Provider provider : providers) { | ||||||
|             if (provider!=Provider.VirtualRouter) |             if (provider != Provider.VirtualRouter) | ||||||
|                 throw new UnsupportedOperationException("Cannot update the network resources in sequence when providers other than virtualrouter are used"); |                 throw new UnsupportedOperationException("Cannot update the network resources in sequence when providers other than virtualrouter are used"); | ||||||
|         } |         } | ||||||
|         //check if routers are in correct state before proceeding with the update |         //check if routers are in correct state before proceeding with the update | ||||||
|  | |||||||
| @ -29,11 +29,11 @@ import java.util.Set; | |||||||
| import javax.annotation.PostConstruct; | import javax.annotation.PostConstruct; | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.log4j.Logger; | ||||||
|  | 
 | ||||||
| import com.cloud.network.Network; | import com.cloud.network.Network; | ||||||
| import com.cloud.network.dao.NetworkDao; | import com.cloud.network.dao.NetworkDao; | ||||||
| import com.cloud.network.dao.NetworkVO; | import com.cloud.network.dao.NetworkVO; | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import com.cloud.server.ResourceTag.ResourceObjectType; | import com.cloud.server.ResourceTag.ResourceObjectType; | ||||||
| import com.cloud.tags.dao.ResourceTagDao; | import com.cloud.tags.dao.ResourceTagDao; | ||||||
| import com.cloud.user.Account; | import com.cloud.user.Account; | ||||||
| @ -368,9 +368,13 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use | |||||||
|         if (detailsStr == null) { |         if (detailsStr == null) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         final Map<String, Boolean> visibilityMap = _detailsDao.listDetailsVisibility(vm.getId()); | ||||||
|  | 
 | ||||||
|         List<UserVmDetailVO> details = new ArrayList<UserVmDetailVO>(); |         List<UserVmDetailVO> details = new ArrayList<UserVmDetailVO>(); | ||||||
|         for (String key : detailsStr.keySet()) { |         for (Map.Entry<String, String> entry : detailsStr.entrySet()) { | ||||||
|             details.add(new UserVmDetailVO(vm.getId(), key, detailsStr.get(key), true)); |             boolean display = visibilityMap.getOrDefault(entry.getKey(), true); | ||||||
|  |             details.add(new UserVmDetailVO(vm.getId(), entry.getKey(), entry.getValue(), display)); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         _detailsDao.saveDetails(details); |         _detailsDao.saveDetails(details); | ||||||
|  | |||||||
| @ -73,6 +73,8 @@ public interface ResourceDetailsDao<R extends ResourceDetail> extends GenericDao | |||||||
| 
 | 
 | ||||||
|     public Map<String, String> listDetailsKeyPairs(long resourceId, boolean forDisplay); |     public Map<String, String> listDetailsKeyPairs(long resourceId, boolean forDisplay); | ||||||
| 
 | 
 | ||||||
|  |     Map<String, Boolean> listDetailsVisibility(long resourceId); | ||||||
|  | 
 | ||||||
|     public void saveDetails(List<R> details); |     public void saveDetails(List<R> details); | ||||||
| 
 | 
 | ||||||
|     public void addDetail(long resourceId, String key, String value, boolean display); |     public void addDetail(long resourceId, String key, String value, boolean display); | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ import com.cloud.utils.db.SearchBuilder; | |||||||
| import com.cloud.utils.db.SearchCriteria; | import com.cloud.utils.db.SearchCriteria; | ||||||
| import com.cloud.utils.db.TransactionLegacy; | import com.cloud.utils.db.TransactionLegacy; | ||||||
| 
 | 
 | ||||||
| public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends GenericDaoBase<R, Long> { | public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends GenericDaoBase<R, Long> implements ResourceDetailsDao<R> { | ||||||
|     private SearchBuilder<R> AllFieldsSearch; |     private SearchBuilder<R> AllFieldsSearch; | ||||||
| 
 | 
 | ||||||
|     public ResourceDetailsDaoBase() { |     public ResourceDetailsDaoBase() { | ||||||
| @ -81,6 +81,18 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G | |||||||
|         return details; |         return details; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public Map<String, Boolean> listDetailsVisibility(long resourceId) { | ||||||
|  |         SearchCriteria<R> sc = AllFieldsSearch.create(); | ||||||
|  |         sc.setParameters("resourceId", resourceId); | ||||||
|  | 
 | ||||||
|  |         List<R> results = search(sc, null); | ||||||
|  |         Map<String, Boolean> details = new HashMap<>(results.size()); | ||||||
|  |         for (R result : results) { | ||||||
|  |             details.put(result.getName(), result.isDisplay()); | ||||||
|  |         } | ||||||
|  |         return details; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public List<R> listDetails(long resourceId) { |     public List<R> listDetails(long resourceId) { | ||||||
|         SearchCriteria<R> sc = AllFieldsSearch.create(); |         SearchCriteria<R> sc = AllFieldsSearch.create(); | ||||||
|         sc.setParameters("resourceId", resourceId); |         sc.setParameters("resourceId", resourceId); | ||||||
|  | |||||||
| @ -24,14 +24,12 @@ import java.util.Set; | |||||||
| 
 | 
 | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
| import com.cloud.utils.net.NetUtils; |  | ||||||
| import org.springframework.beans.factory.annotation.Autowired; |  | ||||||
| import org.springframework.beans.factory.annotation.Qualifier; |  | ||||||
| import com.cloud.network.router.NetworkHelper; |  | ||||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||||
| import org.cloud.network.router.deployment.RouterDeploymentDefinition; | import org.cloud.network.router.deployment.RouterDeploymentDefinition; | ||||||
| import org.cloud.network.router.deployment.RouterDeploymentDefinitionBuilder; | import org.cloud.network.router.deployment.RouterDeploymentDefinitionBuilder; | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.beans.factory.annotation.Qualifier; | ||||||
| 
 | 
 | ||||||
| import com.google.gson.Gson; | import com.google.gson.Gson; | ||||||
| 
 | 
 | ||||||
| @ -83,6 +81,7 @@ import com.cloud.network.dao.OvsProviderDao; | |||||||
| import com.cloud.network.dao.VirtualRouterProviderDao; | import com.cloud.network.dao.VirtualRouterProviderDao; | ||||||
| import com.cloud.network.lb.LoadBalancingRule; | import com.cloud.network.lb.LoadBalancingRule; | ||||||
| import com.cloud.network.lb.LoadBalancingRulesManager; | import com.cloud.network.lb.LoadBalancingRulesManager; | ||||||
|  | import com.cloud.network.router.NetworkHelper; | ||||||
| import com.cloud.network.router.VirtualRouter; | import com.cloud.network.router.VirtualRouter; | ||||||
| import com.cloud.network.router.VirtualRouter.Role; | import com.cloud.network.router.VirtualRouter.Role; | ||||||
| import com.cloud.network.router.VpcVirtualNetworkApplianceManager; | import com.cloud.network.router.VpcVirtualNetworkApplianceManager; | ||||||
| @ -103,6 +102,7 @@ import com.cloud.utils.crypt.DBEncryptionUtil; | |||||||
| import com.cloud.utils.db.QueryBuilder; | import com.cloud.utils.db.QueryBuilder; | ||||||
| import com.cloud.utils.db.SearchCriteria.Op; | import com.cloud.utils.db.SearchCriteria.Op; | ||||||
| import com.cloud.utils.exception.CloudRuntimeException; | import com.cloud.utils.exception.CloudRuntimeException; | ||||||
|  | import com.cloud.utils.net.NetUtils; | ||||||
| import com.cloud.vm.DomainRouterVO; | import com.cloud.vm.DomainRouterVO; | ||||||
| import com.cloud.vm.NicProfile; | import com.cloud.vm.NicProfile; | ||||||
| import com.cloud.vm.ReservationContext; | import com.cloud.vm.ReservationContext; | ||||||
| @ -703,7 +703,14 @@ NetworkMigrationResponder, AggregatedCommandExecutor, RedundantResource, DnsServ | |||||||
|         // save the password in DB |         // save the password in DB | ||||||
|         for (final VirtualRouter router : routers) { |         for (final VirtualRouter router : routers) { | ||||||
|             if (router.getState() == State.Running) { |             if (router.getState() == State.Running) { | ||||||
|                 return networkTopology.savePasswordToRouter(network, nic, uservm, router); |                 final boolean result = networkTopology.savePasswordToRouter(network, nic, uservm, router); | ||||||
|  |                 if (result) { | ||||||
|  |                     // Explicit password reset, while VM hasn't generated a password yet. | ||||||
|  |                     final UserVmVO userVmVO = _userVmDao.findById(vm.getId()); | ||||||
|  |                     userVmVO.setUpdateParameters(false); | ||||||
|  |                     _userVmDao.update(userVmVO.getId(), userVmVO); | ||||||
|  |                 } | ||||||
|  |                 return result; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         final String password = (String) uservm.getParameter(VirtualMachineProfile.Param.VmPassword); |         final String password = (String) uservm.getParameter(VirtualMachineProfile.Param.VmPassword); | ||||||
|  | |||||||
| @ -39,6 +39,11 @@ import java.util.stream.Collectors; | |||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| import javax.naming.ConfigurationException; | import javax.naming.ConfigurationException; | ||||||
| 
 | 
 | ||||||
|  | import org.apache.commons.codec.binary.Base64; | ||||||
|  | import org.apache.commons.collections.MapUtils; | ||||||
|  | import org.apache.commons.lang3.StringUtils; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
|  | 
 | ||||||
| import org.apache.cloudstack.acl.ControlledEntity.ACLType; | import org.apache.cloudstack.acl.ControlledEntity.ACLType; | ||||||
| import org.apache.cloudstack.acl.SecurityChecker.AccessType; | import org.apache.cloudstack.acl.SecurityChecker.AccessType; | ||||||
| import org.apache.cloudstack.affinity.AffinityGroupService; | import org.apache.cloudstack.affinity.AffinityGroupService; | ||||||
| @ -91,10 +96,6 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; | |||||||
| import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; | import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; | ||||||
| import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao; | import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao; | ||||||
| import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO; | import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO; | ||||||
| import org.apache.commons.codec.binary.Base64; |  | ||||||
| import org.apache.commons.collections.MapUtils; |  | ||||||
| import org.apache.commons.lang3.StringUtils; |  | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.AgentManager; | import com.cloud.agent.AgentManager; | ||||||
| import com.cloud.agent.api.Answer; | import com.cloud.agent.api.Answer; | ||||||
| @ -688,10 +689,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |||||||
| 
 | 
 | ||||||
|         if (result) { |         if (result) { | ||||||
|             userVm.setPassword(password); |             userVm.setPassword(password); | ||||||
|             // update the password in vm_details table too |  | ||||||
|             // Check if an SSH key pair was selected for the instance and if so |  | ||||||
|             // use it to encrypt & save the vm password |  | ||||||
|             encryptAndStorePassword(userVm, password); |  | ||||||
|         } else { |         } else { | ||||||
|             throw new CloudRuntimeException("Failed to reset password for the virtual machine "); |             throw new CloudRuntimeException("Failed to reset password for the virtual machine "); | ||||||
|         } |         } | ||||||
| @ -736,7 +733,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |||||||
|             } else { |             } else { | ||||||
|                 final UserVmVO userVm = _vmDao.findById(vmId); |                 final UserVmVO userVm = _vmDao.findById(vmId); | ||||||
|                 _vmDao.loadDetails(userVm); |                 _vmDao.loadDetails(userVm); | ||||||
|                 userVm.setPassword(password); |  | ||||||
|                 // update the password in vm_details table too |                 // update the password in vm_details table too | ||||||
|                 // Check if an SSH key pair was selected for the instance and if so |                 // Check if an SSH key pair was selected for the instance and if so | ||||||
|                 // use it to encrypt & save the vm password |                 // use it to encrypt & save the vm password | ||||||
| @ -850,8 +846,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |||||||
|                 userVm.setPassword(password); |                 userVm.setPassword(password); | ||||||
|                 //update the encrypted password in vm_details table too |                 //update the encrypted password in vm_details table too | ||||||
|                 encryptAndStorePassword(userVm, password); |                 encryptAndStorePassword(userVm, password); | ||||||
|  |             } else { | ||||||
|  |                 _vmDao.saveDetails(userVm); | ||||||
|             } |             } | ||||||
|             _vmDao.saveDetails(userVm); |  | ||||||
| 
 | 
 | ||||||
|             if (vmInstance.getState() == State.Stopped) { |             if (vmInstance.getState() == State.Stopped) { | ||||||
|                 s_logger.debug("Vm " + vmInstance + " is stopped, not rebooting it as a part of SSH Key reset"); |                 s_logger.debug("Vm " + vmInstance + " is stopped, not rebooting it as a part of SSH Key reset"); | ||||||
| @ -4461,6 +4458,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |||||||
|                     password = DBEncryptionUtil.decrypt(vm.getDetail("password")); |                     password = DBEncryptionUtil.decrypt(vm.getDetail("password")); | ||||||
|                 } else { |                 } else { | ||||||
|                     password = _mgr.generateRandomPassword(); |                     password = _mgr.generateRandomPassword(); | ||||||
|  |                     vm.setPassword(password); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
| @ -4499,11 +4497,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |||||||
|             // this value is not being sent to the backend; need only for api |             // this value is not being sent to the backend; need only for api | ||||||
|             // display purposes |             // display purposes | ||||||
|             if (template.getEnablePassword()) { |             if (template.getEnablePassword()) { | ||||||
|                 vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword)); |  | ||||||
|                 vm.setUpdateParameters(false); |  | ||||||
|                 if (vm.getDetail("password") != null) { |                 if (vm.getDetail("password") != null) { | ||||||
|                     _vmDetailsDao.remove(_vmDetailsDao.findDetail(vm.getId(), "password").getId()); |                     _vmDetailsDao.removeDetail(vm.getId(), "password"); | ||||||
|                 } |                 } | ||||||
|  |                 vm.setUpdateParameters(false); | ||||||
|                 _vmDao.update(vm.getId(), vm); |                 _vmDao.update(vm.getId(), vm); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @ -6180,7 +6177,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir | |||||||
|                             vm.setUpdateParameters(false); |                             vm.setUpdateParameters(false); | ||||||
|                             _vmDao.loadDetails(vm); |                             _vmDao.loadDetails(vm); | ||||||
|                             if (vm.getDetail("password") != null) { |                             if (vm.getDetail("password") != null) { | ||||||
|                                 _vmDetailsDao.remove(_vmDetailsDao.findDetail(vm.getId(), "password").getId()); |                                 _vmDetailsDao.removeDetail(vm.getId(), "password"); | ||||||
|                             } |                             } | ||||||
|                             _vmDao.update(vm.getId(), vm); |                             _vmDao.update(vm.getId(), vm); | ||||||
|                         } |                         } | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -17,8 +17,19 @@ | |||||||
| 
 | 
 | ||||||
| """ Custom base class for Nuage VSP SDN plugin specific Marvin tests | """ Custom base class for Nuage VSP SDN plugin specific Marvin tests | ||||||
| """ | """ | ||||||
|  | import functools | ||||||
|  | import importlib | ||||||
|  | import logging | ||||||
|  | import socket | ||||||
|  | 
 | ||||||
|  | import sys | ||||||
|  | import time | ||||||
| # Import Local Modules | # Import Local Modules | ||||||
| from bambou.nurest_object import NURESTObject | from bambou.nurest_object import NURESTObject | ||||||
|  | from marvin.cloudstackAPI import (restartVPC, | ||||||
|  |                                   enableNuageUnderlayVlanIpRange, | ||||||
|  |                                   disableNuageUnderlayVlanIpRange, | ||||||
|  |                                   listNuageUnderlayVlanIpRanges) | ||||||
| from marvin.cloudstackTestCase import cloudstackTestCase, unittest | from marvin.cloudstackTestCase import cloudstackTestCase, unittest | ||||||
| from marvin.lib.base import (Domain, | from marvin.lib.base import (Domain, | ||||||
|                              EgressFireWallRule, |                              EgressFireWallRule, | ||||||
| @ -44,22 +55,10 @@ from marvin.lib.base import (Domain, | |||||||
| from marvin.lib.common import (get_domain, | from marvin.lib.common import (get_domain, | ||||||
|                                get_template, |                                get_template, | ||||||
|                                get_zone) |                                get_zone) | ||||||
| from marvin.cloudstackAPI import (restartVPC, |  | ||||||
|                                   enableNuageUnderlayVlanIpRange, |  | ||||||
|                                   disableNuageUnderlayVlanIpRange, |  | ||||||
|                                   listNuageUnderlayVlanIpRanges) |  | ||||||
| 
 |  | ||||||
| from nuage_test_data import nuage_test_data |  | ||||||
| from nuage_vsp_statistics import VsdDataCollector |  | ||||||
| 
 |  | ||||||
| # Import System Modules | # Import System Modules | ||||||
| from retry import retry | from retry import retry | ||||||
| import importlib | 
 | ||||||
| import functools | from nuage_test_data import nuage_test_data | ||||||
| import logging |  | ||||||
| import socket |  | ||||||
| import time |  | ||||||
| import sys |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class needscleanup(object): | class needscleanup(object): | ||||||
| @ -89,38 +88,6 @@ class needscleanup(object): | |||||||
|         return _wrapper |         return _wrapper | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class gherkin(object): |  | ||||||
|     """Decorator to mark a method as Gherkin style. |  | ||||||
|        Add extra colored logging |  | ||||||
|     """ |  | ||||||
|     BLACK = "\033[0;30m" |  | ||||||
|     BLUE = "\033[0;34m" |  | ||||||
|     GREEN = "\033[0;32m" |  | ||||||
|     CYAN = "\033[0;36m" |  | ||||||
|     RED = "\033[0;31m" |  | ||||||
|     BOLDBLUE = "\033[1;34m" |  | ||||||
|     NORMAL = "\033[0m" |  | ||||||
| 
 |  | ||||||
|     def __init__(self, method): |  | ||||||
|         self.method = method |  | ||||||
| 
 |  | ||||||
|     def __get__(self, obj=None, objtype=None): |  | ||||||
|         @functools.wraps(self.method) |  | ||||||
|         def _wrapper(*args, **kwargs): |  | ||||||
|             gherkin_step = self.method.__name__.replace("_", " ").capitalize() |  | ||||||
|             obj.info("=G= %s%s%s" % (self.BOLDBLUE, gherkin_step, self.NORMAL)) |  | ||||||
|             try: |  | ||||||
|                 result = self.method(obj, *args, **kwargs) |  | ||||||
|                 obj.info("=G= %s%s: [SUCCESS]%s" % |  | ||||||
|                          (self.GREEN, gherkin_step, self.NORMAL)) |  | ||||||
|                 return result |  | ||||||
|             except Exception as e: |  | ||||||
|                 obj.info("=G= %s%s: [FAILED]%s%s" % |  | ||||||
|                          (self.RED, gherkin_step, self.NORMAL, e)) |  | ||||||
|                 raise |  | ||||||
|         return _wrapper |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| class nuageTestCase(cloudstackTestCase): | class nuageTestCase(cloudstackTestCase): | ||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
| @ -291,7 +258,8 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|             address=cls.nuage_vsp_device.hostname, |             address=cls.nuage_vsp_device.hostname, | ||||||
|             user=cls.nuage_vsp_device.username, |             user=cls.nuage_vsp_device.username, | ||||||
|             password=cls.nuage_vsp_device.password, |             password=cls.nuage_vsp_device.password, | ||||||
|             version=cls.nuage_vsp_device.apiversion[1] + "." + cls.nuage_vsp_device.apiversion[3] |             version=cls.nuage_vsp_device.apiversion[1] + | ||||||
|  |             "." + cls.nuage_vsp_device.apiversion[3] | ||||||
|         ) |         ) | ||||||
|         vsd_api_client.new_session() |         vsd_api_client.new_session() | ||||||
|         cls.vsd = VSDHelpers(vsd_api_client) |         cls.vsd = VSDHelpers(vsd_api_client) | ||||||
| @ -391,7 +359,7 @@ class nuageTestCase(cloudstackTestCase): | |||||||
| 
 | 
 | ||||||
|     # create_Vpc - Creates VPC with the given VPC offering |     # create_Vpc - Creates VPC with the given VPC offering | ||||||
|     @needscleanup |     @needscleanup | ||||||
|     def create_Vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None, |     def create_vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None, | ||||||
|                    account=None, networkDomain=None): |                    account=None, networkDomain=None): | ||||||
|         """Creates VPC with the given VPC offering |         """Creates VPC with the given VPC offering | ||||||
|         :param vpc_offering: vpc offering |         :param vpc_offering: vpc offering | ||||||
| @ -466,7 +434,8 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|     @needscleanup |     @needscleanup | ||||||
|     def create_Network(cls, nw_off, gateway="10.1.1.1", |     def create_Network(cls, nw_off, gateway="10.1.1.1", | ||||||
|                        netmask="255.255.255.0", vpc=None, acl_list=None, |                        netmask="255.255.255.0", vpc=None, acl_list=None, | ||||||
|                        testdata=None, account=None, vlan=None, externalid=None): |                        testdata=None, account=None, vlan=None, | ||||||
|  |                        externalid=None): | ||||||
|         """Creates Network with the given Network offering |         """Creates Network with the given Network offering | ||||||
|         :param nw_off: Network offering |         :param nw_off: Network offering | ||||||
|         :type nw_off: NetworkOffering |         :type nw_off: NetworkOffering | ||||||
| @ -502,7 +471,7 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|                                  vlan=vlan, |                                  vlan=vlan, | ||||||
|                                  externalid=externalid, |                                  externalid=externalid, | ||||||
|                                  vpcid=vpc.id if vpc else cls.vpc.id |                                  vpcid=vpc.id if vpc else cls.vpc.id | ||||||
|                                  if hasattr(cls, "vpc") else None, |                                  if hasattr(cls, "vpc") and cls.vpc else None, | ||||||
|                                  aclid=acl_list.id if acl_list else None |                                  aclid=acl_list.id if acl_list else None | ||||||
|                                  ) |                                  ) | ||||||
|         cls.debug("Created network with ID - %s" % network.id) |         cls.debug("Created network with ID - %s" % network.id) | ||||||
| @ -513,12 +482,14 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|         if not hasattr(nw_off, "id"): |         if not hasattr(nw_off, "id"): | ||||||
|             nw_off = self.create_NetworkOffering(nw_off) |             nw_off = self.create_NetworkOffering(nw_off) | ||||||
|         self.debug("Updating Network with ID - %s" % network.id) |         self.debug("Updating Network with ID - %s" % network.id) | ||||||
|         network.update(self.api_client, |         updated_network =\ | ||||||
|                        networkofferingid=nw_off.id, |             network.update(self.api_client, | ||||||
|                        changecidr=False, |                            networkofferingid=nw_off.id, | ||||||
|                        forced=forced |                            changecidr=False, | ||||||
|                        ) |                            forced=forced | ||||||
|  |                            ) | ||||||
|         self.debug("Updated network with ID - %s" % network.id) |         self.debug("Updated network with ID - %s" % network.id) | ||||||
|  |         return updated_network | ||||||
| 
 | 
 | ||||||
|     # delete_Network - Deletes the given network |     # delete_Network - Deletes the given network | ||||||
|     def delete_Network(self, network): |     def delete_Network(self, network): | ||||||
| @ -640,7 +611,8 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|                                            networkid=network.id |                                            networkid=network.id | ||||||
|                                            if vpc is None else None, |                                            if vpc is None else None, | ||||||
|                                            vpcid=vpc.id if vpc else self.vpc.id |                                            vpcid=vpc.id if vpc else self.vpc.id | ||||||
|                                            if hasattr(self, "vpc") else None |                                            if hasattr(self, "vpc") and self.vpc | ||||||
|  |                                            else None | ||||||
|                                            ) |                                            ) | ||||||
|         self.debug("Associated public IP address - %s with network with ID - " |         self.debug("Associated public IP address - %s with network with ID - " | ||||||
|                    "%s" % (public_ip.ipaddress.ipaddress, network.id)) |                    "%s" % (public_ip.ipaddress.ipaddress, network.id)) | ||||||
| @ -733,7 +705,8 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|                                      traffictype=traffic_type |                                      traffictype=traffic_type | ||||||
|                                      ) |                                      ) | ||||||
| 
 | 
 | ||||||
|     def ssh_into_VM(self, vm, public_ip, reconnect=True, negative_test=False, keypair=None): |     def ssh_into_VM(self, vm, public_ip, reconnect=True, negative_test=False, | ||||||
|  |                     keypair=None): | ||||||
|         """Creates a SSH connection to the VM |         """Creates a SSH connection to the VM | ||||||
| 
 | 
 | ||||||
|         :returns: the SSH connection |         :returns: the SSH connection | ||||||
| @ -753,7 +726,8 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|                 ipaddress=public_ip.ipaddress.ipaddress, |                 ipaddress=public_ip.ipaddress.ipaddress, | ||||||
|                 reconnect=reconnect, |                 reconnect=reconnect, | ||||||
|                 retries=3 if negative_test else 30, |                 retries=3 if negative_test else 30, | ||||||
|                 keyPairFileLocation=keypair.private_key_file if keypair else None |                 keyPairFileLocation=keypair.private_key_file | ||||||
|  |                 if keypair else None | ||||||
|             ) |             ) | ||||||
|             self.debug("Successful to SSH into VM with ID - %s on " |             self.debug("Successful to SSH into VM with ID - %s on " | ||||||
|                        "public IP address - %s" % |                        "public IP address - %s" % | ||||||
| @ -781,7 +755,6 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|             self.debug("SSH client executed command result is None") |             self.debug("SSH client executed command result is None") | ||||||
|         return ret_data |         return ret_data | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     def wget_from_server(self, public_ip, port=80, file_name="index.html", |     def wget_from_server(self, public_ip, port=80, file_name="index.html", | ||||||
|                          disable_system_proxies=True): |                          disable_system_proxies=True): | ||||||
|         """Fetches file with the given file name from a web server |         """Fetches file with the given file name from a web server | ||||||
| @ -825,10 +798,9 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|             name=provider_name, |             name=provider_name, | ||||||
|             physicalnetworkid=self.vsp_physical_network.id |             physicalnetworkid=self.vsp_physical_network.id | ||||||
|         ) |         ) | ||||||
|         self.assertEqual(isinstance(providers, list), True, |         self.assertIsInstance(providers, list, | ||||||
|                          "List Network Service Provider should return a " |                               "List Network Service Provider should return a " | ||||||
|                          "valid list" |                               "valid list") | ||||||
|                          ) |  | ||||||
|         self.assertEqual(provider_name, providers[0].name, |         self.assertEqual(provider_name, providers[0].name, | ||||||
|                          "Name of the Network Service Provider should match " |                          "Name of the Network Service Provider should match " | ||||||
|                          "with the returned list data" |                          "with the returned list data" | ||||||
| @ -873,7 +845,7 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|         self.debug("Successfully validated the creation and state of VPC " |         self.debug("Successfully validated the creation and state of VPC " | ||||||
|                    "offering - %s" % vpc_offering.name) |                    "offering - %s" % vpc_offering.name) | ||||||
| 
 | 
 | ||||||
|     def validate_Vpc(self, vpc, state=None): |     def validate_vpc(self, vpc, state=None): | ||||||
|         """Validates the VPC |         """Validates the VPC | ||||||
| 
 | 
 | ||||||
|         Fetches the vpc by id, |         Fetches the vpc by id, | ||||||
| @ -989,7 +961,7 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|         self.debug("Successfully validated the deployment and state of VM - %s" |         self.debug("Successfully validated the deployment and state of VM - %s" | ||||||
|                    % vm.name) |                    % vm.name) | ||||||
| 
 | 
 | ||||||
|     def check_Router_state(self, router, state=None): |     def check_Router_state(self, router=None, network=None, state=None): | ||||||
|         """Validates the Router state |         """Validates the Router state | ||||||
|             :param router: cs object |             :param router: cs object | ||||||
|             :type router: Router |             :type router: Router | ||||||
| @ -997,12 +969,17 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|             :raise AssertionError when router isn't found, |             :raise AssertionError when router isn't found, | ||||||
|                 or has an incorrect state.""" |                 or has an incorrect state.""" | ||||||
| 
 | 
 | ||||||
|         self.debug("Validating the deployment and state of Router - %s" % |         if router: | ||||||
|                    router.name) |             self.debug("Validating the deployment and state of Router - %s" % | ||||||
|         routers = Router.list(self.api_client, |                        router.name) | ||||||
|                               id=router.id, |             routers = Router.list(self.api_client, id=router.id, | ||||||
|                               listall=True |                                   listall=True) | ||||||
|                               ) |         elif network: | ||||||
|  |             routers = Router.list(self.api_client, networkid=network.id, | ||||||
|  |                                   listall=True) | ||||||
|  |         else: | ||||||
|  |             raise AttributeError("Either router or network " | ||||||
|  |                                  "has to be specified") | ||||||
|         self.assertEqual(isinstance(routers, list), True, |         self.assertEqual(isinstance(routers, list), True, | ||||||
|                          "List router should return a valid list" |                          "List router should return a valid list" | ||||||
|                          ) |                          ) | ||||||
| @ -1011,7 +988,9 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|                              "Virtual router is not in the expected state" |                              "Virtual router is not in the expected state" | ||||||
|                              ) |                              ) | ||||||
|         self.debug("Successfully validated the deployment and state of Router " |         self.debug("Successfully validated the deployment and state of Router " | ||||||
|                    "- %s" % router.name) |                    "- %s" % routers[0].name) | ||||||
|  | 
 | ||||||
|  |         return routers[0] | ||||||
| 
 | 
 | ||||||
|     def validate_PublicIPAddress(self, public_ip, network, static_nat=False, |     def validate_PublicIPAddress(self, public_ip, network, static_nat=False, | ||||||
|                                  vm=None): |                                  vm=None): | ||||||
| @ -1245,7 +1224,6 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|             self.debug("Failed to get the subnet id due to %s" % e) |             self.debug("Failed to get the subnet id due to %s" % e) | ||||||
|             self.fail("Unable to get the subnet id, failing the test case") |             self.fail("Unable to get the subnet id, failing the test case") | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     def verify_vsd_shared_network(self, domain_id, network, |     def verify_vsd_shared_network(self, domain_id, network, | ||||||
|                                   gateway="10.1.1.1"): |                                   gateway="10.1.1.1"): | ||||||
|         """Verifies the given CloudStack domain and |         """Verifies the given CloudStack domain and | ||||||
| @ -1324,6 +1302,8 @@ class nuageTestCase(cloudstackTestCase): | |||||||
|                             ) |                             ) | ||||||
|         vm_info = VirtualMachine.list(self.api_client, id=vm.id)[0] |         vm_info = VirtualMachine.list(self.api_client, id=vm.id)[0] | ||||||
|         for nic in vm_info.nic: |         for nic in vm_info.nic: | ||||||
|  |             if nic.type == "Shared": | ||||||
|  |                 continue | ||||||
|             vsd_subnet = self.vsd.get_subnet( |             vsd_subnet = self.vsd.get_subnet( | ||||||
|                 filter=self.get_externalID_filter(nic.networkid)) |                 filter=self.get_externalID_filter(nic.networkid)) | ||||||
|             vsd_vport = self.vsd.get_vport( |             vsd_vport = self.vsd.get_vport( | ||||||
|  | |||||||
| @ -14,6 +14,7 @@ | |||||||
| # KIND, either express or implied.  See the License for the | # KIND, either express or implied.  See the License for the | ||||||
| # specific language governing permissions and limitations | # specific language governing permissions and limitations | ||||||
| # under the License. | # under the License. | ||||||
|  | import functools | ||||||
| 
 | 
 | ||||||
| from marvin.cloudstackAPI import createSSHKeyPair, deleteSSHKeyPair | from marvin.cloudstackAPI import createSSHKeyPair, deleteSSHKeyPair | ||||||
| 
 | 
 | ||||||
| @ -45,3 +46,53 @@ class MySSHKeyPair: | |||||||
|         cmd.account = self.account |         cmd.account = self.account | ||||||
|         cmd.domainid = self.domainid |         cmd.domainid = self.domainid | ||||||
|         apiclient.deleteSSHKeyPair(cmd) |         apiclient.deleteSSHKeyPair(cmd) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class GherkinMetaClass(type): | ||||||
|  |     def __new__(mcs, name, bases, namespace): | ||||||
|  |         namespace = { | ||||||
|  |             k: gherkin(v) | ||||||
|  |             if k.startswith('given_') or | ||||||
|  |             k.startswith('when_') or | ||||||
|  |             k.startswith('then_') | ||||||
|  |             else v for k, v in namespace.items() | ||||||
|  |         } | ||||||
|  |         return super(GherkinMetaClass, mcs)\ | ||||||
|  |             .__new__(mcs, name, bases, namespace) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class gherkin(object): | ||||||
|  |     """Decorator to mark a method as Gherkin style. | ||||||
|  |        Add extra colored logging | ||||||
|  |     """ | ||||||
|  |     BLACK = "\033[0;30m" | ||||||
|  |     BLUE = "\033[0;34m" | ||||||
|  |     GREEN = "\033[0;32m" | ||||||
|  |     CYAN = "\033[0;36m" | ||||||
|  |     RED = "\033[0;31m" | ||||||
|  |     BOLDBLUE = "\033[1;34m" | ||||||
|  |     NORMAL = "\033[0m" | ||||||
|  | 
 | ||||||
|  |     def __init__(self, method): | ||||||
|  |         self.method = method | ||||||
|  | 
 | ||||||
|  |     def __get__(self, obj=None, objtype=None): | ||||||
|  |         @functools.wraps(self.method) | ||||||
|  |         def _wrapper(*args, **kwargs): | ||||||
|  |             if self.method.__doc__: | ||||||
|  |                 gherkin_step = self.method.__doc__.format(*args, **kwargs) | ||||||
|  |             else: | ||||||
|  |                 gherkin_step = self.method.__name__\ | ||||||
|  |                     .replace("_", " ")\ | ||||||
|  |                     .capitalize() | ||||||
|  |             obj.info("=G= %s%s%s" % (self.BOLDBLUE, gherkin_step, self.NORMAL)) | ||||||
|  |             try: | ||||||
|  |                 result = self.method(obj, *args, **kwargs) | ||||||
|  |                 obj.info("=G= %s%s: [SUCCESS]%s" % | ||||||
|  |                          (self.GREEN, gherkin_step, self.NORMAL)) | ||||||
|  |                 return result | ||||||
|  |             except Exception as e: | ||||||
|  |                 obj.info("=G= %s%s: [FAILED]%s%s" % | ||||||
|  |                          (self.RED, gherkin_step, self.NORMAL, e)) | ||||||
|  |                 raise | ||||||
|  |         return _wrapper | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -19,11 +19,11 @@ | |||||||
| Nuage VSP SDN plugin | Nuage VSP SDN plugin | ||||||
| """ | """ | ||||||
| # Import Local Modules | # Import Local Modules | ||||||
| from nuageTestCase import (nuageTestCase, gherkin) | from nuageTestCase import (nuageTestCase) | ||||||
|  | from nuage_lib import gherkin | ||||||
| from marvin.cloudstackAPI import updateVirtualMachine, updateZone | from marvin.cloudstackAPI import updateVirtualMachine, updateZone | ||||||
| from marvin.lib.base import (Account, | from marvin.lib.base import (Account, | ||||||
|                              Network, |                              Network, | ||||||
|                              VirtualMachine, |  | ||||||
|                              Configurations, |                              Configurations, | ||||||
|                              NetworkOffering) |                              NetworkOffering) | ||||||
| # Import System Modules | # Import System Modules | ||||||
| @ -56,7 +56,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|         cls.api_client.updateZone(cmd) |         cls.api_client.updateZone(cmd) | ||||||
|         cls.vpc_offering = cls.create_VpcOffering( |         cls.vpc_offering = cls.create_VpcOffering( | ||||||
|             cls.test_data["nuagevsp"]["vpc_offering_nuage_dhcp"]) |             cls.test_data["nuagevsp"]["vpc_offering_nuage_dhcp"]) | ||||||
|         cls.vpc1 = cls.create_Vpc(cls.vpc_offering, cidr="10.0.0.0/16", |         cls.vpc1 = cls.create_vpc(cls.vpc_offering, cidr="10.0.0.0/16", | ||||||
|                                   networkDomain="testvpc.com") |                                   networkDomain="testvpc.com") | ||||||
| 
 | 
 | ||||||
|         cls.vpc_network_offering = cls.create_NetworkOffering( |         cls.vpc_network_offering = cls.create_NetworkOffering( | ||||||
| @ -423,7 +423,8 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     def verify_dhcp_on_vm( |     def verify_dhcp_on_vm( | ||||||
|             self, dhcpleasefile, dhcp_option_map, ssh_client, cleanlease=True): |             self, dhcpleasefile, dhcp_option_map, ssh_client, cleanlease=True): | ||||||
|         if self.isSimulator: |         if self.isSimulator: | ||||||
|             self.debug("Simulator Environment: Skipping VM DHCP option verification") |             self.debug("Simulator Environment: " | ||||||
|  |                        "Skipping VM DHCP option verification") | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         cmd = 'cat /var/lib/dhclient/'+dhcpleasefile |         cmd = 'cat /var/lib/dhclient/'+dhcpleasefile | ||||||
| @ -455,8 +456,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|         self.debug("clear lease is done properly:" + completeoutput) |         self.debug("clear lease is done properly:" + completeoutput) | ||||||
| 
 | 
 | ||||||
|     def update_zone_details(self, value): |     def update_zone_details(self, value): | ||||||
|         """Updates the VM data""" |         """Updates Network Domain at zone level""" | ||||||
|         # update Network Domain at zone level |  | ||||||
|         cmd = updateZone.updateZoneCmd() |         cmd = updateZone.updateZoneCmd() | ||||||
|         cmd.id = self.zone.id |         cmd.id = self.zone.id | ||||||
|         cmd.domain = value |         cmd.domain = value | ||||||
| @ -489,9 +489,9 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|         self.validate_NetworkOffering(network_offering, state="Enabled") |         self.validate_NetworkOffering(network_offering, state="Enabled") | ||||||
|         self.validate_Network(network) |         self.validate_Network(network) | ||||||
| 
 | 
 | ||||||
|     def validate_vpc(self, vpc, vpc_offering): |     def validate_vpc_and_vpcoffering(self, vpc, vpc_offering): | ||||||
|         self.debug("Validating vpc...") |         self.debug("Validating vpc...") | ||||||
|         self.validate_Vpc(vpc) |         self.validate_vpc(vpc) | ||||||
|         self.validate_VpcOffering(vpc_offering) |         self.validate_VpcOffering(vpc_offering) | ||||||
| 
 | 
 | ||||||
|     def verify_dhcp_options_on_vm( |     def verify_dhcp_options_on_vm( | ||||||
| @ -590,18 +590,18 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|         self.validate_NetworkOffering(network_offering, state="Enabled") |         self.validate_NetworkOffering(network_offering, state="Enabled") | ||||||
|         return network_offering |         return network_offering | ||||||
| 
 | 
 | ||||||
|     def create_vpc(self, vpc_offering, cidr="10.0.0.0/16"): |     def create_and_validate_vpc(self, vpc_offering, cidr="10.0.0.0/16"): | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Nuage VSP VPC offering...") |         self.debug("Creating a VPC with Nuage VSP VPC offering...") | ||||||
|         vpc = self.create_Vpc(vpc_offering, cidr=cidr, |         vpc = self.create_vpc(vpc_offering, cidr=cidr, | ||||||
|                               networkDomain="testvpc.com") |                               networkDomain="testvpc.com") | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         return vpc |         return vpc | ||||||
| 
 | 
 | ||||||
|     def create_vpc_with_tier(self, domain_name="testvpc.com"): |     def create_vpc_with_tier(self, domain_name="testvpc.com"): | ||||||
|         vpc_offering = self.create_vpc_offering_with_nuage_dhcp() |         vpc_offering = self.create_vpc_offering_with_nuage_dhcp() | ||||||
|         vpc = self.create_vpc(vpc_offering) |         vpc = self.create_and_validate_vpc(vpc_offering) | ||||||
| 
 | 
 | ||||||
|         vpc_network_offering = self.create_vpc_network_offering() |         vpc_network_offering = self.create_vpc_network_offering() | ||||||
|         acl_list = self.create_acl_list_with_item(vpc) |         acl_list = self.create_acl_list_with_item(vpc) | ||||||
| @ -1267,8 +1267,9 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|         self.when_i_stop_and_start_a_vm(vm1) |         self.when_i_stop_and_start_a_vm(vm1) | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             vm1.remove_nic( |             vm1.remove_nic( | ||||||
|                 self.api_client, [nic for nic in result.nic |                 self.api_client, | ||||||
|                                   if nic.networkid == network.id][0]) |                 [nic for nic in result.nic | ||||||
|  |                  if nic.networkid == network.id][0].id) | ||||||
| 
 | 
 | ||||||
|     def validate_all_extra_dhcp_for_update_multinic( |     def validate_all_extra_dhcp_for_update_multinic( | ||||||
|             self, network, |             self, network, | ||||||
| @ -1683,7 +1684,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_02_nuage_extra_dhcp_single_nic_in_vpc(self): |     def test_02_nuage_extra_dhcp_single_nic_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_deploy_vm( |         self.validate_all_extra_dhcp_deploy_vm( | ||||||
| @ -1710,7 +1711,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_05_nuage_extra_dhcp_update_vm_in_vpc(self): |     def test_05_nuage_extra_dhcp_update_vm_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_after_vm_update( |         self.validate_all_extra_dhcp_after_vm_update( | ||||||
| @ -1736,7 +1737,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_08_nuage_extra_dhcp_add_nic_in_vpc(self): |     def test_08_nuage_extra_dhcp_add_nic_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_after_plug_nic( |         self.validate_all_extra_dhcp_after_plug_nic( | ||||||
| @ -1762,7 +1763,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_11_nuage_extra_dhcp_deploy_multi_nic_vm_in_vpc(self): |     def test_11_nuage_extra_dhcp_deploy_multi_nic_vm_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_multi_nic( |         self.validate_all_extra_dhcp_for_multi_nic( | ||||||
| @ -1788,7 +1789,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_14_nuage_extra_dhcp_update_multi_nic_in_vpc(self): |     def test_14_nuage_extra_dhcp_update_multi_nic_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_update_multinic( |         self.validate_all_extra_dhcp_for_update_multinic( | ||||||
| @ -1814,7 +1815,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_17_nuage_extra_dhcp_remove_nic_in_vpc(self): |     def test_17_nuage_extra_dhcp_remove_nic_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_remove_nic_from_vm( |         self.validate_all_extra_dhcp_for_remove_nic_from_vm( | ||||||
| @ -1841,7 +1842,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_20_nuage_nuage_extra_dhcp_vm_actions_in_vpc(self): |     def test_20_nuage_nuage_extra_dhcp_vm_actions_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_vm_actions_in_network( |         self.validate_all_extra_dhcp_for_vm_actions_in_network( | ||||||
| @ -1868,7 +1869,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_23_nuage_nuage_extra_dhcp_network_actions_in_vpc(self): |     def test_23_nuage_nuage_extra_dhcp_network_actions_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_network_actions_in_network( |         self.validate_all_extra_dhcp_for_network_actions_in_network( | ||||||
| @ -1895,7 +1896,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_26_nuage_nuage_extra_dhcp_nic_after_migrate_in_vpc(self): |     def test_26_nuage_nuage_extra_dhcp_nic_after_migrate_in_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_add_remove_nic_after_migrate( |         self.validate_all_extra_dhcp_for_add_remove_nic_after_migrate( | ||||||
| @ -1929,7 +1930,7 @@ class TestNuageExtraDhcp(nuageTestCase): | |||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_30_nuage_extra_dhcp_allocated_vpc(self): |     def test_30_nuage_extra_dhcp_allocated_vpc(self): | ||||||
|         self.update_zone_details("testvpc.com") |         self.update_zone_details("testvpc.com") | ||||||
|         self.validate_vpc(self.vpc1, self.vpc_offering) |         self.validate_vpc_and_vpcoffering(self.vpc1, self.vpc_offering) | ||||||
|         self.validate_Network(self.vpc_network) |         self.validate_Network(self.vpc_network) | ||||||
| 
 | 
 | ||||||
|         self.validate_all_extra_dhcp_for_network_in_allocated( |         self.validate_all_extra_dhcp_for_network_in_allocated( | ||||||
|  | |||||||
| @ -23,7 +23,6 @@ from marvin.cloudstackAPI import updateZone | |||||||
| from marvin.lib.base import Account, Network | from marvin.lib.base import Account, Network | ||||||
| # Import System Modules | # Import System Modules | ||||||
| from nose.plugins.attrib import attr | from nose.plugins.attrib import attr | ||||||
| import time |  | ||||||
| 
 | 
 | ||||||
| UPDATED_DOMAIN_NAME = "update.com" | UPDATED_DOMAIN_NAME = "update.com" | ||||||
| 
 | 
 | ||||||
| @ -124,7 +123,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|         self.debug("command is executed properly " + cmd) |         self.debug("command is executed properly " + cmd) | ||||||
|         completeoutput = str(outputlist).strip('[]') |         completeoutput = str(outputlist).strip('[]') | ||||||
|         self.debug("complete output is " + completeoutput) |         self.debug("complete output is " + completeoutput) | ||||||
|         expectedlist = ['2 received', dst_vm.name + '.' + domain_name, dst_vm.ipaddress] |         expectedlist = ['2 received', dst_vm.name + '.' + domain_name, | ||||||
|  |                         dst_vm.ipaddress] | ||||||
|         for item in expectedlist: |         for item in expectedlist: | ||||||
|             if item in completeoutput: |             if item in completeoutput: | ||||||
|                 self.debug("excepted value found in vm: " + item) |                 self.debug("excepted value found in vm: " + item) | ||||||
| @ -163,7 +163,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Internal DNS check point on VSD |         # Internal DNS check point on VSD | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option( |             self.verify_vsd_dhcp_option( | ||||||
| @ -204,7 +205,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Internal DNS check point on VSD |         # Internal DNS check point on VSD | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option( |             self.verify_vsd_dhcp_option( | ||||||
| @ -264,7 +266,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Internal DNS check point on VSD |         # Internal DNS check point on VSD | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option( |             self.verify_vsd_dhcp_option( | ||||||
| @ -373,7 +376,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|                          "Network Domain is not updated as expected" |                          "Network Domain is not updated as expected" | ||||||
|                          ) |                          ) | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option( |             self.verify_vsd_dhcp_option( | ||||||
| @ -432,7 +436,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|                          "Network Domain is not updated as expected" |                          "Network Domain is not updated as expected" | ||||||
|                          ) |                          ) | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option( |             self.verify_vsd_dhcp_option( | ||||||
| @ -484,7 +489,7 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|         vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"]) |         vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"]) | ||||||
|         self.validate_VpcOffering(vpc_off, state="Enabled") |         self.validate_VpcOffering(vpc_off, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False) |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False) | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating Nuage Vsp VPC Network offering...") |         self.debug("Creating Nuage Vsp VPC Network offering...") | ||||||
|         network_offering = self.create_NetworkOffering( |         network_offering = self.create_NetworkOffering( | ||||||
| @ -501,10 +506,12 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Internal DNS check point on VSD |         # Internal DNS check point on VSD | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True) |             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                         nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True) |             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True) | ||||||
| 
 | 
 | ||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="true") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="true") | ||||||
| @ -527,7 +534,7 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"]) |         vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"]) | ||||||
|         self.validate_VpcOffering(vpc_off, state="Enabled") |         self.validate_VpcOffering(vpc_off, state="Enabled") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False) |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False) | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating Nuage Vsp VPC Network offering...") |         self.debug("Creating Nuage Vsp VPC Network offering...") | ||||||
|         network_offering = self.create_NetworkOffering( |         network_offering = self.create_NetworkOffering( | ||||||
| @ -546,7 +553,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, "vpc.com", network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, "vpc.com", network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True) |             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                         nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True) |             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True) | ||||||
| 
 | 
 | ||||||
|         self.test_data["virtual_machine"]["displayname"] = "vm2" |         self.test_data["virtual_machine"]["displayname"] = "vm2" | ||||||
| @ -557,7 +565,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|         self.verify_vsd_vm(vm_2) |         self.verify_vsd_vm(vm_2) | ||||||
|         for nic in vm_2.nic: |         for nic in vm_2.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True) |             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                         nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True) |             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True) | ||||||
| 
 | 
 | ||||||
|         public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc) |         public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc) | ||||||
| @ -594,7 +603,7 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"]) |         vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"]) | ||||||
|         self.validate_VpcOffering(vpc_off, state="Enabled") |         self.validate_VpcOffering(vpc_off, state="Enabled") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False) |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False) | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating Nuage Vsp VPC Network offering...") |         self.debug("Creating Nuage Vsp VPC Network offering...") | ||||||
|         network_offering = self.create_NetworkOffering( |         network_offering = self.create_NetworkOffering( | ||||||
| @ -610,10 +619,12 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|         self.verify_vsd_vm(vm_1) |         self.verify_vsd_vm(vm_1) | ||||||
|         # Internal DNS check point on VSD |         # Internal DNS check point on VSD | ||||||
|         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) |         self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1) | ||||||
|         self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, network_1) |         self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                     network_1) | ||||||
|         for nic in vm_1.nic: |         for nic in vm_1.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True) |             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                         nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True) |             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True) | ||||||
| 
 | 
 | ||||||
|         self.test_data["virtual_machine"]["displayname"] = "vm2" |         self.test_data["virtual_machine"]["displayname"] = "vm2" | ||||||
| @ -624,7 +635,8 @@ class TestNuageInternalDns(nuageTestCase): | |||||||
|         self.verify_vsd_vm(vm_2) |         self.verify_vsd_vm(vm_2) | ||||||
|         for nic in vm_2.nic: |         for nic in vm_2.nic: | ||||||
|             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) |             self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True) |             self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, | ||||||
|  |                                         nic, True) | ||||||
|             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True) |             self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True) | ||||||
| 
 | 
 | ||||||
|         public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc) |         public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc) | ||||||
|  | |||||||
| @ -1154,7 +1154,7 @@ class TestNuageMigration(nuageTestCase): | |||||||
|     @attr(tags=["migrateACS", "vpcnovms"], |     @attr(tags=["migrateACS", "vpcnovms"], | ||||||
|           required_hardware="false") |           required_hardware="false") | ||||||
|     def test_10_migrate_native_vpc(self): |     def test_10_migrate_native_vpc(self): | ||||||
|         vpc = self.create_Vpc(self.native_vpc_offering) |         vpc = self.create_vpc(self.native_vpc_offering) | ||||||
|         network = self.create_Network(self.native_vpc_network_offering, |         network = self.create_Network(self.native_vpc_network_offering, | ||||||
|                                       vpc=vpc) |                                       vpc=vpc) | ||||||
|         self.create_VM(network) |         self.create_VM(network) | ||||||
| @ -1222,8 +1222,8 @@ class TestNuageMigration(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "VpcVirtualRouter") |                    "VpcVirtualRouter") | ||||||
|         vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating native VPC Network Tier offering " |         self.debug("Creating native VPC Network Tier offering " | ||||||
|                    "with Static NAT service provider as VPCVR") |                    "with Static NAT service provider as VPCVR") | ||||||
| @ -1484,8 +1484,8 @@ class TestNuageMigration(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "VpcVirtualRouter") |                    "VpcVirtualRouter") | ||||||
|         vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating native VPC Network Tier offering " |         self.debug("Creating native VPC Network Tier offering " | ||||||
|                    "with Static NAT service provider as VPCVR") |                    "with Static NAT service provider as VPCVR") | ||||||
| @ -1802,8 +1802,8 @@ class TestNuageMigration(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "VpcVirtualRouter") |                    "VpcVirtualRouter") | ||||||
|         vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating native VPC Network Tier offering " |         self.debug("Creating native VPC Network Tier offering " | ||||||
|                    "with Static NAT service provider as VPCVR") |                    "with Static NAT service provider as VPCVR") | ||||||
| @ -1922,8 +1922,8 @@ class TestNuageMigration(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "VpcVirtualRouter") |                    "VpcVirtualRouter") | ||||||
|         vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating native VPC Network Tier offering " |         self.debug("Creating native VPC Network Tier offering " | ||||||
|                    "with Static NAT service provider as VPCVR") |                    "with Static NAT service provider as VPCVR") | ||||||
|  | |||||||
| @ -120,7 +120,7 @@ class TestNuagePasswordReset(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|     # stop_vm - Stops the given VM, and verifies its state |     # stop_vm - Stops the given VM, and verifies its state | ||||||
|     def stop_vm(self, vm): |     def stop_vm(self, vm): | ||||||
|         self.debug("Stoping VM") |         self.debug("Stopping VM") | ||||||
|         vm.stop(self.api_client) |         vm.stop(self.api_client) | ||||||
|         list_vm_response = VirtualMachine.list(self.api_client, |         list_vm_response = VirtualMachine.list(self.api_client, | ||||||
|                                                id=vm.id |                                                id=vm.id | ||||||
| @ -139,8 +139,8 @@ class TestNuagePasswordReset(nuageTestCase): | |||||||
|     # (SSH client) |     # (SSH client) | ||||||
|     def install_cloud_set_guest_password_script(self, ssh_client): |     def install_cloud_set_guest_password_script(self, ssh_client): | ||||||
|         if self.isSimulator: |         if self.isSimulator: | ||||||
|             self.debug( "Simulator Environment: Skipping installing" |             self.debug("Simulator Environment: Skipping installing" | ||||||
|                         " cloud-set-guest-password script") |                        " cloud-set-guest-password script") | ||||||
|             return |             return | ||||||
|         self.debug("Installing cloud-set-guest-password script") |         self.debug("Installing cloud-set-guest-password script") | ||||||
|         cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/" \ |         cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/" \ | ||||||
| @ -268,8 +268,7 @@ class TestNuagePasswordReset(nuageTestCase): | |||||||
|             self.debug("Actual user data - " + actual_user_data + |             self.debug("Actual user data - " + actual_user_data + | ||||||
|                        ", Expected user data - " + expected_user_data) |                        ", Expected user data - " + expected_user_data) | ||||||
|             self.assertEqual(actual_user_data, expected_user_data, |             self.assertEqual(actual_user_data, expected_user_data, | ||||||
|                              "Un-expected VM (VM_1) user data" |                              "Un-expected VM (VM_1) user data") | ||||||
|                          ) |  | ||||||
| 
 | 
 | ||||||
|             self.debug("Checking for cloud-set-guest-password script in the " |             self.debug("Checking for cloud-set-guest-password script in the " | ||||||
|                        "VM for testing password reset functionality...") |                        "VM for testing password reset functionality...") | ||||||
| @ -330,12 +329,22 @@ class TestNuagePasswordReset(nuageTestCase): | |||||||
|                 vm_test_public_ip = public_ip_1 |                 vm_test_public_ip = public_ip_1 | ||||||
| 
 | 
 | ||||||
|             self.debug("Resetting password for VM - %s" % vm_test.name) |             self.debug("Resetting password for VM - %s" % vm_test.name) | ||||||
|  |             self.stop_vm(vm_test) | ||||||
|             vm_test.password = vm_test.resetPassword(self.api_client) |             vm_test.password = vm_test.resetPassword(self.api_client) | ||||||
|             self.debug("Password reset to - %s" % vm_test.password) |             self.debug("Password reset to - %s" % vm_test.password) | ||||||
| 
 | 
 | ||||||
|             self.debug("Starting the VM") |             self.debug("Starting the VM") | ||||||
|             vm_test.start(self.api_client) |             vm_test.start(self.api_client) | ||||||
| 
 | 
 | ||||||
|  |             self.debug("until CLOUDSTACK-10380 is fixed, redo resetPassword") | ||||||
|  |             self.stop_vm(vm_test) | ||||||
|  |             self.debug("Resetting password again for VM - %s" % vm_test.name) | ||||||
|  |             vm_test.password = vm_test.resetPassword(self.api_client) | ||||||
|  |             self.debug("VM - %s password - %s !" % | ||||||
|  |                        (vm_test.name, vm_test.password)) | ||||||
|  |             self.debug("Starting the VM again") | ||||||
|  |             vm_test.start(self.api_client) | ||||||
|  | 
 | ||||||
|             self.debug("verifying that the guest VM template is password " |             self.debug("verifying that the guest VM template is password " | ||||||
|                        "enabled...") |                        "enabled...") | ||||||
|             self.debug("VM - %s password - %s !" % |             self.debug("VM - %s password - %s !" % | ||||||
|  | |||||||
| @ -460,19 +460,19 @@ class TestNuageSourceNat(nuageTestCase): | |||||||
|         # Creating VPCs |         # Creating VPCs | ||||||
|         self.debug("Creating a VPC with Source NAT service provider as " |         self.debug("Creating a VPC with Source NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16') |         vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_1, state="Enabled") |         self.validate_vpc(vpc_1, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with Source NAT service provider as " |         self.debug("Creating a VPC with Source NAT service provider as " | ||||||
|                    "VpcVirtualRouter...") |                    "VpcVirtualRouter...") | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16') |             self.create_vpc(vpc_off_2, cidr='10.1.0.0/16') | ||||||
|         self.debug("Nuage VSP does not support provider VpcVirtualRouter for " |         self.debug("Nuage VSP does not support provider VpcVirtualRouter for " | ||||||
|                    "service Source NAT for VPCs") |                    "service Source NAT for VPCs") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC without Source NAT service...") |         self.debug("Creating a VPC without Source NAT service...") | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16') |             self.create_vpc(vpc_off_3, cidr='10.1.0.0/16') | ||||||
|         self.debug("Nuage VSP does not support VPCs without Source NAT " |         self.debug("Nuage VSP does not support VPCs without Source NAT " | ||||||
|                    "service") |                    "service") | ||||||
| 
 | 
 | ||||||
| @ -714,8 +714,8 @@ class TestNuageSourceNat(nuageTestCase): | |||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Source NAT service provider as " |         self.debug("Creating a VPC with Source NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offering |         # Creating network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Source NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Source NAT " | ||||||
| @ -887,8 +887,8 @@ class TestNuageSourceNat(nuageTestCase): | |||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Source NAT service provider as " |         self.debug("Creating a VPC with Source NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating VPC network offering |         # Creating VPC network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Source NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Source NAT " | ||||||
| @ -1321,8 +1321,8 @@ class TestNuageSourceNat(nuageTestCase): | |||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Source NAT service provider as " |         self.debug("Creating a VPC with Source NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating VPC network offering |         # Creating VPC network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Source NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Source NAT " | ||||||
|  | |||||||
| @ -849,19 +849,19 @@ class TestNuageStaticNat(nuageTestCase): | |||||||
|         # Creating VPCs |         # Creating VPCs | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16') |         vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_1, state="Enabled") |         self.validate_vpc(vpc_1, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "VpcVirtualRouter...") |                    "VpcVirtualRouter...") | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16') |             self.create_vpc(vpc_off_2, cidr='10.1.0.0/16') | ||||||
|         self.debug("Nuage VSP does not support provider VpcVirtualRouter for " |         self.debug("Nuage VSP does not support provider VpcVirtualRouter for " | ||||||
|                    "service Static NAT for VPCs") |                    "service Static NAT for VPCs") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC without Static NAT service...") |         self.debug("Creating a VPC without Static NAT service...") | ||||||
|         vpc_2 = self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16') |         vpc_2 = self.create_vpc(vpc_off_3, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_2, state="Enabled") |         self.validate_vpc(vpc_2, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " | ||||||
| @ -1194,8 +1194,8 @@ class TestNuageStaticNat(nuageTestCase): | |||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offering |         # Creating network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " | ||||||
| @ -1406,8 +1406,8 @@ class TestNuageStaticNat(nuageTestCase): | |||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offering |         # Creating network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " | ||||||
| @ -1696,7 +1696,8 @@ class TestNuageStaticNat(nuageTestCase): | |||||||
|         # from the deployed VM |         # from the deployed VM | ||||||
|         if not self.isSimulator: |         if not self.isSimulator: | ||||||
|             with self.assertRaises(Exception): |             with self.assertRaises(Exception): | ||||||
|                 self.verify_StaticNAT_Internet_traffic(vm, network_1, public_ip_1) |                 self.verify_StaticNAT_Internet_traffic(vm, network_1, | ||||||
|  |                                                        public_ip_1) | ||||||
|         self.debug("Static NAT rule not enabled in this VM NIC") |         self.debug("Static NAT rule not enabled in this VM NIC") | ||||||
|         self.verify_StaticNAT_Internet_traffic(vm, network_2, public_ip_2) |         self.verify_StaticNAT_Internet_traffic(vm, network_2, public_ip_2) | ||||||
| 
 | 
 | ||||||
| @ -1991,8 +1992,8 @@ class TestNuageStaticNat(nuageTestCase): | |||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "NuageVsp...") |                    "NuageVsp...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating VPC network offering |         # Creating VPC network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " |         self.debug("Creating Nuage VSP VPC Network offering with Static NAT " | ||||||
| @ -2088,6 +2089,7 @@ class TestNuageStaticNat(nuageTestCase): | |||||||
|         self.debug("Restarting the created VPC network with cleanup...") |         self.debug("Restarting the created VPC network with cleanup...") | ||||||
|         Network.restart(vpc_tier, self.api_client, cleanup=True) |         Network.restart(vpc_tier, self.api_client, cleanup=True) | ||||||
|         self.validate_Network(vpc_tier, state="Implemented") |         self.validate_Network(vpc_tier, state="Implemented") | ||||||
|  |         vpc_vr = self.get_Router(vpc_tier) | ||||||
|         self.check_Router_state(vpc_vr, state="Running") |         self.check_Router_state(vpc_vr, state="Running") | ||||||
|         self.check_VM_state(vpc_vm, state="Running") |         self.check_VM_state(vpc_vm, state="Running") | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -375,25 +375,25 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         # Creating VPCs |         # Creating VPCs | ||||||
|         self.debug("Creating a VPC with LB service provider as " |         self.debug("Creating a VPC with LB service provider as " | ||||||
|                    "InternalLbVm...") |                    "InternalLbVm...") | ||||||
|         vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16') |         vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_1, state="Enabled") |         self.validate_vpc(vpc_1, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with LB service provider as " |         self.debug("Creating a VPC with LB service provider as " | ||||||
|                    "VpcVirtualRouter...") |                    "VpcVirtualRouter...") | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16') |             self.create_vpc(vpc_off_2, cidr='10.1.0.0/16') | ||||||
|         self.debug("Nuage VSP does not support provider VpcVirtualRouter for " |         self.debug("Nuage VSP does not support provider VpcVirtualRouter for " | ||||||
|                    "service LB for VPCs") |                    "service LB for VPCs") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC with LB service provider as Netscaler...") |         self.debug("Creating a VPC with LB service provider as Netscaler...") | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16') |             self.create_vpc(vpc_off_3, cidr='10.1.0.0/16') | ||||||
|         self.debug("Nuage VSP does not support provider Netscaler for service " |         self.debug("Nuage VSP does not support provider Netscaler for service " | ||||||
|                    "LB for VPCs") |                    "LB for VPCs") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC without LB service...") |         self.debug("Creating a VPC without LB service...") | ||||||
|         vpc_2 = self.create_Vpc(vpc_off_4, cidr='10.1.0.0/16') |         vpc_2 = self.create_vpc(vpc_off_4, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_2, state="Enabled") |         self.validate_vpc(vpc_2, state="Enabled") | ||||||
| 
 | 
 | ||||||
|     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") |     @attr(tags=["advanced", "nuagevsp"], required_hardware="false") | ||||||
|     def test_02_nuage_internallb_vpc_network_offering(self): |     def test_02_nuage_internallb_vpc_network_offering(self): | ||||||
| @ -438,8 +438,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with LB Service " |         self.debug("Creating Nuage VSP VPC Network offering with LB Service " | ||||||
| @ -594,12 +594,12 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating VPCs |         # Creating VPCs | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16') |         vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_1, state="Enabled") |         self.validate_vpc(vpc_1, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         self.debug("Creating a VPC without Internal LB service...") |         self.debug("Creating a VPC without Internal LB service...") | ||||||
|         vpc_2 = self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16') |         vpc_2 = self.create_vpc(vpc_off_2, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc_2, state="Enabled") |         self.validate_vpc(vpc_2, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " |         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " | ||||||
| @ -794,8 +794,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " |         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " | ||||||
| @ -1148,8 +1148,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " |         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " | ||||||
| @ -1477,8 +1477,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " |         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " | ||||||
| @ -1742,8 +1742,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " |         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " | ||||||
| @ -1881,8 +1881,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vsd_firewall_rule(public_ssh_rule) |         self.verify_vsd_firewall_rule(public_ssh_rule) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # Restart Internal tier (cleanup = false) |         # Restart Internal tier (cleanup = false) | ||||||
|         # InternalLbVm gets destroyed and deployed again in the Internal tier |         # InternalLbVm gets destroyed and deployed again in the Internal tier | ||||||
| @ -1921,13 +1922,15 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
|         # Restart Internal tier (cleanup = true) |         # Restart Internal tier (cleanup = true) | ||||||
|         # InternalLbVm gets destroyed and deployed again in the Internal tier |         # InternalLbVm gets destroyed and deployed again in the Internal tier | ||||||
|         self.debug("Restarting the Internal tier with cleanup...") |         self.debug("Restarting the Internal tier with cleanup...") | ||||||
|         Network.restart(internal_tier, self.api_client, cleanup=True) |         Network.restart(internal_tier, self.api_client, cleanup=True) | ||||||
|         self.validate_Network(internal_tier, state="Implemented") |         self.validate_Network(internal_tier, state="Implemented") | ||||||
|  |         vr = self.get_Router(internal_tier) | ||||||
|         self.check_Router_state(vr, state="Running") |         self.check_Router_state(vr, state="Running") | ||||||
|         self.check_VM_state(internal_vm, state="Running") |         self.check_VM_state(internal_vm, state="Running") | ||||||
|         self.check_VM_state(internal_vm_1, state="Running") |         self.check_VM_state(internal_vm_1, state="Running") | ||||||
| @ -1960,8 +1963,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # Restart Public tier (cleanup = false) |         # Restart Public tier (cleanup = false) | ||||||
|         # This restart has no effect on the InternalLbVm functionality |         # This restart has no effect on the InternalLbVm functionality | ||||||
| @ -2011,6 +2015,7 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.debug("Restarting the Public tier with cleanup...") |         self.debug("Restarting the Public tier with cleanup...") | ||||||
|         Network.restart(public_tier, self.api_client, cleanup=True) |         Network.restart(public_tier, self.api_client, cleanup=True) | ||||||
|         self.validate_Network(public_tier, state="Implemented") |         self.validate_Network(public_tier, state="Implemented") | ||||||
|  |         vr = self.get_Router(public_tier) | ||||||
|         self.check_Router_state(vr, state="Running") |         self.check_Router_state(vr, state="Running") | ||||||
|         self.check_VM_state(public_vm, state="Running") |         self.check_VM_state(public_vm, state="Running") | ||||||
|         self.validate_PublicIPAddress( |         self.validate_PublicIPAddress( | ||||||
| @ -2040,8 +2045,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # Stopping VMs in the Internal tier |         # Stopping VMs in the Internal tier | ||||||
|         # wget traffic test fails as all the VMs in the Internal tier are in |         # wget traffic test fails as all the VMs in the Internal tier are in | ||||||
| @ -2072,8 +2078,10 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vsd_lb_device(int_lb_vm) |         self.verify_vsd_lb_device(int_lb_vm) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm, should_fail=True) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm, | ||||||
|  |                                              should_fail=True) | ||||||
| 
 | 
 | ||||||
|         # Starting VMs in the Internal tier |         # Starting VMs in the Internal tier | ||||||
|         # wget traffic test succeeds as all the VMs in the Internal tier are |         # wget traffic test succeeds as all the VMs in the Internal tier are | ||||||
| @ -2112,8 +2120,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # Restarting VPC (cleanup = false) |         # Restarting VPC (cleanup = false) | ||||||
|         # VPC VR gets destroyed and deployed again in the VPC |         # VPC VR gets destroyed and deployed again in the VPC | ||||||
| @ -2160,8 +2169,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # Restarting VPC (cleanup = true) |         # Restarting VPC (cleanup = true) | ||||||
|         # VPC VR gets destroyed and deployed again in the VPC |         # VPC VR gets destroyed and deployed again in the VPC | ||||||
| @ -2217,9 +2227,13 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_lb_wget_file( |         self.verify_lb_wget_file( | ||||||
|             wget_file, [internal_vm, internal_vm_1, internal_vm_2]) |             wget_file, [internal_vm, internal_vm_1, internal_vm_2]) | ||||||
| 
 | 
 | ||||||
|     def verify_internal_lb_wget_traffic(self, int_lb_rule_1, internal_vm, internal_vm_1, internal_vm_2, public_ip, public_vm, should_fail=False): |     def verify_internal_lb_wget_traffic(self, int_lb_rule_1, internal_vm, | ||||||
|  |                                         internal_vm_1, internal_vm_2, | ||||||
|  |                                         public_ip, public_vm, | ||||||
|  |                                         should_fail=False): | ||||||
|         if self.isSimulator: |         if self.isSimulator: | ||||||
|             self.debug("Simulator Environment: not running wget traffic tests.") |             self.debug("Simulator Environment: " | ||||||
|  |                        "not running wget traffic tests.") | ||||||
|             return |             return | ||||||
|         ssh_client = self.ssh_into_VM(public_vm, public_ip) |         ssh_client = self.ssh_into_VM(public_vm, public_ip) | ||||||
|         tries = 0 |         tries = 0 | ||||||
| @ -2240,8 +2254,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|             with self.assertRaises(Exception): |             with self.assertRaises(Exception): | ||||||
|                 self.verify_lb_wget_file( |                 self.verify_lb_wget_file( | ||||||
|                     wget_file, [internal_vm, internal_vm_1, internal_vm_2]) |                     wget_file, [internal_vm, internal_vm_1, internal_vm_2]) | ||||||
|             self.debug("Failed to wget file as all the VMs in the Internal tier " |             self.debug("Failed to wget file as all the VMs in the Internal " | ||||||
|                        "are in stopped state") |                        "tier are in stopped state") | ||||||
|         else: |         else: | ||||||
|             self.verify_lb_wget_file( |             self.verify_lb_wget_file( | ||||||
|                 wget_file, [internal_vm, internal_vm_1, internal_vm_2]) |                 wget_file, [internal_vm, internal_vm_1, internal_vm_2]) | ||||||
| @ -2278,8 +2292,8 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Internal LB service...") |         self.debug("Creating a VPC with Internal LB service...") | ||||||
|         vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating network offerings |         # Creating network offerings | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " |         self.debug("Creating Nuage VSP VPC Network offering with Internal LB " | ||||||
| @ -2429,8 +2443,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vsd_firewall_rule(public_ssh_rule) |         self.verify_vsd_firewall_rule(public_ssh_rule) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # # Stopping the InternalLbVm when the VPC VR is in Stopped state |         # # Stopping the InternalLbVm when the VPC VR is in Stopped state | ||||||
|         self.stop_InternalLbVm(int_lb_vm) |         self.stop_InternalLbVm(int_lb_vm) | ||||||
| @ -2449,8 +2464,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm, |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm, | ||||||
|                                              should_fail=True) |                                              should_fail=True) | ||||||
| 
 | 
 | ||||||
|         # # Starting the InternalLbVm when the VPC VR is in Stopped state |         # # Starting the InternalLbVm when the VPC VR is in Stopped state | ||||||
| @ -2471,8 +2487,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         # Bug CLOUDSTACK-9837 |         # Bug CLOUDSTACK-9837 | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
| 
 | 
 | ||||||
|         # Starting the VPC VR |         # Starting the VPC VR | ||||||
|         # VPC VR has no effect on the InternalLbVm functionality |         # VPC VR has no effect on the InternalLbVm functionality | ||||||
| @ -2503,48 +2520,9 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm, should_fail=True) |                                              internal_vm_1, internal_vm_2, | ||||||
| 
 |                                              public_ip, public_vm, | ||||||
|         # # Starting the InternalLbVm when the VPC VR is in Running state |  | ||||||
|         self.start_InternalLbVm(int_lb_vm) |  | ||||||
|         self.check_InternalLbVm_state( |  | ||||||
|             internal_tier, int_lb_rule_1.sourceipaddress, state="Running") |  | ||||||
| 
 |  | ||||||
|         # VSD Verification |  | ||||||
|         self.verify_vsd_lb_device(int_lb_vm) |  | ||||||
| 
 |  | ||||||
|         # Verifying Internal Load Balanced VMs ingress traffic |  | ||||||
|         # (SSH into VM via Static NAT rule) |  | ||||||
|         self.debug("Verifying Internal Load Balanced VMs ingress traffic " |  | ||||||
|                    "(SSH into VM via Static NAT rule)...") |  | ||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc) |  | ||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc) |  | ||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |  | ||||||
| 
 |  | ||||||
|         # Internal LB (wget) traffic test |  | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |  | ||||||
|                                              internal_vm_2, public_ip, public_vm) |  | ||||||
| 
 |  | ||||||
|         # # Force Stopping the InternalLbVm when the VPC VR is in Running state |  | ||||||
|         self.stop_InternalLbVm(int_lb_vm, force=True) |  | ||||||
|         self.check_InternalLbVm_state( |  | ||||||
|             internal_tier, int_lb_rule_1.sourceipaddress, state="Stopped") |  | ||||||
| 
 |  | ||||||
|         # VSD Verification |  | ||||||
|         self.verify_vsd_lb_device(int_lb_vm, stopped=True) |  | ||||||
| 
 |  | ||||||
|         # Verifying Internal Load Balanced VMs ingress traffic |  | ||||||
|         # (SSH into VM via Static NAT rule) |  | ||||||
|         self.debug("Verifying Internal Load Balanced VMs ingress traffic " |  | ||||||
|                    "(SSH into VM via Static NAT rule)...") |  | ||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc) |  | ||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc) |  | ||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |  | ||||||
| 
 |  | ||||||
|         # Internal LB (wget) traffic test |  | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |  | ||||||
|                                              internal_vm_2, public_ip, public_vm, |  | ||||||
|                                              should_fail=True) |                                              should_fail=True) | ||||||
| 
 | 
 | ||||||
|         # # Starting the InternalLbVm when the VPC VR is in Running state |         # # Starting the InternalLbVm when the VPC VR is in Running state | ||||||
| @ -2564,5 +2542,49 @@ class TestNuageInternalLb(nuageTestCase): | |||||||
|         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
| 
 | 
 | ||||||
|         # Internal LB (wget) traffic test |         # Internal LB (wget) traffic test | ||||||
|         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1, |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|                                              internal_vm_2, public_ip, public_vm) |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
|  | 
 | ||||||
|  |         # # Force Stopping the InternalLbVm when the VPC VR is in Running state | ||||||
|  |         self.stop_InternalLbVm(int_lb_vm, force=True) | ||||||
|  |         self.check_InternalLbVm_state( | ||||||
|  |             internal_tier, int_lb_rule_1.sourceipaddress, state="Stopped") | ||||||
|  | 
 | ||||||
|  |         # VSD Verification | ||||||
|  |         self.verify_vsd_lb_device(int_lb_vm, stopped=True) | ||||||
|  | 
 | ||||||
|  |         # Verifying Internal Load Balanced VMs ingress traffic | ||||||
|  |         # (SSH into VM via Static NAT rule) | ||||||
|  |         self.debug("Verifying Internal Load Balanced VMs ingress traffic " | ||||||
|  |                    "(SSH into VM via Static NAT rule)...") | ||||||
|  |         self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc) | ||||||
|  |         self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc) | ||||||
|  |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
|  | 
 | ||||||
|  |         # Internal LB (wget) traffic test | ||||||
|  |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|  |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm, | ||||||
|  |                                              should_fail=True) | ||||||
|  | 
 | ||||||
|  |         # # Starting the InternalLbVm when the VPC VR is in Running state | ||||||
|  |         self.start_InternalLbVm(int_lb_vm) | ||||||
|  |         self.check_InternalLbVm_state( | ||||||
|  |             internal_tier, int_lb_rule_1.sourceipaddress, state="Running") | ||||||
|  | 
 | ||||||
|  |         # VSD Verification | ||||||
|  |         self.verify_vsd_lb_device(int_lb_vm) | ||||||
|  | 
 | ||||||
|  |         # Verifying Internal Load Balanced VMs ingress traffic | ||||||
|  |         # (SSH into VM via Static NAT rule) | ||||||
|  |         self.debug("Verifying Internal Load Balanced VMs ingress traffic " | ||||||
|  |                    "(SSH into VM via Static NAT rule)...") | ||||||
|  |         self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc) | ||||||
|  |         self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc) | ||||||
|  |         self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc) | ||||||
|  | 
 | ||||||
|  |         # Internal LB (wget) traffic test | ||||||
|  |         self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, | ||||||
|  |                                              internal_vm_1, internal_vm_2, | ||||||
|  |                                              public_ip, public_vm) | ||||||
|  | |||||||
| @ -20,7 +20,7 @@ Nuage VSP SDN plugin | |||||||
| """ | """ | ||||||
| # Import Local Modules | # Import Local Modules | ||||||
| from nuageTestCase import nuageTestCase | from nuageTestCase import nuageTestCase | ||||||
| from marvin.lib.base import Account, VPC | from marvin.lib.base import Account | ||||||
| # Import System Modules | # Import System Modules | ||||||
| from nose.plugins.attrib import attr | from nose.plugins.attrib import attr | ||||||
| 
 | 
 | ||||||
| @ -75,8 +75,8 @@ class TestNuageVpcNetwork(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating a VPC |         # Creating a VPC | ||||||
|         self.debug("Creating a VPC with Nuage VSP VPC offering...") |         self.debug("Creating a VPC with Nuage VSP VPC offering...") | ||||||
|         vpc = self.create_Vpc(vpc_offering, cidr='10.1.0.0/16') |         vpc = self.create_vpc(vpc_offering, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
| 
 | 
 | ||||||
|         # Creating a network offering |         # Creating a network offering | ||||||
|         self.debug("Creating Nuage VSP VPC Network offering...") |         self.debug("Creating Nuage VSP VPC Network offering...") | ||||||
|  | |||||||
| @ -158,7 +158,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|             for i in range(0, 3): |             for i in range(0, 3): | ||||||
|                 cls.domain_template_list.append("domain_template_" + str(i)) |                 cls.domain_template_list.append("domain_template_" + str(i)) | ||||||
|             for account in [cls.account_root, cls.account_d1, cls.account_d11]: |             for account in [cls.account_root, cls.account_d1, cls.account_d11]: | ||||||
|                 vpc = cls.create_Vpc( |                 vpc = cls.create_vpc( | ||||||
|                     cls.vpc_offering, cidr='10.1.0.0/16', account=account) |                     cls.vpc_offering, cidr='10.1.0.0/16', account=account) | ||||||
|                 cls.create_Network( |                 cls.create_Network( | ||||||
|                     cls.network_offering, |                     cls.network_offering, | ||||||
| @ -350,7 +350,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|         # 7. Delete all the created objects (cleanup). |         # 7. Delete all the created objects (cleanup). | ||||||
| 
 | 
 | ||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         vpc_1 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc_1 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
| 
 | 
 | ||||||
|         # Associating pre-configured Nuage VSP Domain Template to VPC |         # Associating pre-configured Nuage VSP Domain Template to VPC | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
| @ -426,7 +426,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|             domain_template_name=self.domain_template_list[0]) |             domain_template_name=self.domain_template_list[0]) | ||||||
| 
 | 
 | ||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         vpc_2 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc_2 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
| 
 | 
 | ||||||
|         # Associating pre-configured Nuage VSP Domain Template to VPC |         # Associating pre-configured Nuage VSP Domain Template to VPC | ||||||
|         self.validate_NuageVspDomainTemplate(self.domain_template_list[0]) |         self.validate_NuageVspDomainTemplate(self.domain_template_list[0]) | ||||||
| @ -481,7 +481,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|             domain_template_name=self.domain_template_list[1]) |             domain_template_name=self.domain_template_list[1]) | ||||||
| 
 | 
 | ||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         vpc_3 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc_3 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
| 
 | 
 | ||||||
|         # Associating pre-configured Nuage VSP Domain Template to VPC |         # Associating pre-configured Nuage VSP Domain Template to VPC | ||||||
|         self.validate_NuageVspDomainTemplate(self.domain_template_list[0]) |         self.validate_NuageVspDomainTemplate(self.domain_template_list[0]) | ||||||
| @ -523,7 +523,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|             domain_template_name=self.domain_template_list[0]) |             domain_template_name=self.domain_template_list[0]) | ||||||
| 
 | 
 | ||||||
|         # Creating VPC and VPC network (tier) |         # Creating VPC and VPC network (tier) | ||||||
|         vpc = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
|         vpc_tier = self.create_Network(self.network_offering, vpc=vpc) |         vpc_tier = self.create_Network(self.network_offering, vpc=vpc) | ||||||
| 
 | 
 | ||||||
|         # VSD verification |         # VSD verification | ||||||
| @ -669,7 +669,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         with self.assertRaises(Exception): |         with self.assertRaises(Exception): | ||||||
|             self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |             self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
|         self.debug("VPC creation fails as there is no domain template with " |         self.debug("VPC creation fails as there is no domain template with " | ||||||
|                    "name invalid_domain_template in VSD as mentioned in " |                    "name invalid_domain_template in VSD as mentioned in " | ||||||
|                    "global setting nuagevsp.vpc.domaintemplate.name") |                    "global setting nuagevsp.vpc.domaintemplate.name") | ||||||
| @ -685,7 +685,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|         self.validate_NuageVspDomainTemplate(self.domain_template_list[0]) |         self.validate_NuageVspDomainTemplate(self.domain_template_list[0]) | ||||||
| 
 | 
 | ||||||
|         # Creating VPC and VPC networks (tiers) |         # Creating VPC and VPC networks (tiers) | ||||||
|         vpc_1 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc_1 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
|         vpc_1_tier_1 = self.create_Network( |         vpc_1_tier_1 = self.create_Network( | ||||||
|             self.network_offering, gateway='10.1.1.1', vpc=vpc_1) |             self.network_offering, gateway='10.1.1.1', vpc=vpc_1) | ||||||
|         vpc_1_tier_2 = self.create_Network( |         vpc_1_tier_2 = self.create_Network( | ||||||
| @ -700,7 +700,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|             domain_template_name=self.domain_template_list[0]) |             domain_template_name=self.domain_template_list[0]) | ||||||
| 
 | 
 | ||||||
|         # Creating VPC and VPC networks (tiers) |         # Creating VPC and VPC networks (tiers) | ||||||
|         vpc_2 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc_2 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
|         vpc_2_tier_1 = self.create_Network( |         vpc_2_tier_1 = self.create_Network( | ||||||
|             self.network_offering, gateway='10.1.1.1', vpc=vpc_2) |             self.network_offering, gateway='10.1.1.1', vpc=vpc_2) | ||||||
|         vpc_2_tier_2 = self.create_Network( |         vpc_2_tier_2 = self.create_Network( | ||||||
| @ -715,7 +715,7 @@ class TestNuageDomainTemplate(nuageTestCase): | |||||||
|             domain_template_name=self.domain_template_list[0]) |             domain_template_name=self.domain_template_list[0]) | ||||||
| 
 | 
 | ||||||
|         # Creating VPC |         # Creating VPC | ||||||
|         vpc_3 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16') |         vpc_3 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16') | ||||||
| 
 | 
 | ||||||
|         # Associating pre-configured Nuage VSP Domain Template to VPC |         # Associating pre-configured Nuage VSP Domain Template to VPC | ||||||
|         self.validate_NuageVspDomainTemplate(self.domain_template_list[1]) |         self.validate_NuageVspDomainTemplate(self.domain_template_list[1]) | ||||||
|  | |||||||
| @ -343,8 +343,8 @@ class TestNuageManagedSubnets(nuageTestCase): | |||||||
|         self.api_client.updateZone(cmd) |         self.api_client.updateZone(cmd) | ||||||
|         self.debug("Creating a VPC with Static NAT service provider as " |         self.debug("Creating a VPC with Static NAT service provider as " | ||||||
|                    "VpcVirtualRouter") |                    "VpcVirtualRouter") | ||||||
|         vpc = self.create_Vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16') |         vpc = self.create_vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16') | ||||||
|         self.validate_Vpc(vpc, state="Enabled") |         self.validate_vpc(vpc, state="Enabled") | ||||||
|         acl_list = self.create_NetworkAclList( |         acl_list = self.create_NetworkAclList( | ||||||
|             name="acl", description="acl", vpc=vpc) |             name="acl", description="acl", vpc=vpc) | ||||||
|         self.create_NetworkAclRule( |         self.create_NetworkAclRule( | ||||||
| @ -354,8 +354,8 @@ class TestNuageManagedSubnets(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|         self.debug("Creating another VPC with Static NAT service provider " |         self.debug("Creating another VPC with Static NAT service provider " | ||||||
|                    "as VpcVirtualRouter") |                    "as VpcVirtualRouter") | ||||||
|         vpc2 = self.create_Vpc(self.nuage_vpc_offering, cidr='10.2.0.0/16') |         vpc2 = self.create_vpc(self.nuage_vpc_offering, cidr='10.2.0.0/16') | ||||||
|         self.validate_Vpc(vpc2, state="Enabled") |         self.validate_vpc(vpc2, state="Enabled") | ||||||
|         acl_list2 = self.create_NetworkAclList( |         acl_list2 = self.create_NetworkAclList( | ||||||
|                 name="acl", description="acl", vpc=vpc2) |                 name="acl", description="acl", vpc=vpc2) | ||||||
|         self.create_NetworkAclRule( |         self.create_NetworkAclRule( | ||||||
| @ -447,8 +447,8 @@ class TestNuageManagedSubnets(nuageTestCase): | |||||||
| 
 | 
 | ||||||
|             self.debug("Creating another VPC with Static NAT service provider " |             self.debug("Creating another VPC with Static NAT service provider " | ||||||
|                        "as VpcVirtualRouter With same CIDR") |                        "as VpcVirtualRouter With same CIDR") | ||||||
|             vpc3 = self.create_Vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16') |             vpc3 = self.create_vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16') | ||||||
|             self.validate_Vpc(vpc3, state="Enabled") |             self.validate_vpc(vpc3, state="Enabled") | ||||||
|             acl_list3 = self.create_NetworkAclList( |             acl_list3 = self.create_NetworkAclList( | ||||||
|                     name="acl", description="acl", vpc=vpc3) |                     name="acl", description="acl", vpc=vpc3) | ||||||
|             self.create_NetworkAclRule( |             self.create_NetworkAclRule( | ||||||
|  | |||||||
| @ -350,10 +350,13 @@ class VirtualMachine: | |||||||
|             self.username = services["username"] |             self.username = services["username"] | ||||||
|         else: |         else: | ||||||
|             self.username = 'root' |             self.username = 'root' | ||||||
|         if "password" in services: | 
 | ||||||
|             self.password = services["password"] |         if "password" not in items: | ||||||
|         else: |             if "password" in services: | ||||||
|             self.password = 'password' |                 self.password = services["password"] | ||||||
|  |             else: | ||||||
|  |                 self.password = 'password' | ||||||
|  | 
 | ||||||
|         if "ssh_port" in services: |         if "ssh_port" in services: | ||||||
|             self.ssh_port = services["ssh_port"] |             self.ssh_port = services["ssh_port"] | ||||||
|         else: |         else: | ||||||
|  | |||||||
| @ -345,14 +345,16 @@ def get_template( | |||||||
|     return list_templatesout[0] |     return list_templatesout[0] | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def get_test_template(apiclient, zone_id=None, hypervisor=None): | def get_test_template(apiclient, zone_id=None, hypervisor=None, test_templates=None): | ||||||
|     """ |     """ | ||||||
|     @Name : get_test_template |     @Name : get_test_template | ||||||
|     @Desc : Retrieves the test template used to running tests. When the template |     @Desc : Retrieves the test template used to running tests. When the template | ||||||
|             is missing it will be download at most one in a zone for a hypervisor. |             is missing it will be download at most one in a zone for a hypervisor. | ||||||
|     @Input : returns a template |     @Input : returns a template | ||||||
|     """ |     """ | ||||||
|     test_templates = test_data["test_templates"] | 
 | ||||||
|  |     if test_templates is None: | ||||||
|  |         test_templates = test_data["test_templates"] | ||||||
| 
 | 
 | ||||||
|     if hypervisor is None: |     if hypervisor is None: | ||||||
|         return FAILED |         return FAILED | ||||||
|  | |||||||
| @ -54,10 +54,12 @@ setup(name="Marvin", | |||||||
|           "pyvmomi >= 5.5.0", |           "pyvmomi >= 5.5.0", | ||||||
|           "netaddr >= 0.7.14", |           "netaddr >= 0.7.14", | ||||||
|           "dnspython", |           "dnspython", | ||||||
|           "ipmisim >= 0.7" |           "ipmisim >= 0.7", | ||||||
|  |           "retries", | ||||||
|  |           "PyCrypt" | ||||||
|       ], |       ], | ||||||
|       extras_require={ |       extras_require={ | ||||||
|         "nuagevsp": ["vspk", "PyYAML", "futures", "netaddr", "retries", "jpype1"] |         "nuagevsp": ["vspk", "PyYAML", "futures", "netaddr", "jpype1"] | ||||||
|       }, |       }, | ||||||
|       py_modules=['marvin.marvinPlugin'], |       py_modules=['marvin.marvinPlugin'], | ||||||
|       zip_safe=False, |       zip_safe=False, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user