diff --git a/api/src/com/cloud/agent/api/to/LoadBalancerTO.java b/api/src/com/cloud/agent/api/to/LoadBalancerTO.java index 64c85c035a3..44f7ab3f04c 100644 --- a/api/src/com/cloud/agent/api/to/LoadBalancerTO.java +++ b/api/src/com/cloud/agent/api/to/LoadBalancerTO.java @@ -287,10 +287,11 @@ public class LoadBalancerTO implements Serializable { private final String cloudStackApiUrl; private final String autoScaleUserApiKey; private final String autoScaleUserSecretKey; + private final String vmName; private final String networkId; public AutoScaleVmProfileTO(String zoneId, String domainId, String cloudStackApiUrl, String autoScaleUserApiKey, String autoScaleUserSecretKey, String serviceOfferingId, - String templateId, String networkId, String otherDeployParams, String snmpCommunity, Integer snmpPort, Integer destroyVmGraceperiod) { + String templateId, String vmName, String networkId, String otherDeployParams, String snmpCommunity, Integer snmpPort, Integer destroyVmGraceperiod) { this.zoneId = zoneId; this.domainId = domainId; this.serviceOfferingId = serviceOfferingId; @@ -302,6 +303,7 @@ public class LoadBalancerTO implements Serializable { this.cloudStackApiUrl = cloudStackApiUrl; this.autoScaleUserApiKey = autoScaleUserApiKey; this.autoScaleUserSecretKey = autoScaleUserSecretKey; + this.vmName = vmName; this.networkId = networkId; } @@ -349,12 +351,17 @@ public class LoadBalancerTO implements Serializable { return autoScaleUserSecretKey; } + public String getVmName() { + return vmName; + } + public String getNetworkId() { return networkId; } } public static class AutoScaleVmGroupTO implements Serializable { + private final String uuid; private final int minMembers; private final int maxMembers; private final int memberPort; @@ -364,8 +371,9 @@ public class LoadBalancerTO implements Serializable { private final String state; private final String currentState; - AutoScaleVmGroupTO(int minMembers, int maxMembers, int memberPort, int interval, List policies, AutoScaleVmProfileTO profile, String state, String currentState) + AutoScaleVmGroupTO(String uuid, int minMembers, int maxMembers, int memberPort, int interval, List policies, AutoScaleVmProfileTO profile, String state, String currentState) { + this.uuid = uuid; this.minMembers = minMembers; this.maxMembers = maxMembers; this.memberPort = memberPort; @@ -376,6 +384,10 @@ public class LoadBalancerTO implements Serializable { this.currentState = currentState; } + public String getUuid() { + return uuid; + } + public int getMinMembers() { return minMembers; } @@ -433,12 +445,12 @@ public class LoadBalancerTO implements Serializable { AutoScaleVmProfileTO autoScaleVmProfileTO = new AutoScaleVmProfileTO(lbAutoScaleVmProfile.getZoneId(), lbAutoScaleVmProfile.getDomainId(), lbAutoScaleVmProfile.getCsUrl(), lbAutoScaleVmProfile.getAutoScaleUserApiKey(), lbAutoScaleVmProfile.getAutoScaleUserSecretKey(), - lbAutoScaleVmProfile.getServiceOfferingId(), lbAutoScaleVmProfile.getTemplateId(), lbAutoScaleVmProfile.getNetworkId(), - autoScaleVmProfile.getOtherDeployParams(), autoScaleVmProfile.getSnmpCommunity(), autoScaleVmProfile.getSnmpPort(), - autoScaleVmProfile.getDestroyVmGraceperiod()); + lbAutoScaleVmProfile.getServiceOfferingId(), lbAutoScaleVmProfile.getTemplateId(), lbAutoScaleVmProfile.getVmName(), + lbAutoScaleVmProfile.getNetworkId(),autoScaleVmProfile.getOtherDeployParams(), autoScaleVmProfile.getSnmpCommunity(), + autoScaleVmProfile.getSnmpPort(), autoScaleVmProfile.getDestroyVmGraceperiod()); AutoScaleVmGroup autoScaleVmGroup = lbAutoScaleVmGroup.getVmGroup(); - autoScaleVmGroupTO = new AutoScaleVmGroupTO(autoScaleVmGroup.getMinMembers(), autoScaleVmGroup.getMaxMembers(), autoScaleVmGroup.getMemberPort(), + autoScaleVmGroupTO = new AutoScaleVmGroupTO(autoScaleVmGroup.getUuid(), autoScaleVmGroup.getMinMembers(), autoScaleVmGroup.getMaxMembers(), autoScaleVmGroup.getMemberPort(), autoScaleVmGroup.getInterval(), autoScalePolicyTOs, autoScaleVmProfileTO, autoScaleVmGroup.getState(), lbAutoScaleVmGroup.getCurrentState()); } diff --git a/api/src/com/cloud/api/commands/UpdateZoneCmd.java b/api/src/com/cloud/api/commands/UpdateZoneCmd.java index 0f4b6936ed2..2d57467657b 100755 --- a/api/src/com/cloud/api/commands/UpdateZoneCmd.java +++ b/api/src/com/cloud/api/commands/UpdateZoneCmd.java @@ -139,9 +139,6 @@ public class UpdateZoneCmd extends BaseCmd { } public Boolean getLocalStorageEnabled() { - if (localStorageEnabled == null) { - return false; - } return localStorageEnabled; } diff --git a/api/src/com/cloud/api/response/ConditionResponse.java b/api/src/com/cloud/api/response/ConditionResponse.java index d2922d6c648..636c9275e62 100644 --- a/api/src/com/cloud/api/response/ConditionResponse.java +++ b/api/src/com/cloud/api/response/ConditionResponse.java @@ -17,6 +17,8 @@ package com.cloud.api.response; +import java.util.List; + import com.cloud.api.ApiConstants; import com.cloud.serializer.Param; import com.cloud.utils.IdentityProxy; @@ -38,7 +40,7 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR @SerializedName("counter") @Param(description = "Details of the Counter.") - private CounterResponse counter; + private List counterResponse; @SerializedName(ApiConstants.DOMAIN_ID) @Param(description = "the domain id of the Condition owner") @@ -80,8 +82,8 @@ public class ConditionResponse extends BaseResponse implements ControlledEntityR this.relationalOperator = relationalOperator; } - public void setCounter(CounterResponse counter) { - this.counter = counter; + public void setCounterResponse(List counterResponse) { + this.counterResponse = counterResponse; } @Override diff --git a/api/src/com/cloud/network/lb/LoadBalancingRule.java b/api/src/com/cloud/network/lb/LoadBalancingRule.java index 9d9caec097b..35affc9735d 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRule.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRule.java @@ -308,8 +308,9 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer { private final String serviceOfferingId; private final String templateId; private final String networkId; + private final String vmName; - public LbAutoScaleVmProfile(AutoScaleVmProfile profile, String autoScaleUserApiKey, String autoScaleUserSecretKey, String csUrl, String zoneId, String domainId, String serviceOfferingId, String templateId, String networkId) { + public LbAutoScaleVmProfile(AutoScaleVmProfile profile, String autoScaleUserApiKey, String autoScaleUserSecretKey, String csUrl, String zoneId, String domainId, String serviceOfferingId, String templateId, String vmName, String networkId) { this.profile = profile; this.autoScaleUserApiKey = autoScaleUserApiKey; this.autoScaleUserSecretKey = autoScaleUserSecretKey; @@ -318,6 +319,7 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer { this.domainId = domainId; this.serviceOfferingId = serviceOfferingId; this.templateId = templateId; + this.vmName = vmName; this.networkId = networkId; } @@ -353,6 +355,10 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer { return templateId; } + public String getVmName() { + return vmName; + } + public String getNetworkId() { return networkId; } diff --git a/core/src/com/cloud/network/resource/NetscalerResource.java b/core/src/com/cloud/network/resource/NetscalerResource.java index ee8555475c5..c295c51a947 100644 --- a/core/src/com/cloud/network/resource/NetscalerResource.java +++ b/core/src/com/cloud/network/resource/NetscalerResource.java @@ -1528,7 +1528,7 @@ public class NetscalerResource implements ServerResource { } addLBVirtualServer(nsVirtualServerName, srcIp, srcPort, lbAlgorithm, lbProtocol, loadBalancerTO.getStickinessPolicies(), vmGroupTO); - String serviceGroupName = generateAutoScaleServiceGroupName(vmGroupIdentifier); + String serviceGroupName = generateAutoScaleServiceGroupName(loadBalancerTO); servicegroup serviceGroup = getServiceGroupIfExisits(serviceGroupName); if(serviceGroup == null) { // add servicegroup lb_autoscaleGroup -autoscale POLICY -memberPort 80 @@ -1571,7 +1571,7 @@ public class NetscalerResource implements ServerResource { String vmGroupIdentifier = generateAutoScaleVmGroupIdentifier(loadBalancerTO); String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort); - String serviceGroupName = generateAutoScaleServiceGroupName(vmGroupIdentifier); + String serviceGroupName = generateAutoScaleServiceGroupName(loadBalancerTO); if(loadBalancerTO.getAutoScaleVmGroupTO().getCurrentState().equals("enabled")) { disableAutoScaleConfig(loadBalancerTO, false); @@ -1613,7 +1613,7 @@ public class NetscalerResource implements ServerResource { int srcPort = loadBalancerTO.getSrcPort(); String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort); - String serviceGroupName = generateAutoScaleServiceGroupName(vmGroupIdentifier); + String serviceGroupName = generateAutoScaleServiceGroupName(loadBalancerTO); String profileName = generateAutoScaleProfileName(vmGroupIdentifier); String timerName = generateAutoScaleTimerName(vmGroupIdentifier); String scaleDownActionName = generateAutoScaleScaleDownActionName(vmGroupIdentifier); @@ -1717,6 +1717,7 @@ public class NetscalerResource implements ServerResource { ApiConstants.ZONE_ID + "=" + profileTO.getZoneId()+ "&" + ApiConstants.SERVICE_OFFERING_ID + "=" + profileTO.getServiceOfferingId()+ "&" + ApiConstants.TEMPLATE_ID + "=" + profileTO.getTemplateId()+ "&" + + ApiConstants.DISPLAY_NAME + "=" + profileTO.getVmName()+ "&" + ((profileTO.getNetworkId() == null)? "" : (ApiConstants.NETWORK_IDS + "=" + profileTO.getNetworkId()+ "&")) + ((profileTO.getOtherDeployParams() == null)? "" : (profileTO.getOtherDeployParams() + "&")) + "lbruleid=" + loadBalancerTO.getUuid(); @@ -1922,7 +1923,7 @@ public class NetscalerResource implements ServerResource { String scaleUpActionName = generateAutoScaleScaleUpActionName(vmGroupIdentifier); String mtName = generateSnmpMetricTableName(vmGroupIdentifier); String monitorName = generateSnmpMonitorName(vmGroupIdentifier); - String serviceGroupName = generateAutoScaleServiceGroupName(vmGroupIdentifier); + String serviceGroupName = generateAutoScaleServiceGroupName(loadBalancerTO); AutoScaleVmGroupTO vmGroupTO = loadBalancerTO.getAutoScaleVmGroupTO(); List policies = vmGroupTO.getPolicies(); String minMemberPolicyName = generateAutoScaleMinPolicyName(vmGroupIdentifier); @@ -2230,8 +2231,15 @@ public class NetscalerResource implements ServerResource { return lbTO.getSrcIp() + "-" + lbTO.getSrcPort(); } - private String generateAutoScaleServiceGroupName(String vmGroupIdentifier) { - return genObjectName("Cloud-AutoScale-SvcGrp", vmGroupIdentifier); + private String generateAutoScaleServiceGroupName(LoadBalancerTO lbTO) { + /* + * ServiceGroup name in NetScaler wont support long names. Providing special name. + * Need for introducing uuid because every vmgroup creation should be distinguished. + * Ex. (1) create a vm group, delete a vmgroup, create a vmgroup on same lb ip and port + * This will reuse all vms from the original vm group in step (1) + */ + + return "Cloud" + lbTO.getAutoScaleVmGroupTO().getUuid().replace("-", ""); } private String generateAutoScaleTimerName(String vmGroupIdentifier) { diff --git a/deps/cloud-netscaler.jar b/deps/cloud-netscaler.jar index 0cf1820f86e..8134cba102f 100755 Binary files a/deps/cloud-netscaler.jar and b/deps/cloud-netscaler.jar differ diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 11b8c859686..a6a3ccc6e52 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -4020,13 +4020,13 @@ public class ApiResponseHelper implements ResponseGenerator { public ConditionResponse createConditionResponse(Condition condition) { ConditionResponse response = new ConditionResponse(); response.setId(condition.getId()); - CounterResponse counter; - counter = createCounterResponse(ApiDBUtils.getCounter(condition.getCounterid())); - response.setCounter(counter); + List counterResponseList = new ArrayList(); + counterResponseList.add(createCounterResponse(ApiDBUtils.getCounter(condition.getCounterid()))); + response.setCounterResponse(counterResponseList); response.setRelationalOperator(condition.getRelationalOperator().toString()); response.setThreshold(condition.getThreshold()); response.setObjectName("condition"); populateOwner(response, condition); return response; } -} +} diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index ba5ee55a8e4..e4c7362c37e 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -173,6 +173,7 @@ public enum Config { XapiWait("Advanced", AgentManager.class, Integer.class, "xapiwait", "600", "Time (in seconds) to wait for XAPI to return", null), MigrateWait("Advanced", AgentManager.class, Integer.class, "migratewait", "3600", "Time (in seconds) to wait for VM migrate finish", null), Workers("Advanced", AgentManager.class, Integer.class, "workers", "5", "Number of worker threads.", null), + HAWorkers("Advanced", AgentManager.class, Integer.class, "ha.workers", "5", "Number of ha worker threads.", null), MountParent("Advanced", ManagementServer.class, String.class, "mount.parent", "/var/lib/cloud/management/mnt", "The mount point on the Management Server for Secondary Storage.", null), // UpgradeURL("Advanced", ManagementServer.class, String.class, "upgrade.url", "http://example.com:8080/client/agent/update.zip", "The upgrade URL is the URL of the management server that agents will connect to in order to automatically upgrade.", null), SystemVMUseLocalStorage("Advanced", ManagementServer.class, Boolean.class, "system.vm.use.local.storage", "false", "Indicates whether to use local storage pools or shared storage pools for system VMs.", null), diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index 17008d331bd..132cc0e21d3 100755 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -33,6 +33,7 @@ import com.cloud.alert.AlertManager; import com.cloud.cluster.ClusterManagerListener; import com.cloud.cluster.ManagementServerHostVO; import com.cloud.cluster.StackMaid; +import com.cloud.configuration.Config; import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.ClusterDetailsDao; import com.cloud.dc.DataCenterVO; @@ -699,7 +700,7 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu params = configDao.getConfiguration(Long.toHexString(_serverId), xmlParams); } - String value = params.get("workers"); + String value = params.get(Config.HAWorkers.key()); final int count = NumbersUtil.parseInt(value, 1); _workers = new WorkerThread[count]; for (int i = 0; i < _workers.length; i++) { diff --git a/server/src/com/cloud/maint/Version.java b/server/src/com/cloud/maint/Version.java index f7ff7835b8d..80b0f3f9a9f 100644 --- a/server/src/com/cloud/maint/Version.java +++ b/server/src/com/cloud/maint/Version.java @@ -46,6 +46,11 @@ public class Version { String[] tokens = version.split("[.]"); return tokens[0] + "." + tokens[1]+ "." + tokens[2]; } + + public static String trimToPatchNormalized(String version) { + String[] tokens = version.split("[.]"); + return tokens[0] + tokens[1] + tokens[2]; + } public static void main(String[] args) { System.out.println("Result is " + compare(args[0], args[1])); diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index a1784bc6e82..ffe3eee17f8 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -877,6 +877,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag if (!offering.isConserveMode()) { for (PublicIp ip : ipToServices.keySet()) { Set services = ipToServices.get(ip); + if (services != null && services.contains(Service.Firewall)) { + services.remove(Service.Firewall); + } if (services != null && services.size() > 1) { throw new CloudRuntimeException("Ip " + ip.getAddress() + " is used by multiple services!"); } @@ -1918,6 +1921,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag ex.addProxyObject("networks", networkId, "networkId"); throw ex; } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Lock is acquired for network id " + networkId + " as a part of network implement"); + } try { NetworkGuru guru = _networkGurus.get(network.getGuruName()); @@ -1963,10 +1970,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag shutdownNetwork(networkId, context, false); } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Releasing lock for network id " + networkId); - } + _networksDao.releaseFromLockTable(networkId); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Lock is released for network id " + networkId + " as a part of network implement"); + } } } diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index 460e8a4e159..980b06de653 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -843,7 +843,7 @@ public class AutoScaleManagerImpl implements AutoScaleService, Manager { if(vmGroup.getCreated() != null) ApiDBUtils.getAutoScaleVmGroupPolicyIds(vmGroup.getId(), bakupScaleUpPolicyIds, bakupScaleDownPolicyIds); - if (minMembers < 0) { + if (minMembers < 1) { throw new InvalidParameterValueException(ApiConstants.MIN_MEMBERS + " is an invalid value: " + minMembers, null); } diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index e2fce3d2d81..c75548da715 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -250,7 +250,9 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesMa return null; } - private LbAutoScaleVmGroup getLbAutoScaleVmGroup(AutoScaleVmGroupVO vmGroup, String currentState, long networkId) { + private LbAutoScaleVmGroup getLbAutoScaleVmGroup(AutoScaleVmGroupVO vmGroup, String currentState, LoadBalancerVO lb) { + long lbNetworkId = lb.getNetworkId(); + String lbName = lb.getName(); List vmGroupPolicyMapList = _autoScaleVmGroupPolicyMapDao.listByVmGroupId(vmGroup.getId()); List autoScalePolicies = new ArrayList(); for (AutoScaleVmGroupPolicyMapVO vmGroupPolicyMap : vmGroupPolicyMapList) { @@ -274,6 +276,7 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesMa String domainId = _domainDao.findById(autoScaleVmProfile.getDomainId()).getUuid(); String serviceOfferingId = _offeringsDao.findById(autoScaleVmProfile.getServiceOfferingId()).getUuid(); String templateId = _templateDao.findById(autoScaleVmProfile.getTemplateId()).getUuid(); + String vmName = "AutoScale-LB-" + lbName; String lbNetworkUuid = null; DataCenter zone = _configMgr.getZone(vmGroup.getZoneId()); @@ -281,8 +284,13 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesMa throw new InvalidParameterValueException("Unable to find zone by id", null); } else { if (zone.getNetworkType() == NetworkType.Advanced) { - NetworkVO lbNetwork = _networkDao.findById(networkId); + NetworkVO lbNetwork = _networkDao.findById(lbNetworkId); lbNetworkUuid = lbNetwork.getUuid(); + if (vmGroup.getState().equals(AutoScaleVmGroup.State_New)) { + if(!lbNetwork.getState().equals(Network.State.Implemented)) { + throw new InvalidParameterValueException("Network is not in implemented state", null); + } + } } } @@ -300,12 +308,12 @@ public class LoadBalancingRulesManagerImpl implements LoadBalancingRulesMa } - LbAutoScaleVmProfile lbAutoScaleVmProfile = new LbAutoScaleVmProfile(autoScaleVmProfile, apiKey, secretKey, csUrl, zoneId, domainId, serviceOfferingId, templateId, lbNetworkUuid); + LbAutoScaleVmProfile lbAutoScaleVmProfile = new LbAutoScaleVmProfile(autoScaleVmProfile, apiKey, secretKey, csUrl, zoneId, domainId, serviceOfferingId, templateId, vmName, lbNetworkUuid); return new LbAutoScaleVmGroup(vmGroup, autoScalePolicies, lbAutoScaleVmProfile, currentState); } private boolean applyAutoScaleConfig(LoadBalancerVO lb, AutoScaleVmGroupVO vmGroup, String currentState) throws ResourceUnavailableException { - LbAutoScaleVmGroup lbAutoScaleVmGroup = getLbAutoScaleVmGroup(vmGroup, currentState, lb.getNetworkId()); + LbAutoScaleVmGroup lbAutoScaleVmGroup = getLbAutoScaleVmGroup(vmGroup, currentState, lb); /* Regular config like destinations need not be packed for applying autoscale config as of today.*/ LoadBalancingRule rule = new LoadBalancingRule(lb, null, null); rule.setAutoScaleVmGroup(lbAutoScaleVmGroup); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 47421425383..4182c29c19e 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1386,6 +1386,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian if (network == null) { throw new ConcurrentOperationException("Unable to lock network " + guestNetwork.getId()); } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Lock is acquired for network id " + network.getId() + " as a part of router startup in " + dest); + } try { // Check if providers are supported in the physical networks @@ -1439,6 +1443,9 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian } finally { if (network != null) { _networkDao.releaseFromLockTable(network.getId()); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Lock is released for network id " + network.getId() + " as a part of router startup in " + dest); + } } } return routers; diff --git a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java index 36450789368..f0943f8140b 100755 --- a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java @@ -27,6 +27,7 @@ import java.util.UUID; import org.apache.log4j.Logger; +import com.cloud.maint.Version; import com.cloud.offering.NetworkOffering; import com.cloud.utils.crypt.DBEncryptionUtil; import com.cloud.utils.crypt.EncryptionSecretKeyChecker; @@ -666,7 +667,32 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade { s_logger.debug("Updating VMware System Vms"); try { //Get 3.0.0 VMware system Vm template Id - pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = 'systemvm-vmware-3.0.0' and removed is null"); + // First get the current version of the Mgmt server from the db. + String curDbVersion = ""; + String trimmedCurrentVersion = ""; + pstmt = conn.prepareStatement("select version from `cloud`.`version`"); + try { + rs = pstmt.executeQuery(); + if(rs.next()) { + curDbVersion = rs.getString(1); + rs.close(); + pstmt.close(); + } else + throw new CloudRuntimeException("Couldn't retrieve current version from db"); + } catch (SQLException e) { + throw new CloudRuntimeException("Encountered sql exception : Couldn't retrieve current version from db"); + } + if (curDbVersion != null) { + trimmedCurrentVersion = Version.trimToPatchNormalized(curDbVersion); + } + // If the current version is >= 3.0.5, use the new burbank template. + if (Long.valueOf(trimmedCurrentVersion).longValue() >= 305 ) { + s_logger.info("Using 3.0.5 vmware system vm template"); + pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = 'systemvm-vmware-3.0.5' and removed is null"); + } else { + s_logger.info("Using 3.0.0 vmware system vm template"); + pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = 'systemvm-vmware-3.0.0' and removed is null"); + } rs = pstmt.executeQuery(); if(rs.next()){ long templateId = rs.getLong(1); diff --git a/server/src/com/cloud/upgrade/dao/Upgrade304to305.java b/server/src/com/cloud/upgrade/dao/Upgrade304to305.java index bba46ed7fbd..3cb02ac33a9 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade304to305.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade304to305.java @@ -60,6 +60,7 @@ public class Upgrade304to305 extends Upgrade30xBase implements DbUpgrade { addVpcProvider(conn); updateRouterNetworkRef(conn); correctNetworkUsingExternalDevices(conn); + updateSystemVms(conn); } @Override @@ -71,7 +72,55 @@ public class Upgrade304to305 extends Upgrade30xBase implements DbUpgrade { return new File[] { new File(script) }; } - + + private void updateSystemVms(Connection conn){ + PreparedStatement pstmt = null; + ResultSet rs = null; + boolean VMware = false; + try { + pstmt = conn.prepareStatement("select distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); + rs = pstmt.executeQuery(); + while(rs.next()){ + if("VMware".equals(rs.getString(1))){ + VMware = true; + } + } + } catch (SQLException e) { + throw new CloudRuntimeException("Error while iterating through list of hypervisors in use", e); + } + // Just update the VMware system template. Other hypervisor templates are unchanged from previous 3.0.x versions. + s_logger.debug("Updating VMware System Vms"); + try { + //Get 3.0.5 VMware system Vm template Id + pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = 'systemvm-vmware-3.0.5' and removed is null"); + rs = pstmt.executeQuery(); + if(rs.next()){ + long templateId = rs.getLong(1); + rs.close(); + pstmt.close(); + // change template type to SYSTEM + pstmt = conn.prepareStatement("update `cloud`.`vm_template` set type='SYSTEM' where id = ?"); + pstmt.setLong(1, templateId); + pstmt.executeUpdate(); + pstmt.close(); + // update templete ID of system Vms + pstmt = conn.prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = 'VMware'"); + pstmt.setLong(1, templateId); + pstmt.executeUpdate(); + pstmt.close(); + } else { + if (VMware){ + throw new CloudRuntimeException("3.0.5 VMware SystemVm template not found. Cannot upgrade system Vms"); + } else { + s_logger.warn("3.0.5 VMware SystemVm template not found. VMware hypervisor is not used, so not failing upgrade"); + } + } + } catch (SQLException e) { + throw new CloudRuntimeException("Error while updating VMware systemVm template", e); + } + s_logger.debug("Updating System Vm Template IDs Complete"); + } + private void addVpcProvider(Connection conn){ //Encrypt config params and change category to Hidden s_logger.debug("Adding vpc provider to all physical networks in the system"); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 72e605610fb..2ca94e22402 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -3507,8 +3507,13 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.volume); _usageEventDao.persist(new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize())); + //snapshots: mark these removed in db + List snapshots = _snapshotDao.listByVolumeIdIncludingRemoved(volume.getId()); + for (SnapshotVO snapshot: snapshots){ + _snapshotDao.remove(snapshot.getId()); + } } - + _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.user_vm); //generate usage events to account for this change _usageEventDao.persist(new UsageEventVO(EventTypes.EVENT_VM_CREATE, vm.getAccountId(), vm.getDataCenterIdToDeployIn(), vm.getId(), diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 1321a232b84..96e87af11b9 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -2348,7 +2348,9 @@ CREATE TABLE `cloud`.`counter` ( `removed` datetime COMMENT 'date removed if not null', `created` datetime NOT NULL COMMENT 'date created', PRIMARY KEY (`id`), - CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`), + INDEX `i_counter__removed`(`removed`), + INDEX `i_counter__source`(`source`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`conditions` ( @@ -2365,7 +2367,8 @@ CREATE TABLE `cloud`.`conditions` ( CONSTRAINT `fk_conditions__counter_id` FOREIGN KEY `fk_condition__counter_id`(`counter_id`) REFERENCES `counter`(`id`), CONSTRAINT `fk_conditions__account_id` FOREIGN KEY `fk_condition__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_conditions__domain_id` FOREIGN KEY `fk_condition__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, - CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`), + INDEX `i_conditions__removed`(`removed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_vmprofiles` ( @@ -2387,7 +2390,8 @@ CREATE TABLE `cloud`.`autoscale_vmprofiles` ( CONSTRAINT `fk_autoscale_vmprofiles__domain_id` FOREIGN KEY `fk_autoscale_vmprofiles__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmprofiles__account_id` FOREIGN KEY `fk_autoscale_vmprofiles__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmprofiles__autoscale_user_id` FOREIGN KEY `fk_autoscale_vmprofiles__autoscale_user_id` (`autoscale_user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE, - CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`), + INDEX `i_autoscale_vmprofiles__removed`(`removed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_policies` ( @@ -2403,7 +2407,8 @@ CREATE TABLE `cloud`.`autoscale_policies` ( PRIMARY KEY (`id`), CONSTRAINT `fk_autoscale_policies__domain_id` FOREIGN KEY `fk_autoscale_policies__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_policies__account_id` FOREIGN KEY `fk_autoscale_policies__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, - CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`), + INDEX `i_autoscale_policies__removed`(`removed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_vmgroups` ( @@ -2427,7 +2432,9 @@ CREATE TABLE `cloud`.`autoscale_vmgroups` ( CONSTRAINT `fk_autoscale_vmgroups__domain_id` FOREIGN KEY `fk_autoscale_vmgroups__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmgroups__account_id` FOREIGN KEY `fk_autoscale_vmgroups__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmgroups__zone_id` FOREIGN KEY `fk_autoscale_vmgroups__zone_id`(`zone_id`) REFERENCES `data_center`(`id`), - CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`), + INDEX `i_autoscale_vmgroups__removed`(`removed`), + INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_policy_condition_map` ( @@ -2436,7 +2443,8 @@ CREATE TABLE `cloud`.`autoscale_policy_condition_map` ( `condition_id` bigint unsigned NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_autoscale_policy_condition_map__policy_id` FOREIGN KEY `fk_autoscale_policy_condition_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id` (`condition_id`) REFERENCES `conditions` (`id`) + CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id` (`condition_id`) REFERENCES `conditions` (`id`), + INDEX `i_autoscale_policy_condition_map__policy_id`(`policy_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` ( @@ -2445,7 +2453,8 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` ( `policy_id` bigint unsigned NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_autoscale_vmgroup_policy_map__vmgroup_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__vmgroup_id` (`vmgroup_id`) REFERENCES `autoscale_vmgroups` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) + CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`), + INDEX `i_autoscale_vmgroup_policy_map__vmgroup_id`(`vmgroup_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU - Percentage', '1.3.6.1.4.1.2021.11.9.0', now()); diff --git a/setup/db/db/schema-2214to30.sql b/setup/db/db/schema-2214to30.sql index 6584db217c1..809b1984071 100755 --- a/setup/db/db/schema-2214to30.sql +++ b/setup/db/db/schema-2214to30.sql @@ -721,6 +721,20 @@ UPDATE `cloud`.`network_offerings` SET display_text='Offering for Shared Securit UPDATE `cloud`.`configuration` SET category = 'Secure' where name in ('alert.smtp.password', 'network.loadbalancer.haproxy.stats.auth', 'security.singlesignon.key', 'project.smtp.password'); UPDATE `cloud`.`configuration` SET category = 'Hidden' where name in ('secondary.storage.vm', 'xen.create.pools.in.pod', 'cloud.identifier', 'security.hash.key', 'router.ram.size'); + +UPDATE `cloud`.`guest_os` set id = 158 where id = 141; +UPDATE `cloud`.`guest_os` set id = 159 where id = 142; +UPDATE `cloud`.`guest_os` set id = 160 where id = 143; +UPDATE `cloud`.`vm_template` set guest_os_id = 158 where guest_os_id = 141; +UPDATE `cloud`.`vm_template` set guest_os_id = 159 where guest_os_id = 142; +UPDATE `cloud`.`vm_template` set guest_os_id = 160 where guest_os_id = 143; +UPDATE `cloud`.`vm_instance` set guest_os_id = 158 where guest_os_id = 141; +UPDATE `cloud`.`vm_instance` set guest_os_id = 159 where guest_os_id = 142; +UPDATE `cloud`.`vm_instance` set guest_os_id = 160 where guest_os_id = 143; +UPDATE `cloud`.`guest_os_hypervisor` set guest_os_id = 158 where guest_os_id = 141; +UPDATE `cloud`.`guest_os_hypervisor` set guest_os_id = 159 where guest_os_id = 142; +UPDATE `cloud`.`guest_os_hypervisor` set guest_os_id = 160 where guest_os_id = 143; + INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (143, 1, 'CentOS 6.0 (32-bit)'); INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (144, 1, 'CentOS 6.0 (64-bit)'); INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (145, 3, 'Oracle Enterprise Linux 5.6 (32-bit)'); @@ -745,3 +759,5 @@ UPDATE `cloud`.`networks` n SET n.display_text=(CONCAT('guestNetworkForBasicZon UPDATE `cloud`.`configuration` SET description='Bypass internal dns, use external dns1 and dns2' WHERE name='use.external.dns'; UPDATE `cloud`.`configuration` SET category='Alert' WHERE name='capacity.check.period'; UPDATE `cloud`.`vm_instance` SET vnc_password = '' where removed is not null; + +DELETE FROM `cloud`.`host_details` where name in ('storage.network.device1', 'storage.network.device2'); diff --git a/setup/db/db/schema-302to303.sql b/setup/db/db/schema-302to303.sql index a16a9f042b7..4da78f7d899 100755 --- a/setup/db/db/schema-302to303.sql +++ b/setup/db/db/schema-302to303.sql @@ -170,22 +170,22 @@ DELETE FROM `cloud`.`storage_pool_host_ref` WHERE pool_id IN (SELECT id FROM sto ALTER TABLE `cloud`.`service_offering` MODIFY `nw_rate` smallint(5) unsigned DEFAULT '200' COMMENT 'network rate throttle mbits/s'; -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (141, 1, 'CentOS 5.6 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (142, 1, 'CentOS 5.6 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (143, 1, 'CentOS 6.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (144, 1, 'CentOS 6.0 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (145, 3, 'Oracle Enterprise Linux 5.6 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (146, 3, 'Oracle Enterprise Linux 5.6 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (147, 3, 'Oracle Enterprise Linux 6.0 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (148, 3, 'Oracle Enterprise Linux 6.0 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (149, 4, 'Red Hat Enterprise Linux 5.6 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (150, 4, 'Red Hat Enterprise Linux 5.6 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (151, 5, 'SUSE Linux Enterprise Server 10 SP3 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (152, 5, 'SUSE Linux Enterprise Server 10 SP4 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (153, 5, 'SUSE Linux Enterprise Server 10 SP4 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (154, 5, 'SUSE Linux Enterprise Server 11 SP1 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (155, 5, 'SUSE Linux Enterprise Server 11 SP1 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (156, 10, 'Ubuntu 10.10 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (157, 10, 'Ubuntu 10.10 (64-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (161, 1, 'CentOS 5.7 (32-bit)'); -INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (162, 1, 'CentOS 5.7 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (141, 1, 'CentOS 5.6 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (142, 1, 'CentOS 5.6 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (143, 1, 'CentOS 6.0 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (144, 1, 'CentOS 6.0 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (145, 3, 'Oracle Enterprise Linux 5.6 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (146, 3, 'Oracle Enterprise Linux 5.6 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (147, 3, 'Oracle Enterprise Linux 6.0 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (148, 3, 'Oracle Enterprise Linux 6.0 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (149, 4, 'Red Hat Enterprise Linux 5.6 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (150, 4, 'Red Hat Enterprise Linux 5.6 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (151, 5, 'SUSE Linux Enterprise Server 10 SP3 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (152, 5, 'SUSE Linux Enterprise Server 10 SP4 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (153, 5, 'SUSE Linux Enterprise Server 10 SP4 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (154, 5, 'SUSE Linux Enterprise Server 11 SP1 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (155, 5, 'SUSE Linux Enterprise Server 11 SP1 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (156, 10, 'Ubuntu 10.10 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (157, 10, 'Ubuntu 10.10 (64-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (161, 1, 'CentOS 5.7 (32-bit)'); +INSERT IGNORE INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (162, 1, 'CentOS 5.7 (64-bit)'); diff --git a/setup/db/db/schema-304to305.sql b/setup/db/db/schema-304to305.sql index a2e726ef3f1..399114de1d3 100755 --- a/setup/db/db/schema-304to305.sql +++ b/setup/db/db/schema-304to305.sql @@ -182,7 +182,9 @@ CREATE TABLE `cloud`.`counter` ( `removed` datetime COMMENT 'date removed if not null', `created` datetime NOT NULL COMMENT 'date created', PRIMARY KEY (`id`), - CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`), + INDEX `i_counter__removed`(`removed`), + INDEX `i_counter__source`(`source`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`conditions` ( @@ -199,7 +201,8 @@ CREATE TABLE `cloud`.`conditions` ( CONSTRAINT `fk_conditions__counter_id` FOREIGN KEY `fk_condition__counter_id`(`counter_id`) REFERENCES `counter`(`id`), CONSTRAINT `fk_conditions__account_id` FOREIGN KEY `fk_condition__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_conditions__domain_id` FOREIGN KEY `fk_condition__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, - CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`), + INDEX `i_conditions__removed`(`removed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_vmprofiles` ( @@ -221,7 +224,8 @@ CREATE TABLE `cloud`.`autoscale_vmprofiles` ( CONSTRAINT `fk_autoscale_vmprofiles__domain_id` FOREIGN KEY `fk_autoscale_vmprofiles__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmprofiles__account_id` FOREIGN KEY `fk_autoscale_vmprofiles__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmprofiles__autoscale_user_id` FOREIGN KEY `fk_autoscale_vmprofiles__autoscale_user_id` (`autoscale_user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE, - CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`), + INDEX `i_autoscale_vmprofiles__removed`(`removed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_policies` ( @@ -237,7 +241,8 @@ CREATE TABLE `cloud`.`autoscale_policies` ( PRIMARY KEY (`id`), CONSTRAINT `fk_autoscale_policies__domain_id` FOREIGN KEY `fk_autoscale_policies__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_policies__account_id` FOREIGN KEY `fk_autoscale_policies__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, - CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`), + INDEX `i_autoscale_policies__removed`(`removed`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_vmgroups` ( @@ -261,7 +266,9 @@ CREATE TABLE `cloud`.`autoscale_vmgroups` ( CONSTRAINT `fk_autoscale_vmgroups__domain_id` FOREIGN KEY `fk_autoscale_vmgroups__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmgroups__account_id` FOREIGN KEY `fk_autoscale_vmgroups__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE, CONSTRAINT `fk_autoscale_vmgroups__zone_id` FOREIGN KEY `fk_autoscale_vmgroups__zone_id`(`zone_id`) REFERENCES `data_center`(`id`), - CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`) + CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`), + INDEX `i_autoscale_vmgroups__removed`(`removed`), + INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_policy_condition_map` ( @@ -270,7 +277,8 @@ CREATE TABLE `cloud`.`autoscale_policy_condition_map` ( `condition_id` bigint unsigned NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_autoscale_policy_condition_map__policy_id` FOREIGN KEY `fk_autoscale_policy_condition_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id` (`condition_id`) REFERENCES `conditions` (`id`) + CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id` (`condition_id`) REFERENCES `conditions` (`id`), + INDEX `i_autoscale_policy_condition_map__policy_id`(`policy_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` ( @@ -279,7 +287,8 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` ( `policy_id` bigint unsigned NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `fk_autoscale_vmgroup_policy_map__vmgroup_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__vmgroup_id` (`vmgroup_id`) REFERENCES `autoscale_vmgroups` (`id`) ON DELETE CASCADE, - CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) + CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`), + INDEX `i_autoscale_vmgroup_policy_map__vmgroup_id`(`vmgroup_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User CPU - Percentage', '1.3.6.1.4.1.2021.11.9.0', now()); @@ -365,6 +374,8 @@ UPDATE `cloud`.`configuration` SET component='StorageManager' WHERE name='storag UPDATE `cloud`.`configuration` SET description='Comma separated list of cidrs internal to the datacenter that can host template download servers, please note 0.0.0.0 is not a valid site ' WHERE name='secstorage.allowed.internal.sites'; INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.vpngateway.connection.limit', '4', 'The maximum number of VPN connection per VPN gateway'); -INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.customergateway.subnets.limit', '10', 'The maximum number of subnets per customer gateway'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.customergateway.subnets.limit', '10', 'The maximum number of subnets per customer gateway'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Usage', 'DEFAULT', 'management-server', 'traffic.sentinel.include.zones', 'EXTERNAL', 'Traffic going into specified list of zones is metered. For metering all traffic leave this parameter empty'); +INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Usage', 'DEFAULT', 'management-server', 'traffic.sentinel.exclude.zones', '', 'Traffic going into specified list of zones is not metered'); DROP TABLE IF EXISTS `cloud`.`ovs_tunnel_account`; diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 4c08f8ad863..52ff10a3aa6 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -20,6 +20,7 @@ from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * from marvin.remoteSSHClient import remoteSSHClient +from nose.plugins.attrib import attr import datetime @@ -39,7 +40,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "user": { "email": "user@test.com", @@ -48,7 +49,7 @@ class Services: "username": "User", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -72,7 +73,7 @@ class Services: "template": { "displaytext": "Public Template", "name": "Public template", - "ostypeid": 'aaf6e8c9-b609-441d-9ebd-b4eaa030a275', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2", "hypervisor": 'XenServer', "format": 'VHD', @@ -80,7 +81,7 @@ class Services: "ispublic": True, "isextractable": True, }, - "ostypeid": 'aaf6e8c9-b609-441d-9ebd-b4eaa030a275', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, diff --git a/test/integration/component/test_allocation_states.py b/test/integration/component/test_allocation_states.py new file mode 100644 index 00000000000..5d702b9f9c6 --- /dev/null +++ b/test/integration/component/test_allocation_states.py @@ -0,0 +1,274 @@ +# -*- encoding: utf-8 -*- +# Copyright 2012 Citrix Systems, Inc. Licensed under the +# Apache License, Version 2.0 (the "License"); you may not use this +# file except in compliance with the License. Citrix Systems, Inc. +# reserves all rights not expressly granted by the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Automatically generated by addcopyright.py at 04/03/2012 +import marvin +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from integration.lib.utils import * +from integration.lib.base import * +from integration.lib.common import * +import datetime + + +class Services: + """Test Resource Limits Services + """ + + def __init__(self): + self.services = { + "domain": { + "name": "Domain", + }, + "account": { + "email": "test@test.com", + "firstname": "Test", + "lastname": "User", + "username": "test", + # Random characters are appended for unique + # username + "password": "password", + }, + "service_offering": { + "name": "Tiny Instance", + "displaytext": "Tiny Instance", + "cpunumber": 1, + "cpuspeed": 100, # in MHz + "memory": 64, # In MBs + }, + "disk_offering": { + "displaytext": "Small", + "name": "Small", + "disksize": 1 + }, + "volume": { + "diskname": "TestDiskServ", + }, + "server": { + "displayname": "TestVM", + "username": "root", + "password": "password", + "ssh_port": 22, + "hypervisor": 'XenServer', + "privateport": 22, + "publicport": 22, + "protocol": 'TCP', + }, + "template": { + "displaytext": "Cent OS Template", + "name": "Cent OS Template", + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', + "templatefilter": 'self', + }, + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', + # Cent OS 5.3 (64 bit) + "sleep": 60, + "timeout": 10, + "mode": 'advanced', + } + + +class TestAllocationState(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cls.api_client = super( + TestResources, + cls + ).getClsTestClient().getApiClient() + cls.services = Services().services + # Get Zone, Domain and templates + cls.zone = get_zone(cls.api_client, cls.services) + cls._cleanup = [] + return + + @classmethod + def tearDownClass(cls): + try: + #Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + self.cleanup = [] + return + + def tearDown(self): + try: + #Clean up, terminate the created instance, volumes and snapshots + cleanup_resources(self.apiclient, self.cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + @attr(tags = ["advanced", "advancedns", "simulator"]) + def test_01_zones(self): + """Check the status of zones""" + + # Validate the following + # 1. List zones + # 2. Check allocation state is "enabled" or not + + zones = Zone.list( + self.apiclient, + id=self.zone.id, + listall=True + ) + self.assertEqual( + isinstance(zones, list), + True, + "Check if listZones returns a valid response" + ) + for zone in zones: + self.assertEqual( + zone.allocationstate, + 'Enabled', + "Zone allocation state should be enabled" + ) + return + + @attr(tags = ["advanced", "advancedns", "simulator"]) + def test_02_pods(self): + """Check the status of pods""" + + # Validate the following + # 1. List pods + # 2. Check allocation state is "enabled" or not + + pods = Pod.list( + self.apiclient, + zoneid=self.zone.id, + listall=True + ) + self.assertEqual( + isinstance(pods, list), + True, + "Check if listPods returns a valid response" + ) + for pod in pods: + self.assertEqual( + pod.allocationstate, + 'Enabled', + "Pods allocation state should be enabled" + ) + return + + @attr(tags = ["advanced", "advancedns", "simulator"]) + def test_03_clusters(self): + """Check the status of clusters""" + + # Validate the following + # 1. List clusters + # 2. Check allocation state is "enabled" or not + + clusters = Cluster.list( + self.apiclient, + zoneid=self.zone.id, + listall=True + ) + self.assertEqual( + isinstance(clusters, list), + True, + "Check if listClusters returns a valid response" + ) + for cluster in clusters: + self.assertEqual( + cluster.allocationstate, + 'Enabled', + "Clusters allocation state should be enabled" + ) + return + + @attr(tags = ["advanced", "advancedns", "simulator"]) + def test_04_hosts(self): + """Check the status of hosts""" + + # Validate the following + # 1. List hosts with type=Routing + # 2. Check state is "Up" or not + + hosts = Host.list( + self.apiclient, + zoneid=self.zone.id, + type='Routing', + listall=True + ) + self.assertEqual( + isinstance(hosts, list), + True, + "Check if listHosts returns a valid response" + ) + for host in hosts: + self.assertEqual( + host.state, + 'Up', + "Host should be in Up state and running" + ) + return + + @attr(tags = ["advanced", "advancedns", "simulator"]) + def test_05_storage_pools(self): + """Check the status of Storage pools""" + + # Validate the following + # 1. List storage pools for the zone + # 2. Check state is "enabled" or not + + storage_pools = StoragePool.list( + self.apiclient, + zoneid=self.zone.id, + listall=True + ) + self.assertEqual( + isinstance(storage_pools, list), + True, + "Check if listStoragePools returns a valid response" + ) + for storage_pool in storage_pools: + self.assertEqual( + storage_pool.state, + 'Up', + "storage pool should be in Up state and running" + ) + return + + @attr(tags = ["advanced", "advancedns", "simulator"]) + def test_06_secondary_storage(self): + """Check the status of secondary storage""" + + # Validate the following + # 1. List secondary storage + # 2. Check state is "Up" or not + + sec_storages = Host.list( + self.apiclient, + zoneid=self.zone.id, + type='SecondaryStorageVM', + listall=True + ) + self.assertEqual( + isinstance(sec_storages, list), + True, + "Check if listHosts returns a valid response" + ) + for sec_storage in sec_storages: + self.assertEqual( + sec_storage.state, + 'Up', + "Secondary storage should be in Up state" + ) + return diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 08747a99f9c..fd9c1a4ee79 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -14,6 +14,7 @@ """ Tests for Blocker bugs """ import marvin +from nose.plugins.attrib import attr from integration.lib.base import * from integration.lib.utils import * from integration.lib.common import * @@ -40,7 +41,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -72,7 +73,7 @@ class Services: "templates": { "displaytext": 'Template from snapshot', "name": 'Template from snapshot', - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2", "hypervisor": 'XenServer', @@ -94,7 +95,7 @@ class Services: "endport": 22, "protocol": "TCP" }, - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "mode": 'advanced', @@ -1068,6 +1069,7 @@ class TestTemplates(cloudstackTestCase): return + @attr(speed = "slow") @attr(tags = ["advanced", "advancedns", "basic", "sg", "eip"]) def test_01_check_template_size(self): """TS_BUG_009-Test the size of template created from root disk @@ -1095,6 +1097,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(speed = "slow") @attr(tags = ["advanced", "advancedns", "basic", "sg", "eip"]) def test_02_check_size_snapshotTemplate(self): """TS_BUG_010-Test check size of snapshot and template @@ -1175,6 +1178,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(speed = "slow") @attr(tags = ["advanced", "advancedns", "basic", "sg", "eip"]) def test_03_resuse_template_name(self): """TS_BUG_011-Test Reusing deleted template name diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index 7f745e73f26..d5e39beb540 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.remoteSSHClient import remoteSSHClient @@ -46,7 +47,7 @@ class Services: "username": "test", # Random characters are appended in create account to # ensure unique username generated each time - "password": "fr3sca", + "password": "password", }, "virtual_machine": { # Create a small virtual machine instance with disk offering @@ -111,10 +112,10 @@ class Services: }, "mgmt_server": { "username": "root", - "password": "fr3sca", + "password": "password", "ipaddress": "192.168.100.21" }, - "ostypeid": '85cb528f-72ed-4df9-ac6a-f6ccf0892ff2', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # CentOS 5.3 (64-bit) "sleep": 60, "timeout": 10, @@ -2219,7 +2220,8 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase): return - @attr(tags = ["sg", "eip"]) + @attr(speed = "slow") + @attr(tags = ["sg", "eip", "maintenance"]) def test_egress_after_host_maintainance(self): """Test maintenance case for egress """ diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index ea9e7d4a058..c5648bad661 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -77,7 +78,7 @@ class Services: "username": 'nsroot', "password": 'nsroot' }, - "ostypeid": '593341d7-879b-451e-804c-0c01bdea10c1', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -179,7 +180,7 @@ class TestEIP(cloudstackTestCase): @attr(tags = ["eip"]) - @unittest.skip("skipped") + @unittest.skip("skipped - Framework DB Exception") def test_01_eip_by_deploying_instance(self): """Test EIP by deploying an instance """ @@ -347,7 +348,7 @@ class TestEIP(cloudstackTestCase): return @attr(tags = ["eip"]) - @unittest.skip("skipped") + @unittest.skip("skipped - Framework DB Exception") def test_02_acquire_ip_enable_static_nat(self): """Test associate new IP and enable static NAT for new IP and the VM """ @@ -492,7 +493,7 @@ class TestEIP(cloudstackTestCase): return @attr(tags = ["eip"]) - @unittest.skip("skipped") + @unittest.skip("skipped - Framework DB Exception") def test_03_disable_static_nat(self): """Test disable static NAT and release EIP acquired """ @@ -692,7 +693,7 @@ class TestEIP(cloudstackTestCase): return @attr(tags = ["eip"]) - @unittest.skip("skipped") + @unittest.skip("skipped - Framework DB Exception") def test_04_disable_static_nat_system(self): """Test disable static NAT with system = True """ @@ -762,7 +763,7 @@ class TestEIP(cloudstackTestCase): return @attr(tags = ["eip"]) - @unittest.skip("skipped") + @unittest.skip("skipped - Framework DB Exception") def test_05_destroy_instance(self): """Test EIO after destroying instance """ diff --git a/test/integration/component/test_high_availability.py b/test/integration/component/test_high_availability.py index 2376d61d5b7..5d7a1747f29 100644 --- a/test/integration/component/test_high_availability.py +++ b/test/integration/component/test_high_availability.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -80,7 +81,7 @@ class Services: "templates": { "displaytext": "Public Template", "name": "Public template", - "ostypeid": '1d4a6dce-8db1-4c08-8752-e88b360d8287', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2", "hypervisor": 'XenServer', "format": 'VHD', @@ -89,7 +90,7 @@ class Services: "isextractable": True, "templatefilter": 'self', }, - "ostypeid": '1d4a6dce-8db1-4c08-8752-e88b360d8287', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 100, @@ -169,7 +170,7 @@ class TestHighAvailability(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns"]) + @attr(tags = ["advanced", "advancedns", "multihost"]) def test_01_host_maintenance_mode(self): """Test host maintenance mode """ @@ -560,7 +561,7 @@ class TestHighAvailability(cloudstackTestCase): ) return - @attr(tags = ["advanced", "advancedns"]) + @attr(tags = ["advanced", "advancedns", "multihost"]) def test_02_host_maintenance_mode_with_activities(self): """Test host maintenance mode with activities """ diff --git a/test/integration/component/test_host_high_availability.py b/test/integration/component/test_host_high_availability.py index a019c0970f4..7adf4078246 100644 --- a/test/integration/component/test_host_high_availability.py +++ b/test/integration/component/test_host_high_availability.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -65,7 +66,7 @@ class Services: "publicport": 22, "protocol": 'TCP', }, - "ostypeid": '6a6b23aa-5e59-4b53-8161-0ad1aa5990f1', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "timeout": 100, } @@ -146,6 +147,8 @@ class TestHostHighAvailability(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(configuration = "ha.tag") + @attr(tags = ["advanced", "advancedns", "sg", "basic", "eip", "simulator"]) def test_01_vm_deployment_with_compute_offering_with_ha_enabled(self): """ Test VM deployments (Create HA enabled Compute Service Offering and VM) """ @@ -209,6 +212,8 @@ class TestHostHighAvailability(cloudstackTestCase): "VM not created with HA enable tag" ) + @attr(configuration = "ha.tag") + @attr(tags = ["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_02_no_vm_creation_on_host_with_haenabled(self): """ Verify you can not create new VMs on hosts with an ha.tag """ @@ -332,6 +337,8 @@ class TestHostHighAvailability(cloudstackTestCase): "VM migrated to HA enabled host." ) + @attr(configuration = "ha.tag") + @attr(tags = ["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_03_cant_migrate_vm_to_host_with_ha_positive(self): """ Verify you can not migrate VMs to hosts with an ha.tag (positive) """ @@ -436,6 +443,8 @@ class TestHostHighAvailability(cloudstackTestCase): "The VM is not migrated to targeted suitable host." ) + @attr(configuration = "ha.tag") + @attr(tags = ["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_04_cant_migrate_vm_to_host_with_ha_negative(self): """ Verify you can not migrate VMs to hosts with an ha.tag (negative) """ @@ -539,6 +548,9 @@ class TestHostHighAvailability(cloudstackTestCase): "The detination host id of migrated VM is not matching." ) + @attr(configuration = "ha.tag") + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_05_no_vm_with_ha_gets_migrated_to_ha_host_in_live_migration(self): """ Verify that none of the VMs with HA enabled migrate to an ha tagged host during live migration """ @@ -668,6 +680,9 @@ class TestHostHighAvailability(cloudstackTestCase): cmd.id = vm_with_ha_enabled.hostid self.apiclient.cancelHostMaintenance(cmd) + @attr(configuration = "ha.tag") + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "sg", "basic", "eip", "simulator", "multihost"]) def test_06_no_vm_without_ha_gets_migrated_to_ha_host_in_live_migration(self): """ Verify that none of the VMs without HA enabled migrate to an ha tagged host during live migration """ diff --git a/test/integration/component/test_netscaler_configs.py b/test/integration/component/test_netscaler_configs.py index ed4c654842b..a5d282be2c6 100644 --- a/test/integration/component/test_netscaler_configs.py +++ b/test/integration/component/test_netscaler_configs.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -38,7 +39,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -140,7 +141,7 @@ class Services: "publicport": 22, "openfirewall": False, }, - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -188,10 +189,10 @@ class TestAddNetScaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_add_netscaler_device(self): """Test add netscaler device """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device into a Zone by providing valid log in # credentials , public , private interface and enabling Load @@ -314,10 +315,10 @@ class TestInvalidParametersNetscaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_invalid_cred(self): """Test add netscaler device with invalid credential """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device into a Zone by providing invalid log in @@ -383,10 +384,10 @@ class TestInvalidParametersNetscaler(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_invalid_public_interface(self): """Test add netscaler device with invalid public interface """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device into a Zone by providing valid log in @@ -450,10 +451,10 @@ class TestInvalidParametersNetscaler(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_invalid_private_interface(self): """Test add netscaler device with invalid private interface """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device into a Zone by providing valid log in @@ -635,10 +636,10 @@ class TestNetScalerDedicated(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_netscaler_dedicated_mode(self): """Test netscaler device in dedicated mode """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in dedicated mode. @@ -854,10 +855,10 @@ class TestNetScalerShared(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_netscaler_shared_mode(self): """Test netscaler device in shared mode """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in shared mode. @@ -1103,10 +1104,10 @@ class TestNetScalerCustomCapacity(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_netscaler_custom_capacity(self): """Test netscaler device with custom capacity """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in shared mode with capacity 3 @@ -1376,10 +1377,10 @@ class TestNetScalerNoCapacity(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_netscaler_no_capacity(self): """Test netscaler device with no capacity remaining """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in shared mode with capacity 2 @@ -1644,10 +1645,10 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_guest_network(self): """Implementing Guest Network when first VM gets deployed using the network having Netscaler as LB """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -1764,10 +1765,10 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_02_guest_network_multiple(self): """Implementing Guest Network when multiple VMs gets deployed using the network having Netscaler as LB """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -1930,10 +1931,10 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_03_delete_account(self): """Delete an account that has LB rules """ - tags = ["advancedns"] # Validate the following # 1. Acquire an ipaddress. Create multiple Lb rules on this ip address @@ -2210,10 +2211,10 @@ class TestGuestNetworkShutDown(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_stop_all_vms(self): """Test Stopping all the Vms for any account that has LB rules. """ - tags = ["advancedns"] # Validate the following # 1. Acquire IP address and create a load balancer rule @@ -2291,10 +2292,10 @@ class TestGuestNetworkShutDown(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_02_start_one_vm(self): """Test LB rules on Netscaler after starting one Vm in account """ - tags = ["advancedns"] # Validate the following # 1. Acquire IP address and create a load balancer rule @@ -2376,10 +2377,10 @@ class TestGuestNetworkShutDown(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_03_network_restart_without_cleanup(self): """Test LB rules on Netscaler after network restart without cleanup """ - tags = ["advancedns"] # Validate the following # 1. Acquire IP address and create a load balancer rule @@ -2438,10 +2439,10 @@ class TestGuestNetworkShutDown(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_04_network_restart_with_cleanup(self): """Test LB rules on Netscaler after network restart with cleanup """ - tags = ["advancedns"] # Validate the following # 1. Acquire IP address and create a load balancer rule @@ -2614,10 +2615,10 @@ class TestServiceProvider(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_create_nw_off_disabled(self): """Test create network with network offering disabled """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -2660,10 +2661,10 @@ class TestServiceProvider(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_02_create_nw_sp_disabled(self): """Test create network when service provider is disabled """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -2693,10 +2694,10 @@ class TestServiceProvider(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_03_create_lb_sp_disabled(self): """Test create LB rules when service provider is disabled """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -2930,10 +2931,10 @@ class TestDeleteNetscaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_delete_netscaler_with_lb(self): """Test delete Netscaler when active LB rules are present """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. diff --git a/test/integration/component/test_netscaler_lb.py b/test/integration/component/test_netscaler_lb.py index 716657ed358..22433378b1a 100644 --- a/test/integration/component/test_netscaler_lb.py +++ b/test/integration/component/test_netscaler_lb.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -134,7 +135,7 @@ class Services: "publicport": 22, "protocol": "TCP" }, - "ostypeid": '2b58909b-7d9e-45d9-80d8-e58d0bbcbf07', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -221,11 +222,11 @@ class TestLbSourceNat(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_add_lb_on_source_nat(self): """Test Create LB rule for sourceNat IP address """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -430,11 +431,11 @@ class TestLbOnIpWithPf(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_on_ip_with_pf(self): """Test Create LB rule for sourceNat IP address """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -641,11 +642,11 @@ class TestPfOnIpWithLb(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_pf_on_ip_with_lb(self): """Test Create a port forwarding rule on an Ip address that already has a LB rule. """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -853,11 +854,11 @@ class TestLbOnNonSourceNat(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_on_non_source_nat(self): """Test Create LB rule for non-sourceNat IP address """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1068,11 +1069,11 @@ class TestAddMultipleVmsLb(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_add_multiple_vms_lb(self): """Test Add multiple Vms to an existing LB rule. """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1346,11 +1347,11 @@ class TestMultipleLbRules(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_multiple_lb_publicip(self): """Test Create multiple LB rules using different public Ips acquired """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1662,11 +1663,11 @@ class TestMultipleLbRulesSameIp(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_multiple_lb_same_publicip(self): """Test Create multiple LB rules using same public Ips on diff ports """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -2019,11 +2020,11 @@ class TestLoadBalancingRule(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_edit_name_lb_rule(self): """Test edit name of LB rule """ - tags = ["advancedns"] # Validate the following # 1. Create an Lb rule for couple of Vms . @@ -2053,11 +2054,11 @@ class TestLoadBalancingRule(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_02_edit_lb_ports(self): """Test edit public port of LB rule """ - tags = ["advancedns"] # Validate the following # 1. Create an Lb rule for couple of Vms . @@ -2075,11 +2076,11 @@ class TestLoadBalancingRule(cloudstackTestCase): return + @attr(tags = ["advancedns"]) def test_03_delete_lb_rule(self): """Test delete LB rule """ - tags = ["advancedns"] # Validate the following # 1. Delete existing load balancing rule @@ -2243,10 +2244,10 @@ class TestDeleteCreateLBRule(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_create_with_same_public_port(self): """Test create LB rule with same public port after deleting rule""" - tags = ["advancedns"] # Validate the following # 1. Delete existing rule and create exactly same rule with different @@ -2404,10 +2405,10 @@ class TestVmWithLb(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_delete_public_ip(self): """Test delete one public Ip with LB rules""" - tags = ["advancedns"] # Validate the following # 1. Associate 2 public Ips and create load balancing rules in it @@ -2473,10 +2474,10 @@ class TestVmWithLb(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_02_stop_user_vm(self): """Test stop user VM with LB""" - tags = ["advancedns"] # Validate the following # 1. Create 2 instances and add these two for load balancing @@ -2553,10 +2554,10 @@ class TestVmWithLb(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_03_start_user_vm(self): """Test start user VM with LB""" - tags = ["advancedns"] # Validate the following # 1. Create 2 instances and add these two for load balancing @@ -2624,10 +2625,10 @@ class TestVmWithLb(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns", "multihost"]) def test_04_migrate_user_vm(self): """Test migrate user VM with LB""" - tags = ["advancedns"] # Validate the following # 1. Create 2 instances and add these two for load balancing @@ -2737,10 +2738,10 @@ class TestVmWithLb(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_05_reboot_user_vm(self): """Test reboot user VM with LB""" - tags = ["advancedns"] # Validate the following # 1. Create 2 instances and add these two for load balancing @@ -2807,10 +2808,10 @@ class TestVmWithLb(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_06_destroy_user_vm(self): """Test destroy user VM with LB""" - tags = ["advancedns"] # Validate the following # 1. Create 2 instances and add these two for load balancing @@ -2890,10 +2891,10 @@ class TestVmWithLb(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_07_delete_all_public_ip(self): """Test delete all public Ip with LB rules""" - tags = ["advancedns"] # Validate the following # 1. Associate 2 public Ips and create load balancing rules in it diff --git a/test/integration/component/test_netscaler_lb_algo.py b/test/integration/component/test_netscaler_lb_algo.py index 1cd78dc61bc..5f69564d3a8 100644 --- a/test/integration/component/test_netscaler_lb_algo.py +++ b/test/integration/component/test_netscaler_lb_algo.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -100,7 +101,7 @@ class Services: "publicport": 22, "openfirewall": False, }, - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -188,10 +189,10 @@ class TestLbWithRoundRobin(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_with_round_robin(self): """Test Create LB rule with round robin algorithm """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -401,10 +402,10 @@ class TestLbWithLeastConn(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_with_least_conn(self): """Test Create LB rule with least connection algorithm """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -620,10 +621,10 @@ class TestLbWithSourceIp(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_with_source_ip(self): """Test Create LB rule with source Ip algorithm """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -857,10 +858,10 @@ class TestLbAlgoRrLc(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_round_robin_to_least_conn(self): """Test edit LB rule from round robin to least connection algo """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1069,10 +1070,10 @@ class TestLbAlgoLcRr(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_least_conn_to_round_robin(self): """Test edit LB rule from least conn to round robin algo """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1279,10 +1280,10 @@ class TestLbAlgoRrSb(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_round_robin_to_source(self): """Test edit LB rule from round robin to source algo """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1491,10 +1492,10 @@ class TestLbAlgoSbRr(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_source_to_round_robin(self): """Test edit LB rule from source to round robin algo """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1706,10 +1707,10 @@ class TestLbAlgoSbLc(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_source_to_least_conn(self): """Test edit LB rule from source to least conn algo """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created @@ -1919,10 +1920,10 @@ class TestLbAlgoLcSb(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_lb_leastconn_to_source(self): """Test edit LB rule from round robin to source algo """ - tags = ["advancedns"] # Validate the following # 1. Deploy the first VM using a network from the above created diff --git a/test/integration/component/test_netscaler_lb_sticky.py b/test/integration/component/test_netscaler_lb_sticky.py index 8a420ae838e..008fef8643c 100644 --- a/test/integration/component/test_netscaler_lb_sticky.py +++ b/test/integration/component/test_netscaler_lb_sticky.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -100,7 +101,7 @@ class Services: "publicport": 22, "openfirewall": False, }, - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -215,10 +216,10 @@ class TestLbStickyPolicy(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_source_based_roundrobin(self): """Test Create a "SourceBased" stick policy for a Lb rule with "RoundRobin" algorithm """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -303,10 +304,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_02_source_based_source_algo(self): """Test Create a "SourceBased" stick policy for a Lb rule with "Source" algorithm """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -392,10 +393,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_03_source_based_leastconn(self): """Test Create a "SourceBased" stick policy for a Lb rule with leastconn algo """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -481,10 +482,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_04_lbcookie_based_roundrobin(self): """Test Create a "LBCookie" stick policy for a Lb rule with roundrobin algo """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -572,10 +573,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_05_lbcookie_source_algo(self): """Test Create a "LBCookie" stick policy for a Lb rule with "Source" algorithm """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -663,10 +664,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_06_lbcookie_leastconn(self): """Test Create a "LBCookie" stick policy for a Lb rule with leastconn algo """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -754,10 +755,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_07_appcookie_based_roundrobin(self): """Test Create a "AppCookie" stick policy for a Lb rule with roundrobin algo """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -845,10 +846,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_08_appcookie_source_algo(self): """Test Create a "AppCookie" stick policy for a Lb rule with "Source" """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. @@ -936,10 +937,10 @@ class TestLbStickyPolicy(cloudstackTestCase): (self.services["netscaler"]["ipaddress"], e)) return + @attr(tags = ["advancedns"]) def test_09_appcookie_leastconn(self): """Test Create a "AppCookie" stick policy for a Lb rule with leastconn """ - tags = ["advancedns"] # Validate the following # 1. Configure Netscaler for load balancing. diff --git a/test/integration/component/test_netscaler_nw_off.py b/test/integration/component/test_netscaler_nw_off.py index b70b3cc8241..9cf97dbb93f 100644 --- a/test/integration/component/test_netscaler_nw_off.py +++ b/test/integration/component/test_netscaler_nw_off.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -38,7 +39,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -153,7 +154,7 @@ class Services: "publicport": 22, "openfirewall": False, }, - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -201,11 +202,11 @@ class TestAddMultipleNetScaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_add_netscaler_device(self): """Test add netscaler device """ - tags = ["advancedns"] # Validate the following # 1. Add multiple instances of netscaler @@ -359,11 +360,11 @@ class TestAddMultipleNSDiffZone(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns", "multizone"]) def test_add_mul_netscaler_diff_zone(self): """Test add netscaler devices in different zones """ - tags = ["advancedns"] # Validate the following # 1. Add multiple instances of Netscaler in different zones @@ -647,11 +648,11 @@ class TestNetScalerSharedMode(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_netscaler_shared_mode(self): """Test netscaler device in shared mode """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in shared mode with capacity 3 @@ -802,11 +803,11 @@ class TestNetScalerSharedMode(cloudstackTestCase): self.debug("Deploy VM failed as Netscaler device capacity is full!") return + @attr(tags = ["advancedns"]) def test_02_multiple_netscaler_capacilty(self): """Test multiple netscaler devices with limited capacity """ - tags = ["advancedns"] # Validate the following # 1. Add another netscaler device and spawn a new VM again @@ -904,11 +905,11 @@ class TestNetScalerSharedMode(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_03_multiple_netscaler_full_capacilty(self): """Test netscaler device with full capacity """ - tags = ["advancedns"] # Validate the following # 1. Spawn multiple instances for utilizing full capacity of Netscaler @@ -989,11 +990,12 @@ class TestNetScalerSharedMode(cloudstackTestCase): self.debug("Deploy VM failed as Netscaler device capacity is full!") return + @attr(configuration = "network.gc") + @attr(tags = ["advancedns"]) def test_04_delete_account_after_capacity_full(self): """Test delete and add resouces after netscaler device capacity is full """ - tags = ["advancedns"] # Validate the following # 1. Delete one of the account. Wait till Network.gc.wait & @@ -1174,11 +1176,11 @@ class TestNwOffDedicatedNetscaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_nw_off_dedicated_mode(self): """Test network offering in dedicated mode device """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in shared mode @@ -1368,11 +1370,11 @@ class TestNwOffNetscaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_ns_shared_nw_dedicated(self): """Test netscaler device in shared mode with network offering in dedicated mode """ - tags = ["advancedns"] # Validate the following # 1. Add Netscaler device in shared mode @@ -1679,10 +1681,10 @@ class TestNwOffSToDUpgrade(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_shared_to_dedicated_upgrade(self): """Test upgrade from shared LB isolation to dedicated LB isolation""" - tags = ["advancedns"] # Validate the following # 1. Create a dedicated and shared network offering @@ -2096,10 +2098,10 @@ class TestNwOffDToSUpgrade(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_shared_to_dedicated_upgrade(self): """Test upgrade from shared LB isolation to dedicated LB isolation""" - tags = ["advancedns"] # Validate the following # 1. Create a dedicated and shared network offering diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 010dbf2404b..66850e2feee 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -38,7 +39,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -133,7 +134,7 @@ class Services: "publicport": 22, "protocol": 'TCP', }, - "ostypeid": '9958b10f-9e5d-4ef1-908d-a047372d823b', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -206,11 +207,11 @@ class TestNOVirtualRouter(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced"]) def test_01_network_off_without_conserve_mode(self): """Test Network offering with Conserve mode off and VR - All services """ - tags = ["advanced"] # Validate the following # 1. Create a Network from the above network offering and deploy a VM. @@ -451,11 +452,11 @@ class TestNOVirtualRouter(cloudstackTestCase): ) return + @attr(tags = ["advanced"]) def test_02_network_off_with_conserve_mode(self): """Test Network offering with Conserve mode ON and VR - All services """ - tags = ["advanced"] # Validate the following # 1. Create a Network from the above network offering and deploy a VM. @@ -784,11 +785,11 @@ class TestNOWithNetscaler(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advancedns"]) def test_01_network_off_without_conserve_mode(self): """Test Nw off with Conserve mode off, VR-All services, LB-netscaler """ - tags = ["advancedns"] # Validate the following # 1. Create a Network from the above network offering and deploy a VM. @@ -1053,11 +1054,11 @@ class TestNOWithNetscaler(cloudstackTestCase): ) return + @attr(tags = ["advancedns"]) def test_02_network_off_with_conserve_mode_netscaler(self): """Test NW off with Conserve mode ON, LB-Netscaler and VR-All services """ - tags = ["advancedns"] # Validate the following # 1. Create a Network from the above network offering and deploy a VM. @@ -1428,11 +1429,12 @@ class TestNetworkUpgrade(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advancedns"]) def test_01_nwupgrade_netscaler_conserve_on(self): """Test Nw upgrade to netscaler lb service and conserve mode ON """ - tags = ["advancedns"] # Validate the following # 1. Upgrade a network with VR and conserve mode ON TO @@ -1627,11 +1629,12 @@ class TestNetworkUpgrade(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advancedns"]) def test_02_nwupgrade_netscaler_conserve_off(self): """Test Nw upgrade to netscaler lb service and conserve mode OFF """ - tags = ["advancedns"] # Validate the following # 1. Upgrade a network with VR and conserve mode ON TO diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index d153bf3d616..545f8ee3274 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -40,7 +41,7 @@ class Services: "mgmt_server": { "ipaddress": '192.168.100.21', "username": 'root', - "password": 'fr3sca', + "password": 'password', "port": 22, }, "account": { @@ -50,7 +51,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "user": { "email": "administrator@clogeny.com", @@ -59,7 +60,7 @@ class Services: "username": "User", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -83,7 +84,7 @@ class Services: "template": { "displaytext": "Public Template", "name": "Public template", - "ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2", "hypervisor": 'XenServer', "format": 'VHD', @@ -94,7 +95,7 @@ class Services: "configs": { "project.invite.timeout": 300, }, - "ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -170,10 +171,11 @@ class TestUserProjectCreation(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(configuration = "allow.user.create.projects") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_admin_project_creation(self): """Test create project as a domain admin and domain user """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Check if 'allow.user.create.projects' configuration is true # 2. Create a Project as domain admin @@ -318,11 +320,12 @@ class TestProjectCreationNegative(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(configuration = "allow.user.create.projects") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) @unittest.skip("Known bug-able to create project as a domain user") def test_user_project_creation(self): """Test create project as a domain admin and domain user """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Check if 'allow.user.create.projects' configuration is false # 2. Create a Project as domain admin. Project creation should be @@ -443,10 +446,10 @@ class TestProjectInviteRequired(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_add_user_to_project(self): """Add user to project when 'project.invite.required' is false""" - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following: # 1. Create a Project @@ -595,10 +598,11 @@ class TestProjectInviteRequiredTrue(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(configuration = "project.invite.required") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_add_user_to_project(self): """Add user to project when 'project.invite.required' is true""" - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following: # 1. Create a Project @@ -759,10 +763,11 @@ class TestProjectInviteTimeout(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(configuration = "project.invite.timeout") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_invitation_timeout(self): """Test global config project invitation timeout""" - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following: # 1. Set configuration to 5 mins @@ -884,10 +889,11 @@ class TestProjectInviteTimeout(cloudstackTestCase): ) return + @attr(configuration = "project.invite.timeout") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_02_invitation_timeout_after_expiry(self): """Test global config project invitation timeout""" - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following: # 1. Set configuration to 5 mins @@ -1014,11 +1020,11 @@ class TestProjectInviteTimeout(cloudstackTestCase): ) return + @attr(configuration = "project.invite.timeout") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_03_invite_after_expiry(self): """Test global config project invitation timeout""" - tags = ["advanced", "basic", "sg", "eip", "advancedns"] - # Validate the following: # 1. Set configuration to 5 mins # 2. Create a Project @@ -1143,11 +1149,11 @@ class TestProjectInviteTimeout(cloudstackTestCase): ) return + @attr(configuration = "project.invite.timeout") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_04_decline_invitation(self): """Test decline invitation""" - tags = ["advanced", "basic", "sg", "eip", "advancedns"] - # Validate the following: # 1. Set configuration to 5 mins # 2. Create a Project diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py index 70348ee6402..f4a99e1bba4 100644 --- a/test/integration/component/test_project_limits.py +++ b/test/integration/component/test_project_limits.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -43,7 +44,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "user": { "email": "administrator@clogeny.com", @@ -52,7 +53,7 @@ class Services: "username": "User", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -82,10 +83,10 @@ class Services: "template": { "displaytext": "Cent OS Template", "name": "Cent OS Template", - "ostypeid": '471a4b5b-5523-448f-9608-7d6218995733', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', }, - "ostypeid": '471a4b5b-5523-448f-9608-7d6218995733', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -152,10 +153,10 @@ class TestProjectLimits(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_project_limits(self): """ Test project limits """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a Project. Verify once projects are created, they inherit # a default set of resource limits as configured by the Cloud Stack @@ -299,11 +300,11 @@ class TestProjectLimits(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) @unittest.skip("No provision for updating resource limits from account through API") def test_02_project_limits_normal_user(self): """ Test project limits """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a Project # 2. Reduce the projects limits as a domain admin. Verify resource @@ -523,10 +524,10 @@ class TestResourceLimitsProject(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_03_vm_per_project(self): """Test VM limit per project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Set max VM per project to 2 # 2. Create account and start 2 VMs. Verify VM state is Up and Running @@ -585,10 +586,10 @@ class TestResourceLimitsProject(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "simulator"]) def test_04_publicip_per_project(self): """Test Public IP limit per project """ - tags = ["advanced", "eip", "advancedns"] # Validate the following # 1. set max no of IPs per project to 2. # 2. Create an account in this domain @@ -670,10 +671,10 @@ class TestResourceLimitsProject(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_05_snapshots_per_project(self): """Test Snapshot limit per project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. set max no of snapshots per project to 1. # 2. Create one snapshot in the project. Snapshot should be @@ -747,10 +748,10 @@ class TestResourceLimitsProject(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_06_volumes_per_project(self): """Test Volumes limit per project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. set max no of volume per project to 1. # 2. Create 1 VM in this project @@ -796,10 +797,10 @@ class TestResourceLimitsProject(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_07_templates_per_project(self): """Test Templates limit per project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. set max no of templates per project to 1. # 2. Create a template in this project. Both template should be in diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index cd2961661aa..86b902815dc 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -44,7 +45,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "user": { "email": "administrator@clogeny.com", @@ -53,7 +54,7 @@ class Services: "username": "User", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -83,7 +84,7 @@ class Services: "template": { "displaytext": "Cent OS Template", "name": "Cent OS Template", - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', "ispublic": False, }, @@ -126,7 +127,7 @@ class Services: "endport": 22, "cidrlist": '0.0.0.0/0', }, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -203,10 +204,10 @@ class TestOfferings(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_service_offerings(self): """ Test service offerings in a project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. List service offerings for the project. All SO available in the @@ -245,10 +246,10 @@ class TestOfferings(cloudstackTestCase): return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_02_project_disk_offerings(self): """ Test project disk offerings """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. List service offerings for the project. All disk offerings @@ -377,10 +378,10 @@ class TestNetwork(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_03_network_create(self): """ Test create network in project """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Create a project. # 2. Add virtual/direct network resource to the project. User shared @@ -581,10 +582,10 @@ class TestTemplates(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_04_public_template_use_in_project(self): """Test Templates creation in projects """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project # 2. Verify Public templates can be used without any restriction @@ -640,10 +641,10 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_05_use_private_template_in_project(self): """Test use of private template in a project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project # 2. Verify that in order to use somebody’s Private template for vm @@ -806,10 +807,11 @@ class TestSnapshots(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_06_create_snapshots_in_project(self): """Test create snapshots in project """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project # 2. Add some snapshots to the project @@ -959,10 +961,10 @@ class TestPublicIpAddress(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns"]) def test_07_associate_public_ip(self): """Test associate public IP within the project """ - tags = ["advanced", "eip", "advancedns"] # Validate the following # 1. Create a project # 2. Add some public Ips to the project @@ -1235,10 +1237,10 @@ class TestSecurityGroup(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_08_security_group(self): """Test security groups in project """ - tags = ["sg", "eip"] # Validate the following: # 1. Create a project # 2. Assign some security groups to that project diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index 2b8a94a9935..8a6d4d1439d 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -37,7 +38,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "project": { "name": "Project", @@ -71,7 +72,7 @@ class Services: "templates": { "displaytext": 'Template', "name": 'Template', - "ostypeid": '471a4b5b-5523-448f-9608-7d6218995733', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2" }, @@ -83,7 +84,7 @@ class Services: "isextractable": True, "isfeatured": True, "ispublic": True, - "ostypeid": '471a4b5b-5523-448f-9608-7d6218995733', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', }, "lbrule": { "name": "SSH", @@ -101,7 +102,7 @@ class Services: "username": "test", "password": "test", }, - "ostypeid": '471a4b5b-5523-448f-9608-7d6218995733', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -188,10 +189,10 @@ class TestVmUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_vm_usage(self): """Test Create/Destroy VM and verify usage calculation """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a VM. Verify usage_events table contains VM .create, # VM.start , Network.offering.assign , Volume.create events @@ -399,10 +400,10 @@ class TestPublicIPUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "eip", "advancedns", "simulator"]) def test_01_public_ip_usage(self): """Test Assign new IP and verify usage calculation """ - tags = ["advanced", "eip", "advancedns"] # Validate the following # 1. Acquire a IP for the network of this account. Verify usage_event # table has Acquire IP event for the IP for this account @@ -557,10 +558,10 @@ class TestVolumeUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_volume_usage(self): """Test Create/delete a volume and verify correct usage is recorded """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Volume.create event for both root and data disk is there for the # created account in cloud.usage_event table @@ -748,11 +749,11 @@ class TestTemplateUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_01_template_usage(self): """Test Upload/ delete a template and verify correct usage is generated for the template uploaded """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a account # 2. Upload a template from this account. template.create event is @@ -900,10 +901,10 @@ class TestISOUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_01_ISO_usage(self): """Test Create/Delete a ISO and verify its usage is generated correctly """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a account # 2. Upload a ISO from this account. ISO.create event is recorded in @@ -1072,10 +1073,10 @@ class TestLBRuleUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "eip", "advancedns", "simulator"]) def test_01_lb_usage(self): """Test Create/Delete a LB rule and verify correct usage is recorded """ - tags = ["advanced", "eip", "advancedns"] # Validate the following # 1. Acquire a IP for this account. lb.rule.create event is registered # for this account in cloud.usage_event table @@ -1238,11 +1239,12 @@ class TestSnapshotUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_snapshot_usage(self): """Test Create/Delete a manual snap shot and verify correct usage is recorded """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create snapshot of the root disk for this account.Snapshot.create # event is there for the created account in cloud.usage_event table @@ -1430,10 +1432,10 @@ class TestNatRuleUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_01_nat_usage(self): """Test Create/Delete a PF rule and verify correct usage is recorded """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Acquire a IP for this account # 2. Create a PF rule on the IP associated with this account. @@ -1613,10 +1615,10 @@ class TestVpnUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_01_vpn_usage(self): """Test Create/Delete a VPN and verify correct usage is recorded """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Enable VPN for this IP. vpn.add.user event is registered for this # account in cloud.usage_event table diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index e0e1b5f0bbf..d2922d5d7d1 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -40,7 +41,7 @@ class Services: "mgmt_server": { "ipaddress": '192.168.100.21', "username": 'root', - "password": 'fr3sca', + "password": 'password', "port": 22, }, "account": { @@ -50,7 +51,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "user": { "email": "administrator@clogeny.com", @@ -59,7 +60,7 @@ class Services: "username": "User", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "disk_offering": { "displaytext": "Tiny Disk Offering", @@ -88,7 +89,7 @@ class Services: "publicport": 22, "protocol": 'TCP', }, - "ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -164,11 +165,11 @@ class TestMultipleProjectCreation(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_create_multiple_projects_by_account(self): """ Verify an account can own multiple projects and can belong to multiple projects """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create multiple project. Verify at step 1 An account is allowed # to create multiple projects @@ -380,10 +381,10 @@ class TestCrossDomainAccountAdd(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_02_cross_domain_account_add(self): """ Verify No cross domain projects """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project in a domain. # 2. Add different domain account to the project. Add account should @@ -500,10 +501,10 @@ class TestDeleteAccountWithProject(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_03_delete_account_with_project(self): """ Test As long as the project exists, its owner can't be removed """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. Delete account who is owner of the project. Delete account should @@ -614,11 +615,11 @@ class TestDeleteDomainWithProject(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_04_delete_domain_with_project(self): """ Test Verify delete domain with cleanup=true should delete projects belonging to the domain """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project in a domain # 2. Delete domain forcefully. Verify that project is also deleted as @@ -759,11 +760,11 @@ class TestProjectOwners(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_05_user_project_owner_promotion(self): """ Test Verify a project user can be later promoted to become a owner """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. Add account to the project. Edit account to make it a project @@ -901,10 +902,10 @@ class TestProjectOwners(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_06_max_one_project_owner(self): """ Test Verify there can only be one owner of a project at a time """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. Add account to the project. Edit account to make it a project @@ -1191,11 +1192,11 @@ class TestProjectResources(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_07_project_resources_account_delete(self): """ Test Verify after an account is removed from the project, all his resources stay with the project. """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. Add some accounts to project. Add resources to the project @@ -1307,10 +1308,10 @@ class TestProjectResources(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_08_cleanup_after_project_delete(self): """ Test accounts are unassigned from project after project deletion """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. Add some accounts to project. Add resources to the project @@ -1521,11 +1522,11 @@ class TestProjectSuspendActivate(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_09_project_suspend(self): """ Test Verify after an account is removed from the project, all his resources stay with the project. """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a project. # 2. Add some accounts to project. Add resources to the project @@ -1658,10 +1659,10 @@ class TestProjectSuspendActivate(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_10_project_activation(self): """ Test project activation after suspension """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Activate the project # 2. Verify project is activated and we are able to add resources diff --git a/test/integration/component/test_resource_limits.py b/test/integration/component/test_resource_limits.py index c8d0df925d0..b8e3df9e269 100644 --- a/test/integration/component/test_resource_limits.py +++ b/test/integration/component/test_resource_limits.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -39,7 +40,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -69,10 +70,10 @@ class Services: "template": { "displaytext": "Cent OS Template", "name": "Cent OS Template", - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', }, - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -149,10 +150,10 @@ class TestResourceLimitsAccount(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_01_vm_per_account(self): """Test VM limit per account """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Set user_vm=1 limit for account 1. @@ -242,10 +243,10 @@ class TestResourceLimitsAccount(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_02_publicip_per_account(self): """Test Public IP limit per account """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Set Public_IP= 2 limit for account 1. @@ -385,10 +386,11 @@ class TestResourceLimitsAccount(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_03_snapshots_per_account(self): """Test Snapshot limit per account """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Set snapshot= 2 limit for account 1. @@ -541,10 +543,10 @@ class TestResourceLimitsAccount(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_04_volumes_per_account(self): """Test Volumes limit per account """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Set volumes=2 limit for account 1. @@ -683,10 +685,10 @@ class TestResourceLimitsAccount(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns"]) def test_05_templates_per_account(self): """Test Templates limit per account """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Set templates=1 limit for account 1. @@ -913,10 +915,10 @@ class TestResourceLimitsDomain(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_01_vm_per_domain(self): """Test VM limit per domain """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Set max VM per domain to 2 @@ -979,10 +981,10 @@ class TestResourceLimitsDomain(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_01_publicip_per_domain(self): """Test Public IP limit per domain """ - tags = ["advanced", "advancedns"] # Validate the following # 1. set max no of IPs per domain to 2. @@ -1049,10 +1051,11 @@ class TestResourceLimitsDomain(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_03_snapshots_per_domain(self): """Test Snapshot limit per domain """ - tags = ["advanced", "advancedns"] # Validate the following # 1. set max no of snapshots per domain to 1. @@ -1132,10 +1135,10 @@ class TestResourceLimitsDomain(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_04_volumes_per_domain(self): """Test Volumes limit per domain """ - tags = ["advanced", "advancedns"] # Validate the following # 1. set max no of volume per domain to 1. @@ -1185,10 +1188,10 @@ class TestResourceLimitsDomain(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns"]) def test_05_templates_per_domain(self): """Test Templates limit per domain """ - tags = ["advanced", "advancedns"] # Validate the following # 1. set max no of templates per domain to 2. @@ -1294,198 +1297,3 @@ class TestResourceLimitsDomain(cloudstackTestCase): ) return - -class TestResources(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - cls.api_client = super( - TestResources, - cls - ).getClsTestClient().getApiClient() - cls.services = Services().services - # Get Zone, Domain and templates - cls.zone = get_zone(cls.api_client, cls.services) - cls._cleanup = [] - return - - @classmethod - def tearDownClass(cls): - try: - #Cleanup resources used - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - return - - def setUp(self): - self.apiclient = self.testClient.getApiClient() - self.dbclient = self.testClient.getDbConnection() - self.cleanup = [] - return - - def tearDown(self): - try: - #Clean up, terminate the created instance, volumes and snapshots - cleanup_resources(self.apiclient, self.cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - return - - def test_01_zones(self): - """Check the status of zones""" - tags = ["advanced", "advancedns"] - - # Validate the following - # 1. List zones - # 2. Check allocation state is "enabled" or not - - zones = Zone.list( - self.apiclient, - id=self.zone.id, - listall=True - ) - self.assertEqual( - isinstance(zones, list), - True, - "Check if listZones returns a valid response" - ) - for zone in zones: - self.assertEqual( - zone.allocationstate, - 'Enabled', - "Zone allocation state should be enabled" - ) - return - - def test_02_pods(self): - """Check the status of pods""" - tags = ["advanced", "advancedns"] - - # Validate the following - # 1. List pods - # 2. Check allocation state is "enabled" or not - - pods = Pod.list( - self.apiclient, - zoneid=self.zone.id, - listall=True - ) - self.assertEqual( - isinstance(pods, list), - True, - "Check if listPods returns a valid response" - ) - for pod in pods: - self.assertEqual( - pod.allocationstate, - 'Enabled', - "Pods allocation state should be enabled" - ) - return - - def test_03_clusters(self): - """Check the status of clusters""" - tags = ["advanced", "advancedns"] - - # Validate the following - # 1. List clusters - # 2. Check allocation state is "enabled" or not - - clusters = Cluster.list( - self.apiclient, - zoneid=self.zone.id, - listall=True - ) - self.assertEqual( - isinstance(clusters, list), - True, - "Check if listClusters returns a valid response" - ) - for cluster in clusters: - self.assertEqual( - cluster.allocationstate, - 'Enabled', - "Clusters allocation state should be enabled" - ) - return - - def test_04_hosts(self): - """Check the status of hosts""" - tags = ["advanced", "advancedns"] - - # Validate the following - # 1. List hosts with type=Routing - # 2. Check state is "Up" or not - - hosts = Host.list( - self.apiclient, - zoneid=self.zone.id, - type='Routing', - listall=True - ) - self.assertEqual( - isinstance(hosts, list), - True, - "Check if listHosts returns a valid response" - ) - for host in hosts: - self.assertEqual( - host.state, - 'Up', - "Host should be in Up state and running" - ) - return - - def test_05_storage_pools(self): - """Check the status of Storage pools""" - tags = ["advanced", "advancedns"] - - # Validate the following - # 1. List storage pools for the zone - # 2. Check state is "enabled" or not - - storage_pools = StoragePool.list( - self.apiclient, - zoneid=self.zone.id, - listall=True - ) - self.assertEqual( - isinstance(storage_pools, list), - True, - "Check if listStoragePools returns a valid response" - ) - for storage_pool in storage_pools: - self.assertEqual( - storage_pool.state, - 'Up', - "storage pool should be in Up state and running" - ) - return - - def test_06_secondary_storage(self): - """Check the status of secondary storage""" - tags = ["advanced", "advancedns"] - - # Validate the following - # 1. List secondary storage - # 2. Check state is "Up" or not - - sec_storages = Host.list( - self.apiclient, - zoneid=self.zone.id, - type='SecondaryStorageVM', - listall=True - ) - self.assertEqual( - isinstance(sec_storages, list), - True, - "Check if listHosts returns a valid response" - ) - for sec_storage in sec_storages: - self.assertEqual( - sec_storage.state, - 'Up', - "Secondary storage should be in Up state" - ) - return diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py index 73c24ed3959..378b1f43ba7 100644 --- a/test/integration/component/test_routers.py +++ b/test/integration/component/test_routers.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -54,7 +55,7 @@ class Services: }, "host": { "username": "root", - "password": "fr3sca", + "password": "password", "publicport": 22, }, "account": { @@ -85,7 +86,7 @@ class Services: "cidr": '55.55.0.0/11', # Any network (For creating FW rule }, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Used for Get_Template : CentOS 5.3 (64 bit) "mode": 'advanced', # Networking mode: Advanced, basic } @@ -164,10 +165,10 @@ class TestRouterServices(cloudstackTestCase): self._cleanup = [] return + @attr(tags = ["advanced"]) def test_01_AdvancedZoneRouterServices(self): """Test advanced zone router services """ - tags = ["advanced"] # Validate the following: # 1. Verify that list of services provided by this network are running # a. DNS @@ -310,10 +311,11 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(configuration = "network.gc") + @attr(tags = ["advanced"]) def test_02_NetworkGarbageCollection(self): """Test network garbage collection """ - tags = ["advanced"] # Validate the following # 1. wait for router to start and guest network to be created # a.listRouters account=user, domainid=1 (router state=Running) @@ -468,10 +470,10 @@ class TestRouterServices(cloudstackTestCase): self._cleanup.append(self.vm_2) return + @attr(tags = ["advanced"]) def test_03_RouterStartOnVmDeploy(self): """Test router start on VM deploy """ - tags = ["advanced"] # Validate the following # 1. deployVirtualMachine in the account # 2. listVirtualMachines account=user, domainid=1 @@ -643,10 +645,10 @@ class TestRouterStopCreatePF(cloudstackTestCase): self._cleanup = [] return + @attr(tags = ["advanced", "advancedns"]) def test_01_RouterStopCreatePF(self): """Test router stop create port forwarding """ - tags = ["advanced"] # validate the following # 1. wait for router to start, guest network to be implemented and # VM to report Running @@ -853,10 +855,10 @@ class TestRouterStopCreateLB(cloudstackTestCase): self._cleanup = [] return + @attr(tags = ["advanced", "advancedns"]) def test_01_RouterStopCreateLB(self): """Test router stop create Load balancing """ - tags = ["advanced"] # validate the following # 1. listLoadBalancerRules (publicipid=ipaddressid of source NAT) # 2. rule should be for port 2222 as applied and @@ -1063,10 +1065,10 @@ class TestRouterStopCreateFW(cloudstackTestCase): self._cleanup = [] return + @attr(tags = ["advanced", "advancedns"]) def test_01_RouterStopCreateFW(self): """Test router stop create Firewall rule """ - tags = ["advanced"] # validate the following # 1. 1. listFirewallRules (filter by ipaddressid of sourcenat) # 2. rule should be for ports 1-600 and in state=Active diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 0b1072b03a6..16b244219c1 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -46,7 +47,7 @@ class Services: "username": "test", # Random characters are appended in create account to # ensure unique username generated each time - "password": "fr3sca", + "password": "password", }, "virtual_machine": { # Create a small virtual machine instance with disk offering @@ -63,7 +64,7 @@ class Services: "host": { "publicport": 22, "username": "root", # Host creds for SSH - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -86,7 +87,7 @@ class Services: "endport": -1, "cidrlist": '0.0.0.0/0', }, - "ostypeid": '0c2c5d19-525b-41be-a8c3-c6607412f82b', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # CentOS 5.3 (64-bit) "sleep": 60, "timeout": 10, @@ -162,11 +163,11 @@ class TestDefaultSecurityGroup(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_01_deployVM_InDefaultSecurityGroup(self): """Test deploy VM in default security group """ - tags = ["sg", "eip"] # Validate the following: # 1. deploy Virtual machine using admin user @@ -241,11 +242,11 @@ class TestDefaultSecurityGroup(cloudstackTestCase): ) return + @attr(tags = ["sg", "eip"]) def test_02_listSecurityGroups(self): """Test list security groups for admin account """ - tags = ["sg", "eip"] # Validate the following: # 1. listSecurityGroups in admin account @@ -276,11 +277,11 @@ class TestDefaultSecurityGroup(cloudstackTestCase): ) return + @attr(tags = ["sg", "eip"]) def test_03_accessInDefaultSecurityGroup(self): """Test access in default security group """ - tags = ["sg", "eip"] # Validate the following: # 1. deploy Virtual machine using admin user @@ -433,11 +434,11 @@ class TestAuthorizeIngressRule(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_01_authorizeIngressRule(self): """Test authorize ingress rule """ - tags = ["sg", "eip"] # Validate the following: #1. Create Security group for the account. @@ -569,11 +570,11 @@ class TestRevokeIngressRule(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_01_revokeIngressRule(self): """Test revoke ingress rule """ - tags = ["sg", "eip"] # Validate the following: #1. Create Security group for the account. @@ -736,11 +737,11 @@ class TestDhcpOnlyRouter(cloudstackTestCase): return + @attr(tags = ["sg", "eip", "basic"]) def test_01_dhcpOnlyRouter(self): """Test router services for user account """ - tags = ["sg", "eip", "basic"] # Validate the following #1. List routers for any user account @@ -866,10 +867,10 @@ class TestdeployVMWithUserData(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_01_deployVMWithUserData(self): """Test Deploy VM with User data""" - tags = ["sg", "eip"] # Validate the following # 1. CreateAccount of type user @@ -1042,10 +1043,10 @@ class TestDeleteSecurityGroup(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_01_delete_security_grp_running_vm(self): """Test delete security group with running VM""" - tags = ["sg", "eip"] # Validate the following # 1. createsecuritygroup (ssh-incoming) for this account @@ -1126,10 +1127,10 @@ class TestDeleteSecurityGroup(cloudstackTestCase): ) return + @attr(tags = ["sg", "eip"]) def test_02_delete_security_grp_withoout_running_vm(self): """Test delete security group without running VM""" - tags = ["sg", "eip"] # Validate the following # 1. createsecuritygroup (ssh-incoming) for this account @@ -1288,10 +1289,10 @@ class TestIngressRule(cloudstackTestCase): return + @attr(tags = ["sg", "eip"]) def test_01_authorizeIngressRule_AfterDeployVM(self): """Test delete security group with running VM""" - tags = ["sg", "eip"] # Validate the following # 1. createsecuritygroup (ssh-incoming, 22via22) for this account @@ -1400,10 +1401,10 @@ class TestIngressRule(cloudstackTestCase): % (ingress_rule_2["id"], e)) return + @attr(tags = ["sg", "eip"]) def test_02_revokeIngressRule_AfterDeployVM(self): """Test Revoke ingress rule after deploy VM""" - tags = ["sg", "eip"] # Validate the following # 1. createsecuritygroup (ssh-incoming, 22via22) for this account @@ -1554,10 +1555,10 @@ class TestIngressRule(cloudstackTestCase): % (icmp_rule["ruleid"], e)) return + @attr(tags = ["sg", "eip"]) def test_03_stopStartVM_verifyIngressAccess(self): """Test Start/Stop VM and Verify ingress rule""" - tags = ["sg", "eip"] # Validate the following # 1. createsecuritygroup (ssh-incoming, 22via22) for this account diff --git a/test/integration/component/test_security_keys_encryption.py b/test/integration/component/test_security_keys_encryption.py old mode 100755 new mode 100644 index 8538dc4b88b..4fcfe2903ed --- a/test/integration/component/test_security_keys_encryption.py +++ b/test/integration/component/test_security_keys_encryption.py @@ -1,6 +1,7 @@ """ P1 tests for Security Keys Encryption """ #Import Local Modules +from nose.plugins.attrib import attr from integration.lib.base import * from integration.lib.common import * from integration.lib.utils import * @@ -24,7 +25,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -49,7 +50,7 @@ class Services: }, "host": { "username": "root", - "password": "fr3sca", + "password": "password", }, "globalconfig": { "security.hash.key" : "test", @@ -70,7 +71,7 @@ class Services: "alert.smtp.password" : "test", "project.smtp.password" : "test", }, - "ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -155,10 +156,10 @@ class TestSecurityKeysEncryption(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic"]) def test_vm_instance_vnc_password(self): """ Verify vm_instance table's vnc_password column encryption """ - tags = ["advanced", "basic"] #Steps, #Deploy a VM @@ -182,10 +183,10 @@ class TestSecurityKeysEncryption(cloudstackTestCase): ) return + @attr(tags = ["advanced"]) def test_vpn_users_password(self): """ Verify vpn_users table's password column encryption """ - tags = ["advanced"] #Steps, #Deploy a VM @@ -233,6 +234,7 @@ class TestSecurityKeysEncryption(cloudstackTestCase): "Check password in vpn_users table to verify encryption" ) + @attr(tags = ["advanced", "basic"]) def test_user_secret_key(self): """ Verify user table's SECRET key column encryption """ #Steps, @@ -240,7 +242,6 @@ class TestSecurityKeysEncryption(cloudstackTestCase): #Validations, #Verify user table's secret key column is encrypted - tags = ["advanced", "basic"] user_keys = User.registerUserKeys(self.apiclient, self.account.account.user[0].id) qresultset = self.dbclient.execute( @@ -261,10 +262,10 @@ class TestSecurityKeysEncryption(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic"]) def test_host_password(self): """ Verify host details table's value column encryption where name is password """ - tags = ["advanced", "basic"] #Validations, #Verify host details table's value column is encrypted where name is password @@ -314,10 +315,10 @@ class TestSecurityKeysEncryption(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic"]) def test_configurations_value_encryption(self): """ verify configuration tables following name records value field are encrypted """ - tags = ["advanced", "basic"] #Steps #verify configuration tables following name records value field are encrypted diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index 8098f860315..d2675108850 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -36,7 +37,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -63,7 +64,7 @@ class Services: "mgmt_server": { "ipaddress": '192.168.100.21', "username": "root", - "password": "fr3sca", + "password": "password", "port": 22, }, "recurring_snapshot": { @@ -77,7 +78,7 @@ class Services: "templates": { "displaytext": 'Template', "name": 'Template', - "ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', }, "diskdevice": "/dev/xvda", @@ -90,7 +91,7 @@ class Services: "sub_lvl_dir2": "test2", "random_data": "random.data", - "ostypeid": '7ddbbbb5-bb09-40de-b038-ee78995788ea', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -160,10 +161,11 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns"]) def test_01_createVM_snapshotTemplate(self): """Test create VM, Snapshot and Template """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Deploy VM using default template, small service offering # and small data disk offering. @@ -473,10 +475,11 @@ class TestAccountSnapshotClean(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns"]) def test_02_accountSnapshotClean(self): """Test snapshot cleanup after account deletion """ - tags = ["advanced", "advancedns"] # Validate the following # 1. listAccounts API should list out the newly created account # 2. listVirtualMachines() command should return the deployed VM. @@ -816,10 +819,11 @@ class TestSnapshotDetachedDisk(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns"]) def test_03_snapshot_detachedDisk(self): """Test snapshot from detached disk """ - tags = ["advanced", "advancedns"] # Validate the following # 1. login in VM and write some data on data disk(use fdisk to # partition datadisk,fdisk /dev/sdb, and make filesystem using @@ -1095,10 +1099,11 @@ class TestSnapshotLimit(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns"]) def test_04_snapshot_limit(self): """Test snapshot limit in snapshot policies """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Perform hourly recurring snapshot on the root disk of VM and keep # the maxsnapshots as 1 @@ -1352,11 +1357,12 @@ class TestSnapshotEvents(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return - + + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns"]) def test_05_snapshot_events(self): """Test snapshot events """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Perform snapshot on the root disk of this VM and check the events/alerts. # 2. delete the snapshots and check the events/alerts diff --git a/test/integration/component/test_stopped_vm.py b/test/integration/component/test_stopped_vm.py index 8a4c45fa005..cf6e6c504f4 100644 --- a/test/integration/component/test_stopped_vm.py +++ b/test/integration/component/test_stopped_vm.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.remoteSSHClient import remoteSSHClient @@ -74,9 +75,9 @@ class Services: { "displaytext": "Test ISO", "name": "testISO", - "url": "http://nfs1.lab.vmops.com/isos_32bit/dsl-4.4.10.iso", + "url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso", # Source URL where ISO is located - "ostypeid": '19e6a39f-92db-4d2c-b375-33e7f42d86be', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'HTTP_DOWNLOAD', # Downloading existing ISO }, "template": { @@ -88,14 +89,14 @@ class Services: "isextractable": True, "displaytext": "Cent OS Template", "name": "Cent OS Template", - "ostypeid": '19e6a39f-92db-4d2c-b375-33e7f42d86be', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', "passwordenabled": True, }, "sleep": 60, "timeout": 10, #Migrate VM to hostid - "ostypeid": '19e6a39f-92db-4d2c-b375-33e7f42d86be', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # CentOS 5.3 (64-bit) } @@ -167,10 +168,10 @@ class TestDeployVM(cloudstackTestCase): except Exception as e: self.debug("Warning! Exception in tearDown: %s" % e) + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_01_deploy_vm_no_startvm(self): """Test Deploy Virtual Machine with no startVM parameter """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm without specifying the startvm parameter @@ -221,10 +222,10 @@ class TestDeployVM(cloudstackTestCase): self.fail("SSH to VM instance failed!") return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_02_deploy_vm_startvm_true(self): """Test Deploy Virtual Machine with startVM=true parameter """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=true @@ -276,10 +277,10 @@ class TestDeployVM(cloudstackTestCase): self.fail("SSH to VM instance failed!") return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_03_deploy_vm_startvm_false(self): """Test Deploy Virtual Machine with startVM=false parameter """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=false @@ -368,10 +369,10 @@ class TestDeployVM(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_04_deploy_startvm_false_attach_volume(self): """Test Deploy Virtual Machine with startVM=false and attach volume """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=false. Attach volume to the instance @@ -434,11 +435,11 @@ class TestDeployVM(cloudstackTestCase): self.fail("Attach volume failed!") return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_05_deploy_startvm_false_change_so(self): """Test Deploy Virtual Machine with startVM=false and change service offering """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=false. Attach volume to the instance @@ -547,11 +548,11 @@ class TestDeployVM(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_06_deploy_startvm_attach_detach(self): """Test Deploy Virtual Machine with startVM=false and attach detach volumes """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=false. Attach volume to the instance @@ -632,10 +633,10 @@ class TestDeployVM(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_07_deploy_startvm_attach_iso(self): """Test Deploy Virtual Machine with startVM=false and attach ISO """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=false. Attach volume to the instance @@ -723,11 +724,11 @@ class TestDeployVM(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_08_deploy_attach_volume(self): """Test Deploy Virtual Machine with startVM=false and attach volume already attached to different machine """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=false. Attach volume to the instance @@ -923,10 +924,10 @@ class TestDeployHaEnabledVM(cloudstackTestCase): except Exception as e: self.debug("Warning! Exception in tearDown: %s" % e) + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_01_deploy_ha_vm_startvm_false(self): """Test Deploy HA enabled Virtual Machine with startvm=false """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deployHA enabled Vm with the startvm parameter = false @@ -972,10 +973,10 @@ class TestDeployHaEnabledVM(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_02_deploy_ha_vm_from_iso(self): """Test Deploy HA enabled Virtual Machine from ISO """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deployHA enabled Vm using ISO with the startvm parameter=true @@ -1037,10 +1038,10 @@ class TestDeployHaEnabledVM(cloudstackTestCase): ) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_03_deploy_ha_vm_iso_startvm_false(self): """Test Deploy HA enabled Virtual Machine from ISO with startvm=false """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deployHA enabled Vm using ISO with the startvm parameter=false @@ -1154,10 +1155,10 @@ class TestRouterStateAfterDeploy(cloudstackTestCase): except Exception as e: self.debug("Warning! Exception in tearDown: %s" % e) + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_01_deploy_vm_no_startvm(self): """Test Deploy Virtual Machine with no startVM parameter """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. deploy Vm without specifying the startvm parameter @@ -1369,10 +1370,10 @@ class TestDeployVMBasicZone(cloudstackTestCase): except Exception as e: self.debug("Warning! Exception in tearDown: %s" % e) + @attr(tags = ["eip", "basic", "sg"]) def test_01_deploy_vm_startvm_true(self): """Test Deploy Virtual Machine with startVM=true parameter """ - tags = ["eip", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=true @@ -1427,10 +1428,10 @@ class TestDeployVMBasicZone(cloudstackTestCase): ) return + @attr(tags = ["eip", "basic", "sg"]) def test_02_deploy_vm_startvm_false(self): """Test Deploy Virtual Machine with startVM=true parameter """ - tags = ["eip", "basic", "sg"] # Validate the following: # 1. deploy Vm with the startvm=true @@ -1584,11 +1585,11 @@ class TestDeployVMFromTemplate(cloudstackTestCase): except Exception as e: self.debug("Warning! Exception in tearDown: %s" % e) + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_deploy_vm_password_enabled(self): """Test Deploy Virtual Machine with startVM=false & enabledpassword in template """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following: # 1. Create the password enabled template @@ -1722,10 +1723,10 @@ class TestVMAccountLimit(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_vm_per_account(self): """Test VM limit per account """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following # 1. Set the resource limit for VM per account. @@ -1838,10 +1839,10 @@ class TestUploadAttachVolume(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "eip", "advancedns", "basic", "sg"]) def test_upload_attach_volume(self): """Test Upload volume and attach to VM in stopped state """ - tags = ["advanced", "eip", "advancedns", "basic", "sg"] # Validate the following # 1. Upload the volume using uploadVolume API call diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index 4c96bf47ef6..dbff5ea3f40 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -40,7 +41,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -73,7 +74,7 @@ class Services: 0: { "displaytext": "Public Template", "name": "Public template", - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.vhd.bz2", "hypervisor": 'XenServer', "format": 'VHD', @@ -85,12 +86,12 @@ class Services: "template": { "displaytext": "Cent OS Template", "name": "Cent OS Template", - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', }, "templatefilter": 'self', "destzoneid": 2, # For Copy template (Destination zone) - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "sleep": 60, "timeout": 10, "mode": 'advanced', # Networking mode: Advanced, basic @@ -156,10 +157,10 @@ class TestCreateTemplate(cloudstackTestCase): return + @attr(tags = ["advanced", "advancedns"]) def test_01_create_template(self): """Test create public & private template """ - tags = ["advanced", "advancedns"] # Validate the following: # 1. Upload a templates in raw img format. Create a Vm instances from # raw img template. @@ -372,10 +373,10 @@ class TestTemplates(cloudstackTestCase): return + @attr(tags = ["advanced", "advancedns"]) def test_01_create_template_volume(self): """Test Create template from volume """ - tags = ["advanced", "advancedns"] # Validate the following: # 1. Deploy new VM using the template created from Volume @@ -412,9 +413,9 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "multizone"]) def test_02_copy_template(self): """Test for copy template from one zone to another""" - tags = ["advanced", "advancedns"] # Validate the following # 1. copy template should be successful and @@ -470,10 +471,10 @@ class TestTemplates(cloudstackTestCase): self.apiclient.deleteTemplate(cmd) return + @attr(tags = ["advanced", "advancedns"]) def test_03_delete_template(self): """Test Delete template """ - tags = ["advanced", "advancedns"] # Validate the following: # 1. Create a template and verify it is shown in list templates response @@ -525,10 +526,11 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns"]) def test_04_template_from_snapshot(self): """Create Template from snapshot """ - tags = ["advanced", "advancedns"] # Validate the following # 2. Snapshot the Root disk diff --git a/test/integration/component/test_upload_volumes.py b/test/integration/component/test_upload_volumes.py index 1a7594e1d2a..5f4713ab8ec 100644 --- a/test/integration/component/test_upload_volumes.py +++ b/test/integration/component/test_upload_volumes.py @@ -17,6 +17,7 @@ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -43,7 +44,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -89,7 +90,7 @@ class Services: "publicport": 22, }, "sleep": 50, - "ostypeid": 'e6e3dd0f-03c8-4cab-9c32-89769c17ccb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'basic', } @@ -158,11 +159,12 @@ class TestUploadDataDisk(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(speed = "slow") + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg"]) def test_01_upload_data_disk(self): """Test Upload a data disk """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. call upload volume API with following parameters HTTP URL of the @@ -211,11 +213,12 @@ class TestUploadDataDisk(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg"]) def test_02_upload_volume_limit(self): """Test upload volume limits """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. Update the volume resource limit for account to 1 @@ -316,11 +319,11 @@ class TestUploadDiskDiffFormat(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg"]) def test_upload_disk_diff_format(self): """Test Upload a data disk in different format """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. call upload volume API with following parameters HTTP URL of the @@ -449,11 +452,11 @@ class TestUploadAttachDisk(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg"]) def test_upload_attach_data_disk(self): """Test Upload and attach a data disk """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. call upload volume API with following parameters HTTP URL of the @@ -602,11 +605,11 @@ class TestUploadAttachDiskDiffFormat(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg"]) def test_upload_disk_diff_format(self): """Test Upload a data disk in different format """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. call upload volume API with following parameters HTTP URL of the @@ -757,11 +760,11 @@ class TestUploadDiskMultiStorage(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg", "multistorage"]) def test_01_upload_volume_multi_sec_storage(self): """Test Upload a data disk when multiple sec storages are present """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. Assume multiple secondary storages are present in a zone @@ -826,11 +829,11 @@ class TestUploadDiskMultiStorage(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "eip", "advancedns", "sg", "multistorage"]) def test_02_upload_volume_multi_pri_storage(self): """Test Upload a data disk when multiple primary storages are present """ - tags = ["advanced", "basic", "eip", "advancedns", "sg"] # Validate the following # 1. Assume multiple primary storages are present in a pod diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 5aea3e63c8b..7103c0f7a6c 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -37,7 +38,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -67,7 +68,7 @@ class Services: "templates": { "displaytext": 'Template', "name": 'Template', - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', "url": "http://download.cloud.com/releases/2.0.0/UbuntuServer-10-04-64bit.qcow2.bz2" }, @@ -79,7 +80,7 @@ class Services: "isextractable": True, "isfeatured": True, "ispublic": True, - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', }, "lbrule": { "name": "SSH", @@ -97,7 +98,7 @@ class Services: "username": "test", "password": "test", }, - "ostypeid": '144f66aa-7f74-4cfe-9799-80cc21439cb3', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, @@ -174,10 +175,10 @@ class TestVmUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_vm_usage(self): """Test Create/Destroy VM and verify usage calculation """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a VM. Verify usage_events table contains VM .create, # VM.start , Network.offering.assign , Volume.create events @@ -365,10 +366,10 @@ class TestPublicIPUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "eip", "advancedns", "simulator"]) def test_01_public_ip_usage(self): """Test Assign new IP and verify usage calculation """ - tags = ["advanced", "eip", "advancedns"] # Validate the following # 1. Aquire a IP for the network of this account. Verify usage_event # table has Acquire IP event for the IP for this account @@ -512,10 +513,10 @@ class TestVolumeUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_volume_usage(self): """Test Create/delete a volume and verify correct usage is recorded """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Volume.create event for both root and data disk is there for the # created account in cloud.usage_event table @@ -693,11 +694,11 @@ class TestTemplateUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_01_template_usage(self): """Test Upload/ delete a template and verify correct usage is generated for the template uploaded """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a account # 2. Upload a template from this account. template.create event is @@ -836,10 +837,10 @@ class TestISOUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns"]) def test_01_ISO_usage(self): """Test Create/Delete a ISO and verify its usage is generated correctly """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create a account # 2. Upload a ISO from this account. ISO.create event is recorded in @@ -987,10 +988,10 @@ class TestLBRuleUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "eip", "advancedns", "simulator"]) def test_01_lb_usage(self): """Test Create/Delete a LB rule and verify correct usage is recorded """ - tags = ["advanced", "eip", "advancedns"] # Validate the following # 1. Acquire a IP for this account. lb.rule.create event is registered # for this account in cloud.usage_event table @@ -1142,11 +1143,12 @@ class TestSnapshotUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "basic", "sg", "eip", "advancedns", "simulator"]) def test_01_snapshot_usage(self): """Test Create/Delete a manual snap shot and verify correct usage is recorded """ - tags = ["advanced", "basic", "sg", "eip", "advancedns"] # Validate the following # 1. Create snapshot of the root disk for this account.Snapshot.create # event is there for the created account in cloud.usage_event table @@ -1313,10 +1315,10 @@ class TestNatRuleUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "simulator"]) def test_01_nat_usage(self): """Test Create/Delete a PF rule and verify correct usage is recorded """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Acquire a IP for this account # 2. Create a PF rule on the IP associated with this account. @@ -1475,10 +1477,10 @@ class TestVpnUsage(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns"]) def test_01_vpn_usage(self): """Test Create/Delete a VPN and verify correct usage is recorded """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Enable VPN for this IP. vpn.add.user event is registered for this # account in cloud.usage_event table diff --git a/test/integration/component/test_vmware_drs.py b/test/integration/component/test_vmware_drs.py index 83c830220f3..5420083dad6 100644 --- a/test/integration/component/test_vmware_drs.py +++ b/test/integration/component/test_vmware_drs.py @@ -16,6 +16,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.remoteSSHClient import remoteSSHClient @@ -77,7 +78,7 @@ class Services: "sleep": 60, "timeout": 10, "full_host": "10.147.29.53", - "ostypeid": 'd96fc3f0-a1d3-4498-88aa-a7a1ca96c1bb', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # CentOS 5.3 (64-bit) } @@ -154,6 +155,7 @@ class TestVMPlacement(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "vmware", "multihost"]) def test_vm_creation_in_fully_automated_mode(self): """ Test VM Creation in automation mode = Fully automated This test requires following preconditions: @@ -163,7 +165,6 @@ class TestVMPlacement(cloudstackTestCase): - Another host should have some capacity remaining - DRS Cluster is configured in "Fully automated" mode """ - tags = ["advanced", "vmware", "eip", "advancedns", "basic", "sg"] # Validate the following # 1. Create a new VM in a host which is almost fully utilized # 2 Automatically places VM on the other host @@ -279,7 +280,8 @@ class TestAntiAffinityRules(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return - + + @attr(tags = ["advanced", "vmware", "multihost"]) def test_vmware_anti_affinity(self): """ Test Set up anti-affinity rules @@ -291,7 +293,6 @@ class TestAntiAffinityRules(cloudstackTestCase): - Add host names to host_1,host_2 and IDs of VM 1,2 in the settings class "anti_affinity" above. """ - tags = ["advanced", "vmware", "eip", "advancedns", "basic", "sg"] # Validate the following # 1. Deploy VMs on host 1 and 2 @@ -481,6 +482,7 @@ class TestAffinityRules(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "vmware", "multihost"]) def test_vmware_affinity(self): """ Test Set up affinity rules @@ -492,7 +494,6 @@ class TestAffinityRules(cloudstackTestCase): - Add host names to host_1,host_2 and IDs of VM 1,2 in the settings class "affinity" above. """ - tags = ["advanced", "vmware", "eip", "advancedns", "basic", "sg"] # Validate the following # 1. Deploy VMs 2 VMs on same hosts diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index 39abbf77420..679455acacc 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -15,6 +15,7 @@ """ #Import Local Modules import marvin +from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * @@ -41,7 +42,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -75,10 +76,10 @@ class Services: "name": "testISO", "url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso", # Source URL where ISO is located - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', }, "sleep": 50, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'advanced', } @@ -137,10 +138,10 @@ class TestAttachVolume(cloudstackTestCase): self.dbclient = self.testClient.getDbConnection() self.cleanup = [] + @attr(tags = ["advanced", "advancedns"]) def test_01_volume_attach(self): """Test Attach volumes (max capacity) """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Deploy a vm and create 5 data disk # 2. Attach all the created Volume to the vm. @@ -289,10 +290,10 @@ class TestAttachVolume(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns"]) def test_02_volume_attach_max(self): """Test attach volumes (more than max) to an instance """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Attach one more data volume to VM (Already 5 attached) @@ -420,10 +421,10 @@ class TestAttachDetachVolume(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) + @attr(tags = ["advanced", "advancedns"]) def test_01_volume_attach_detach(self): """Test Volume attach/detach to VM (5 data volumes) """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Deploy a vm and create 5 data disk @@ -668,10 +669,10 @@ class TestAttachVolumeISO(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns"]) def test_01_volume_iso_attach(self): """Test Volumes and ISO attach """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Create and attach 5 data volumes to VM @@ -864,10 +865,10 @@ class TestVolumes(cloudstackTestCase): cleanup_resources(self.apiclient, self.cleanup) return + @attr(tags = ["advanced", "advancedns"]) def test_01_attach_volume(self): """Attach a created Volume to a Running VM """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Create a data volume. # 2. List Volumes should not have vmname and virtualmachineid fields in @@ -948,10 +949,10 @@ class TestVolumes(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns"]) def test_02_detach_volume(self): """Detach a Volume attached to a VM """ - tags = ["advanced", "advancedns"] # Validate the following # 1. Data disk should be detached from instance @@ -996,10 +997,10 @@ class TestVolumes(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns"]) def test_03_delete_detached_volume(self): """Delete a Volume unattached to an VM """ - tags = ["advanced", "advancedns"] # Validate the following # 1. volume should be deleted successfully and listVolume should not # contain the deleted volume details. diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index f38e73ba2a7..1d26a6fe025 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -20,6 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr class Services: """Test Disk offerings Services @@ -53,6 +54,7 @@ class TestCreateDiskOffering(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"]) def test_01_create_disk_offering(self): """Test to create disk offering""" @@ -139,6 +141,7 @@ class TestDiskOfferings(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"]) def test_02_edit_disk_offering(self): """Test to update existing disk offering""" @@ -189,6 +192,7 @@ class TestDiskOfferings(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"]) def test_03_delete_disk_offering(self): """Test to delete disk offering""" diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py index 2fafb76a50b..204ffddaa5f 100644 --- a/test/integration/smoke/test_hosts.py +++ b/test/integration/smoke/test_hosts.py @@ -20,6 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr #Import System modules import time @@ -113,6 +114,7 @@ class TestHosts(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @unittest.skip("skipped - our environments will not add hosts") def test_01_clusters(self): """Test Add clusters & hosts - XEN, KVM, VWARE """ diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index e1f8dfeb4b7..16089d8945e 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -20,6 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr import urllib from random import random #Import System modules @@ -39,7 +40,7 @@ class Services: "username": "test", # Random characters are appended in create account to # ensure unique username generated each time - "password": "fr3sca", + "password": "password", }, "iso_1": { @@ -50,7 +51,7 @@ class Services: "isextractable": True, "isfeatured": True, "ispublic": True, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', }, "iso_2": { @@ -61,7 +62,7 @@ class Services: "isextractable": True, "isfeatured": True, "ispublic": True, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'HTTP_DOWNLOAD', # Used in Extract template, value must be HTTP_DOWNLOAD }, @@ -74,7 +75,7 @@ class Services: "passwordenabled": True, "sleep": 60, "timeout": 10, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # CentOS 5.3 (64 bit) "mode": 'advanced' # Networking mode: Basic or Advanced @@ -114,6 +115,7 @@ class TestCreateIso(cloudstackTestCase): return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"]) def test_01_create_iso(self): """Test create public & private ISO """ @@ -251,6 +253,7 @@ class TestISO(cloudstackTestCase): return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"]) def test_02_edit_iso(self): """Test Edit ISO """ @@ -315,6 +318,7 @@ class TestISO(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"]) def test_03_delete_iso(self): """Test delete ISO """ @@ -342,6 +346,7 @@ class TestISO(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"]) def test_04_extract_Iso(self): "Test for extract ISO" @@ -392,6 +397,7 @@ class TestISO(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"]) def test_05_iso_permissions(self): """Update & Test for ISO permissions""" @@ -443,6 +449,7 @@ class TestISO(cloudstackTestCase): ) return + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone"]) def test_06_copy_iso(self): """Test for copy ISO from one zone to another""" diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index d61bbe1d69b..3385ac60bc6 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -21,6 +21,7 @@ from marvin import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr #Import System modules import time @@ -31,7 +32,7 @@ class Services: def __init__(self): self.services = { - "ostypeid": '1a568aed-db2d-41ca-b644-416b0bdc067e', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "mode": 'advanced', # Networking mode: Basic or advanced @@ -183,6 +184,7 @@ class TestPublicIP(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_public_ip_admin_account(self): """Test for Associate/Disassociate public IP address for admin account""" @@ -233,6 +235,7 @@ class TestPublicIP(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_public_ip_user_account(self): """Test for Associate/Disassociate public IP address for user account""" @@ -343,6 +346,7 @@ class TestPortForwarding(cloudstackTestCase): cleanup_resources(self.apiclient, self.cleanup) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_01_port_fwd_on_src_nat(self): """Test for port forwarding on source NAT""" @@ -465,6 +469,7 @@ class TestPortForwarding(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_02_port_fwd_on_non_src_nat(self): """Test for port forwarding on non source NAT""" @@ -661,6 +666,7 @@ class TestLoadBalancingRule(cloudstackTestCase): cleanup_resources(cls.api_client, cls._cleanup) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_01_create_lb_rule_src_nat(self): """Test to create Load balancing rule with source NAT""" @@ -868,6 +874,7 @@ class TestLoadBalancingRule(cloudstackTestCase): ssh_1.execute("hostname")[0] return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_02_create_lb_rule_non_nat(self): """Test to create Load balancing rule with source NAT""" @@ -1138,6 +1145,7 @@ class TestRebootRouter(cloudstackTestCase): ] return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_reboot_router(self): """Test for reboot router""" @@ -1273,6 +1281,7 @@ class TestAssignRemoveLB(cloudstackTestCase): ] return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_assign_and_removal_lb(self): """Test for assign & removing load balancing rule""" @@ -1547,6 +1556,7 @@ class TestReleaseIP(cloudstackTestCase): def tearDown(self): cleanup_resources(self.apiclient, self.cleanup) + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_releaseIP(self): """Test for Associate/Disassociate public IP address""" @@ -1675,6 +1685,7 @@ class TestDeleteAccount(cloudstackTestCase): self.cleanup = [] return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_delete_account(self): """Test for delete account""" diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index efceebe3cda..2629f5a3740 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -19,6 +19,7 @@ from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * +from nose.plugins.attrib import attr from integration.lib.common import * #Import System modules @@ -80,6 +81,7 @@ class TestPrimaryStorageServices(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @unittest.skip("skipped - will not be adding storage in our environments") def test_01_primary_storage(self): """Test primary storage pools - XEN, KVM, VMWare """ diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 8b60933cfe6..2deabc295df 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -21,6 +21,7 @@ from marvin import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr #Import System modules import time @@ -56,7 +57,7 @@ class Services: "username": "testuser", "password": "password", }, - "ostypeid":'1a568aed-db2d-41ca-b644-416b0bdc067e', + "ostypeid":'01853327-513e-4508-9628-f1f55db1946f', "sleep": 60, "timeout": 10, "mode": 'advanced', #Networking mode: Basic, Advanced @@ -126,6 +127,7 @@ class TestRouterServices(cloudstackTestCase): self.apiclient = self.testClient.getApiClient() return + @attr(tags = ["advanced", "basic", "sg", "smoke"]) def test_01_router_internal_basic(self): """Test router internal basic zone """ @@ -187,6 +189,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "smoke"]) def test_02_router_internal_adv(self): """Test router internal advanced zone """ @@ -264,6 +267,7 @@ class TestRouterServices(cloudstackTestCase): self.debug("Haproxy process status: %s" % res) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_03_restart_network_cleanup(self): """Test restart network """ @@ -341,6 +345,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_04_restart_network_wo_cleanup(self): """Test restart network without cleanup """ @@ -441,6 +446,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_05_router_basic(self): """Test router basic setup """ @@ -506,6 +512,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_06_router_advanced(self): """Test router advanced setup """ @@ -588,6 +595,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_07_stop_router(self): """Test stop router """ @@ -631,6 +639,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_08_start_router(self): """Test start router """ @@ -675,6 +684,7 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_09_reboot_router(self): """Test reboot router """ @@ -727,6 +737,8 @@ class TestRouterServices(cloudstackTestCase): ) return + @attr(configuration = "network.gc") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_10_network_gc(self): """Test network GC """ diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index 0edbe7bdfe2..474e2ee35eb 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -20,6 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr #Import System modules import time @@ -81,7 +82,7 @@ class TestSecStorageServices(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return - @unittest.skip("do not add secondary storage") + @unittest.skip("skipped - do not add secondary storage") def test_01_add_sec_storage(self): """Test secondary storage """ @@ -135,6 +136,7 @@ class TestSecStorageServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"]) def test_02_sys_vm_start(self): """Test system VM start """ @@ -265,6 +267,7 @@ class TestSecStorageServices(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"]) def test_03_sys_template_ready(self): """Test system templates are ready """ diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py index bf9ccd14a6c..7f13c5c438d 100644 --- a/test/integration/smoke/test_service_offerings.py +++ b/test/integration/smoke/test_service_offerings.py @@ -20,6 +20,7 @@ from marvin.cloudstackAPI import * from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr class Services: @@ -56,7 +57,8 @@ class TestCreateServiceOffering(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return - + + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"]) def test_01_create_service_offering(self): """Test to create service offering""" @@ -162,6 +164,7 @@ class TestServiceOfferings(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"]) def test_02_edit_service_offering(self): """Test to update existing service offering""" @@ -212,6 +215,7 @@ class TestServiceOfferings(cloudstackTestCase): return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"]) def test_03_delete_service_offering(self): """Test to delete service offering""" diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index 91e65a41a0d..526f80da91b 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -21,6 +21,7 @@ from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr class Services: @@ -36,7 +37,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -89,10 +90,10 @@ class Services: { "displaytext": 'Template from snapshot', "name": 'Template from snapshot', - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "templatefilter": 'self', }, - "ostypeid": '5776c0d2-f331-42db-ba3a-29f1f8319bc9', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # Cent OS 5.3 (64 bit) "diskdevice": "/dev/xvdb", # Data Disk "rootdisk": "/dev/xvda", # Root Disk @@ -188,6 +189,8 @@ class TestSnapshotRootDisk(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_01_snapshot_root_disk(self): """Test Snapshot Root Disk """ @@ -428,6 +431,8 @@ class TestSnapshots(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_02_snapshot_data_disk(self): """Test Snapshot Data Disk """ @@ -568,6 +573,8 @@ class TestSnapshots(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_03_volume_from_snapshot(self): """Create volumes from snapshots """ @@ -749,6 +756,8 @@ class TestSnapshots(cloudstackTestCase): self.new_virtual_machine.ipaddress) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_04_delete_snapshot(self): """Test Delete Snapshot """ @@ -788,6 +797,8 @@ class TestSnapshots(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_05_recurring_snapshot_root_disk(self): """Test Recurring Snapshot Root Disk """ @@ -879,6 +890,8 @@ class TestSnapshots(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_06_recurring_snapshot_data_disk(self): """Test Recurring Snapshot data Disk """ @@ -973,6 +986,8 @@ class TestSnapshots(cloudstackTestCase): ) return + @attr(speed = "slow") + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_07_template_from_snapshot(self): """Create Template from snapshot """ diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index 0e341d5a74a..3a904edfda8 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -21,6 +21,7 @@ from marvin import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr import telnetlib #Import System modules @@ -60,6 +61,7 @@ class TestSSVMs(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_01_list_sec_storage_vm(self): """Test List secondary storage VMs """ @@ -177,6 +179,7 @@ class TestSSVMs(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_02_list_cpvm_vm(self): """Test List console proxy VMs """ @@ -288,6 +291,7 @@ class TestSSVMs(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_03_ssvm_internals(self): """Test SSVM Internals""" @@ -368,6 +372,7 @@ class TestSSVMs(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_04_cpvm_internals(self): """Test CPVM Internals""" @@ -434,6 +439,7 @@ class TestSSVMs(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_05_stop_ssvm(self): """Test stop SSVM """ @@ -509,6 +515,7 @@ class TestSSVMs(cloudstackTestCase): self.test_03_ssvm_internals() return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_06_stop_cpvm(self): """Test stop CPVM """ @@ -581,6 +588,7 @@ class TestSSVMs(cloudstackTestCase): self.test_04_cpvm_internals() return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_07_reboot_ssvm(self): """Test reboot SSVM """ @@ -666,6 +674,7 @@ class TestSSVMs(cloudstackTestCase): self.test_03_ssvm_internals() return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_08_reboot_cpvm(self): """Test reboot CPVM """ @@ -752,6 +761,7 @@ class TestSSVMs(cloudstackTestCase): self.test_04_cpvm_internals() return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_09_destroy_ssvm(self): """Test destroy SSVM """ @@ -833,6 +843,7 @@ class TestSSVMs(cloudstackTestCase): self.test_03_ssvm_internals() return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_10_destroy_cpvm(self): """Test destroy CPVM """ diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index b17b93fda19..0e462785f8a 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -21,6 +21,7 @@ from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr import urllib from random import random #Import System modules @@ -40,7 +41,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -70,12 +71,12 @@ class Services: "template_1": { "displaytext": "Cent OS Template", "name": "Cent OS Template", - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', }, "template_2": { "displaytext": "Public Template", "name": "Public template", - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "isfeatured": True, "ispublic": True, "isextractable": True, @@ -89,7 +90,7 @@ class Services: "isextractable": False, "bootable": True, "passwordenabled": True, - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'advanced', # Networking mode: Advanced, basic "sleep": 30, @@ -214,6 +215,7 @@ class TestCreateTemplate(cloudstackTestCase): return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_01_create_template(self): """Test create public & private template """ @@ -423,6 +425,7 @@ class TestTemplates(cloudstackTestCase): return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_02_edit_template(self): """Test Edit template """ @@ -505,6 +508,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_03_delete_template(self): """Test delete template """ @@ -533,6 +537,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_04_extract_template(self): "Test for extract template" @@ -583,6 +588,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_05_template_permissions(self): """Update & Test for template permissions""" @@ -635,6 +641,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multizone"]) def test_06_copy_template(self): """Test for copy template from one zone to another""" @@ -690,6 +697,7 @@ class TestTemplates(cloudstackTestCase): self.apiclient.deleteTemplate(cmd) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_07_list_public_templates(self): """Test only public templates are visible to normal user""" @@ -721,6 +729,7 @@ class TestTemplates(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_08_list_system_templates(self): """Test System templates are not visible to normal user""" diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 33824743c0f..076edcfa7cf 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -21,6 +21,7 @@ from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr #Import System modules import time @@ -102,9 +103,9 @@ class Services: { "displaytext": "Test ISO", "name": "testISO", - "url": "http://nfs1.lab.vmops.com/isos_32bit/dsl-4.4.10.iso", + "url": "http://iso.linuxquestions.org/download/504/1819/http/gd4.tuwien.ac.at/dsl-4.4.10.iso", # Source URL where ISO is located - "ostypeid": '93ffa3ea-ef02-4e56-9940-f04158353555', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'HTTP_DOWNLOAD', # Downloading existing ISO }, "template": { @@ -118,7 +119,7 @@ class Services: "sleep": 60, "timeout": 10, #Migrate VM to hostid - "ostypeid": '93ffa3ea-ef02-4e56-9940-f04158353555', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', # CentOS 5.3 (64-bit) "mode":'advanced', } @@ -165,7 +166,7 @@ class TestDeployVM(cloudstackTestCase): self.account ] - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_deploy_vm(self): """Test Deploy Virtual Machine """ @@ -314,6 +315,7 @@ class TestVMLifeCycle(cloudstackTestCase): return + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_01_stop_vm(self): """Test Stop Virtual Machine """ @@ -349,7 +351,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_02_start_vm(self): """Test Start Virtual Machine """ @@ -387,7 +389,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_03_reboot_vm(self): """Test Reboot Virtual Machine """ @@ -423,7 +425,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_04_change_offering_small(self): """Change Offering to a small capacity """ @@ -541,7 +543,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_05_change_offering_medium(self): """Change Offering to a medium capacity """ @@ -663,7 +665,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_06_destroy_vm(self): """Test destroy Virtual Machine """ @@ -699,7 +701,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_07_restore_vm(self): """Test recover Virtual Machine """ @@ -739,7 +741,7 @@ class TestVMLifeCycle(cloudstackTestCase): return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multihost"]) def test_08_migrate_vm(self): """Test migrate VM """ @@ -810,6 +812,9 @@ class TestVMLifeCycle(cloudstackTestCase): ) return + @attr(configuration = "expunge.interval") + @attr(configuration = "expunge.delay") + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_09_expunge_vm(self): """Test destroy(expunge) Virtual Machine """ @@ -857,7 +862,7 @@ class TestVMLifeCycle(cloudstackTestCase): ) return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_10_attachAndDetach_iso(self): """Test for detach ISO to virtual machine""" @@ -1099,7 +1104,7 @@ class TestVMPasswordEnabled(cloudstackTestCase): cleanup_resources(self.apiclient, self.cleanup) return - + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"]) def test_11_get_vm_password(self): """Test get VM password for password enabled template""" diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index f6b5e79db90..f8b23095336 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -21,6 +21,7 @@ from marvin.remoteSSHClient import remoteSSHClient from integration.lib.utils import * from integration.lib.base import * from integration.lib.common import * +from nose.plugins.attrib import attr #Import System modules import os import urllib @@ -41,7 +42,7 @@ class Services: "username": "test", # Random characters are appended for unique # username - "password": "fr3sca", + "password": "password", }, "service_offering": { "name": "Tiny Instance", @@ -70,7 +71,7 @@ class Services: "publicport": 22, "protocol": 'TCP', "diskdevice": "/dev/xvdb", - "ostypeid": '946b031b-0e10-4f4a-a3fc-d212ae2ea07f', + "ostypeid": '01853327-513e-4508-9628-f1f55db1946f', "mode": 'advanced', "sleep": 60, "timeout": 10, @@ -139,6 +140,7 @@ class TestCreateVolume(cloudstackTestCase): self.dbclient = self.testClient.getDbConnection() self.cleanup = [] + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_01_create_volume(self): """Test Volume creation for all Disk Offerings (incl. custom) """ @@ -331,6 +333,7 @@ class TestVolumes(cloudstackTestCase): self.apiClient = self.testClient.getApiClient() self.dbclient = self.testClient.getDbConnection() + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_02_attach_volume(self): """Attach a created Volume to a Running VM """ @@ -376,6 +379,7 @@ class TestVolumes(cloudstackTestCase): (self.virtual_machine.ipaddress, e)) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_03_download_attached_volume(self): """Download a Volume attached to a VM """ @@ -395,6 +399,7 @@ class TestVolumes(cloudstackTestCase): with self.assertRaises(Exception): self.apiClient.extractVolume(cmd) + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_04_delete_attached_volume(self): """Delete a Volume attached to a VM """ @@ -418,6 +423,7 @@ class TestVolumes(cloudstackTestCase): "Check for delete download error while volume is attached" ) + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_05_detach_volume(self): """Detach a Volume attached to a VM """ @@ -458,6 +464,7 @@ class TestVolumes(cloudstackTestCase): ) return + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_06_download_detached_volume(self): """Download a Volume unattached to an VM """ @@ -488,6 +495,7 @@ class TestVolumes(cloudstackTestCase): % (extract_vol.url, self.volume.id) ) + @attr(tags = ["advanced", "advancedns", "smoke"]) def test_07_delete_detached_volume(self): """Delete a Volume unattached to an VM """ diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index edea1c5c5ab..c18672d50b6 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -9901,23 +9901,23 @@ div.ui-dialog div.autoscaler div.scale-down-policy-title { } div.ui-dialog div.autoscaler div.scale-up-policy-title div.form-container div.form-item div.value input[type=text] { - margin-left: 195px; + margin-left: 729px; width: 30%; - margin-top: 1px; + margin-top: -17px; } div.ui-dialog div.autoscaler div.scale-up-policy-title div.form-container div.form-item div.name { - margin-left: 390px; + margin-left: 420px; } div.ui-dialog div.autoscaler div.scale-down-policy-title div.form-container div.form-item div.value input[type=text] { - margin-left: 670px; + margin-left: 698px; width: 30%; margin-top: -16px; } div.ui-dialog div.autoscaler div.scale-down-policy-title div.form-container div.form-item div.name { - margin-left: 390px; + margin-left: 420px; } div.ui-dialog div.autoscaler div.scale-up-policy div.multi-edit div.data div.data-body div.data-item { diff --git a/ui/scripts/network.js b/ui/scripts/network.js index f3c5f7359b0..d109f34fd04 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -2204,12 +2204,20 @@ data.listvirtualmachinesresponse.virtualmachine ? data.listvirtualmachinesresponse.virtualmachine : [], function(instance) { + // Hiding the AutoScale VMs + var nonAutoScale=0; + if( instance.displayname.match(/AutoScale-LB-/)==null) + nonAutoScale =1; + else { + if(instance.displayname.match(/AutoScale-LB-/).length) + nonAutoScale =0; + } var isActiveState = $.inArray(instance.state, ['Destroyed']) == -1; var notExisting = !$.grep(itemData, function(item) { return item.id == instance.id; - }).length; + }).length; - return isActiveState && notExisting; + return nonAutoScale && isActiveState && notExisting ; } ); @@ -2610,6 +2618,11 @@ success: function(data) { lbInstances = data.listloadbalancerruleinstancesresponse.loadbalancerruleinstance ? data.listloadbalancerruleinstancesresponse.loadbalancerruleinstance : []; + + $(lbInstances).each(function() { + if(this.name.indexOf('AutoScale-LB-') > -1) //autoscale VM is not allowed to be deleted manually. So, hide destroy button + this._hideActions = ['destroy']; + }); }, error: function(data) { args.response.error(parseXMLHttpResponse(data)); diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 2ee9a21e3d3..51179d37750 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -3967,7 +3967,7 @@ array1.push("&internaldns1=" + todb(args.data.internaldns1)); array1.push("&internaldns2=" + todb(args.data.internaldns2)); //internaldns2 can be empty ("") when passed to API array1.push("&domain=" + todb(args.data.domain)); - array1.push("&localstorageenabled=" + todb(args.data.localstorageenabled)); + array1.push("&localstorageenabled=" + (args.data.localstorageenabled == 'on')); $.ajax({ url: createURL("updateZone&id=" + args.context.physicalResources[0].id + array1.join("")), dataType: "json", @@ -4014,13 +4014,9 @@ }, localstorageenabled: { label: 'label.local.storage.enabled', - converter: function(args) { - if(args) - return "true"; - else - return "false"; - }, - isEditable: true + isBoolean: true, + isEditable: true, + converter:cloudStack.converters.toBooleanText } } ], diff --git a/ui/scripts/ui-custom/autoscaler.js b/ui/scripts/ui-custom/autoscaler.js index 3afc8b3414e..f44fda8c664 100644 --- a/ui/scripts/ui-custom/autoscaler.js +++ b/ui/scripts/ui-custom/autoscaler.js @@ -183,7 +183,7 @@ form: { title: '', fields: { - scaleUpDuration: { label: 'Duration', validation: { required: true } } + scaleUpDuration: { label: 'Duration(in sec)', validation: { required: true } } } } }); @@ -197,7 +197,7 @@ form: { title: '', fields: { - scaleDownDuration: { label: 'Duration', validation: { required: true } } + scaleDownDuration: { label: 'Duration(in sec)', validation: { required: true } } } } }); diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index c29673cc807..c4cdf92ef33 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -622,7 +622,11 @@ var $itemActions = $('').addClass('actions item-actions'); $.each(itemActions, function(itemActionID, itemAction) { - if (itemActionID == 'add') return true; + if (itemActionID == 'add') + return true; + + if(item._hideActions != null && $.inArray(itemActionID, item._hideActions) > -1) + return true; var $itemAction = $('
').addClass('action').addClass(itemActionID);