This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push: new 97df529 master: travis and trillian smoketests fixes and stabilisation (#3476) 97df529 is described below commit 97df52956c73bd8655c166a6e927944dcc3690ba Author: Rohit Yadav <rohit.ya...@shapeblue.com> AuthorDate: Fri Jul 12 17:27:49 2019 +0530 master: travis and trillian smoketests fixes and stabilisation (#3476) Fix failing test, add more component tests, optimise and refactor test jobs. Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com> --- .travis.yml | 141 ++-- INSTALL.md | 29 +- README.md | 2 +- .../api/command/user/project/CreateProjectCmd.java | 2 +- .../com/cloud/resource/AgentRoutingResource.java | 1 + .../java/com/cloud/api/query/QueryManagerImpl.java | 15 +- .../com/cloud/projects/ProjectManagerImpl.java | 20 +- .../component/test_acl_sharednetwork.py | 818 ++++++++++----------- .../component/test_browse_templates2.py | 0 .../component/test_concurrent_snapshots_limit.py | 0 .../component/test_deploy_vm_userdata_multi_nic.py | 0 .../component/test_deploy_vm_userdata_reg.py | 0 .../integration/component/test_dhcp_dns_offload.py | 0 test/integration/component/test_egress_fw_rules.py | 0 .../component/test_ncc_integration_dedicated.py | 0 .../component/test_ncc_integration_shared.py | 0 .../integration/component/test_ps_resize_volume.py | 0 test/integration/component/test_security_groups.py | 0 test/integration/component/test_tags.py | 123 ++-- .../test_create_list_domain_account_project.py | 1 + tools/travis/after_failure.sh | 3 +- tools/travis/script.sh | 2 +- tools/travis/xunit-reader.py | 3 +- 23 files changed, 582 insertions(+), 578 deletions(-) diff --git a/.travis.yml b/.travis.yml index c37e236..a7429fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ env: smoke/test_affinity_groups smoke/test_affinity_groups_projects smoke/test_async_job + smoke/test_create_list_domain_account_project smoke/test_deploy_vgpu_enabled_vm smoke/test_deploy_vm_iso smoke/test_deploy_vm_root_resize @@ -52,13 +53,12 @@ env: smoke/test_disk_offerings smoke/test_dynamicroles smoke/test_global_settings - smoke/test_guest_vlan_range" - - - TESTS="smoke/test_hostha_kvm - smoke/test_hostha_simulator + smoke/test_guest_vlan_range smoke/test_host_annotations smoke/test_host_maintenance - smoke/test_internal_lb + smoke/test_hostha_simulator" + + - TESTS="smoke/test_internal_lb smoke/test_iso smoke/test_list_ids_parameter smoke/test_loadbalance @@ -76,14 +76,12 @@ env: smoke/test_over_provisioning smoke/test_password_server smoke/test_portable_publicip - smoke/test_portforwardingrules" - - - TESTS="smoke/test_primary_storage" - - - TESTS="smoke/test_privategw_acl + smoke/test_portforwardingrules + smoke/test_privategw_acl smoke/test_projects - smoke/test_public_ip_range - smoke/test_pvlan + smoke/test_public_ip_range" + + - TESTS="smoke/test_pvlan smoke/test_regions smoke/test_reset_vm_on_reboot smoke/test_resource_accounting @@ -101,79 +99,80 @@ env: smoke/test_staticroles smoke/test_templates smoke/test_usage - smoke/test_usage_events - smoke/test_vm_life_cycle + smoke/test_usage_events" + + - TESTS="smoke/test_vm_life_cycle smoke/test_vm_snapshots smoke/test_volumes smoke/test_vpc_redundant smoke/test_vpc_router_nics - smoke/test_vpc_vpn" + smoke/test_vpc_vpn + smoke/test_primary_storage" - - TESTS="smoke/misc/test_deploy_vm - smoke/misc/test_escalations_templates - smoke/misc/test_vm_ha - smoke/misc/test_vm_sync - component/find_hosts_for_migration + - TESTS="component/find_hosts_for_migration + component/test_acl_isolatednetwork component/test_acl_isolatednetwork_delete - component/test_acl_listsnapshot - component/test_acl_listvm + component/test_acl_listsnapshot" + + - TESTS="component/test_acl_listvm component/test_acl_listvolume" - TESTS="component/test_acl_sharednetwork component/test_acl_sharednetwork_deployVM-impersonation" - TESTS="component/test_affinity_groups_projects - component/test_allocation_states" + component/test_allocation_states + component/test_assign_vm" - - TESTS="component/test_cpu_domain_limits + - TESTS="component/test_concurrent_snapshots_limit + component/test_cpu_domain_limits component/test_cpu_limits component/test_cpu_max_limits - component/test_cpu_project_limits" + component/test_cpu_project_limits + component/test_deploy_vm_userdata_multi_nic" - - TESTS="component/test_deploy_vm_userdata_multi_nic - component/test_egress_fw_rules + - TESTS="component/test_egress_fw_rules component/test_invalid_gw_nm - component/test_ip_reservation - component/test_lb_secondary_ip" + component/test_ip_reservation" - - TESTS="component/test_memory_limits - component/test_mm_domain_limits - component/test_mm_max_limits - component/test_mm_project_limits" + - TESTS="component/test_lb_secondary_ip + component/test_list_nics + component/test_list_pod + component/test_memory_limits" - - TESTS="component/test_network_offering - component/test_non_contiguous_vlan - component/test_persistent_networks" + - TESTS="component/test_mm_domain_limits + component/test_mm_max_limits + component/test_mm_project_limits + component/test_network_offering + component/test_non_contiguous_vlan" - - TESTS="component/test_project_limits + - TESTS="component/test_persistent_networks component/test_project_configs - component/test_project_usage + component/test_project_limits component/test_project_resources" + - TESTS="component/test_project_usage + component/test_resource_limits" + - TESTS="component/test_regions_accounts component/test_routers component/test_snapshots - component/test_stopped_vm" - - - TESTS="component/test_project_resources" - - - TESTS="component/test_project_limits - component/test_resource_limits" - - - TESTS="component/test_tags + component/test_stopped_vm + component/test_tags component/test_templates - component/test_update_vm - component/test_volumes" + component/test_updateResourceCount + component/test_update_vm" - - TESTS="component/test_vpc - component/test_vpc_network + - TESTS="component/test_volumes + component/test_vpc + component/test_vpc_distributed_routing_offering + component/test_vpc_network" + + - TESTS="component/test_vpc_network_lbrules component/test_vpc_offerings + component/test_vpc_routers component/test_vpn_users" -# FIXME: fix following tests and include them in Travis -# - TESTS="component/test_vpc" Please add when PR: https://github.com/apache/cloudstack/pull/955 CLOUDSTACK-8969 is fixed -# - TESTS="component/test_organization_states" Please add when CLOUDSTACK-7735 is fixed - before_install: travis_wait 30 ./tools/travis/before_install.sh install: ./tools/travis/install.sh before_script: travis_wait 30 ./tools/travis/before_script.sh @@ -198,25 +197,15 @@ after_script: ./tools/travis/after_script.sh after_success: true after_failure: true -jobs: - include: - - stage: package - services: docker - env: IMAGE=khos2ow/cloudstack-rpm-builder:centos7 PARAMS="--distribution centos7 --pack oss" - <<: *package_job - - - stage: package - services: docker - env: IMAGE=khos2ow/cloudstack-rpm-builder:centos6 PARAMS="--distribution centos63 --pack oss" - <<: *package_job - - - stage: package - services: docker - env: IMAGE=khos2ow/cloudstack-deb-builder:ubuntu1804 PARAMS="" - <<: *package_job - - - stage: package - services: docker - env: IMAGE=khos2ow/cloudstack-deb-builder:ubuntu1604 PARAMS="" - <<: *package_job - +#Disable due to intermittent failures +#jobs: +# include: +# - stage: package +# services: docker +# env: IMAGE=khos2ow/cloudstack-rpm-builder:centos7 PARAMS="--distribution centos7 --pack oss" +# <<: *package_job +# +# - stage: package +# services: docker +# env: IMAGE=khos2ow/cloudstack-deb-builder:ubuntu1804 PARAMS="" +# <<: *package_job diff --git a/INSTALL.md b/INSTALL.md index 281707e..85da4be 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,31 +5,32 @@ CloudStack. For more information please refer to the official [documentation](ht or the developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Home). Apache CloudStack developers use various platforms for development, this guide -was tested against a CentOS 6.5 x86_64 setup. +was tested against a CentOS 7 x86_64 setup. * [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for Apache CloudStack. * [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+CloudStack) Apache CloudStack. +* [Appliance based development](https://github.com/rhtyd/monkeybox) ## Setting up Development Environment Install tools and dependencies used for development: - $ yum install git ant ant-devel java-1.6.0-openjdk java-1.6.0-openjdk-devel + $ yum install git java-1.8.0-openjdk java-1.8.0-openjdk-devel \ mysql mysql-server mkisofs gcc python MySQL-python openssh-clients wget # yum -y update - # yum -y install java-1.7.0-openjdk - # yum -y install java-1.7.0-openjdk-devel + # yum -y install java-1.8.0-openjdk + # yum -y install java-1.8.0-openjdk-devel # yum -y install mysql-server # yum -y install git # yum -y install genisoimage -Set up Maven (3.0.5): +Set up Maven (3.6.0): - # wget http://www.us.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz - # tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /usr/local + # wget http://www.us.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz + # tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local # cd /usr/local - # ln -s apache-maven-3.0.5 maven + # ln -s apache-maven-3.6.0 maven # echo export M2_HOME=/usr/local/maven >> ~/.bashrc # or .zshrc or .profile # echo export PATH=/usr/local/maven/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile # source ~/.bashrc @@ -44,10 +45,10 @@ CloudStack is built using Java and Python. To make selection of these tools ver Following installation, execute the following commands to configure jenv and pyenv for use with CloudStack development: - # pyenv install 2.7.11 ## Install Python 2.7.11 - # pyenv virtualenv 2.7.11 cloudstack ## Create a cloudstack virtualenv using Python 2.7.11 + # pyenv install 2.7.16 ## Install Python 2.7.16 + # pyenv virtualenv 2.7.16 cloudstack ## Create a cloudstack virtualenv using Python 2.7.16 # pip install -r <root CloudStack source tree>/requirements.txt ## Install cloudstack Python dependencies - # jenv add <path to JDK 1.7 installation> ## Add Java7 to jenv + # jenv add <path to JDK 1.8 installation> ## Add Java7 to jenv *N.B.* If you are running Linux, you may need to install additional packages to allow pyenv to build Python. @@ -61,10 +62,10 @@ You may get the source code from the repository hosted on Apache: Or, you may fork the repository from the official Apache CloudStack mirror on [Github](https://github.com/apache/cloudstack) -To checkout a specific branch, for example 4.4, do: +To checkout a specific branch, for example 4.11, do: $ git fetch origin - $ git checkout -b 4.4 origin/4.4 + $ git checkout -b 4.11 origin/4.11 ## Building @@ -142,7 +143,7 @@ To create rpms, install the following extra packages: Then: - $ cd packaging/centos63 + $ cd packaging $ package.sh To create packages for noredist add the `-p noredist` option to the package script. diff --git a/README.md b/README.md index 100080e..4f250f0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Apache CloudStack [![Build Status](https://travis-ci.org/apache/cloudstack.svg?branch=master)](https://travis-ci.org/apache/cloudstack) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apachecloudstack) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=ncloc)](https://sonarcloud.io/dashboard?id=apachecloudstack) +# Apache CloudStack [![Build Status](https://travis-ci.org/apache/cloudstack.svg?branch=master)](https://travis-ci.org/apache/cloudstack) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apachecloudstack) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=apachecloudstack&metric=ncloc)](https://sonarcloud.io/dashboard?id=apachecloudstack) ![GitHub language cou [...] ![Apache CloudStack](tools/logo/apache_cloudstack.png) diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java index 79e372e..2ffa142 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java @@ -55,7 +55,7 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd { @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, validations = ApiArgValidator.NotNullOrEmpty, description = "name of the project") private String name; - @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, validations = ApiArgValidator.NotNullOrEmpty, description = "display text of the project") + @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, description = "display text of the project") private String displayText; // /////////////////////////////////////////////////// diff --git a/plugins/hypervisors/simulator/src/main/java/com/cloud/resource/AgentRoutingResource.java b/plugins/hypervisors/simulator/src/main/java/com/cloud/resource/AgentRoutingResource.java index 400ade9..2c8e731 100644 --- a/plugins/hypervisors/simulator/src/main/java/com/cloud/resource/AgentRoutingResource.java +++ b/plugins/hypervisors/simulator/src/main/java/com/cloud/resource/AgentRoutingResource.java @@ -198,6 +198,7 @@ public class AgentRoutingResource extends AgentStorageResource { cmd.setName(agentHost.getName()); cmd.setGuid(agentHost.getGuid()); cmd.setVersion(agentHost.getVersion()); + cmd.setHypervisorVersion(agentHost.getVersion()); cmd.setAgentTag("agent-simulator"); cmd.setDataCenter(String.valueOf(agentHost.getDataCenterId())); cmd.setPod(String.valueOf(agentHost.getPodId())); diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java index 018ed79..6975808 100644 --- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java @@ -181,6 +181,7 @@ import com.cloud.projects.Project; import com.cloud.projects.Project.ListProjectResourcesCriteria; import com.cloud.projects.ProjectInvitation; import com.cloud.projects.ProjectManager; +import com.cloud.projects.ProjectVO; import com.cloud.projects.dao.ProjectAccountDao; import com.cloud.projects.dao.ProjectDao; import com.cloud.resource.ResourceManager; @@ -640,10 +641,22 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q String resourceType = cmd.getResourceType(); String customerName = cmd.getCustomer(); boolean listAll = cmd.listAll(); + Long projectId = cmd.getProjectId(); + + if (projectId == null && ResourceObjectType.Project.name().equalsIgnoreCase(resourceType) && !Strings.isNullOrEmpty(resourceId)) { + try { + projectId = Long.parseLong(resourceId); + } catch (final NumberFormatException e) { + final ProjectVO project = _projectDao.findByUuidIncludingRemoved(resourceId); + if (project != null) { + projectId = project.getId(); + } + } + } Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean, ListProjectResourcesCriteria>(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, listAll, false); + _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), projectId, permittedAccounts, domainIdRecursiveListProject, listAll, false); Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); diff --git a/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java b/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java index 48d6518..fb3626b 100644 --- a/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java +++ b/server/src/main/java/com/cloud/projects/ProjectManagerImpl.java @@ -38,17 +38,12 @@ import javax.mail.URLName; import javax.mail.internet.InternetAddress; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; - -import com.sun.mail.smtp.SMTPMessage; -import com.sun.mail.smtp.SMTPSSLTransport; -import com.sun.mail.smtp.SMTPTransport; - import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.managed.context.ManagedContextRunnable; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; import com.cloud.api.ApiDBUtils; import com.cloud.api.query.dao.ProjectAccountJoinDao; @@ -90,6 +85,9 @@ import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn; import com.cloud.utils.db.TransactionStatus; import com.cloud.utils.exception.CloudRuntimeException; +import com.sun.mail.smtp.SMTPMessage; +import com.sun.mail.smtp.SMTPSSLTransport; +import com.sun.mail.smtp.SMTPTransport; @Component public class ProjectManagerImpl extends ManagerBase implements ProjectManager { @@ -207,15 +205,15 @@ public class ProjectManagerImpl extends ManagerBase implements ProjectManager { @Override public Project doInTransaction(TransactionStatus status) { - //Create an account associated with the project - StringBuilder acctNm = new StringBuilder("PrjAcct-"); + //Create an account associated with the project + StringBuilder acctNm = new StringBuilder("PrjAcct-"); acctNm.append(name).append("-").append(ownerFinal.getDomainId()); - Account projectAccount = _accountMgr.createAccount(acctNm.toString(), Account.ACCOUNT_TYPE_PROJECT, null, domainId, null, null, UUID.randomUUID().toString()); + Account projectAccount = _accountMgr.createAccount(acctNm.toString(), Account.ACCOUNT_TYPE_PROJECT, null, domainId, null, null, UUID.randomUUID().toString()); Project project = _projectDao.persist(new ProjectVO(name, displayText, ownerFinal.getDomainId(), projectAccount.getId())); - //assign owner to the project + //assign owner to the project assignAccountToProject(project, ownerFinal.getId(), ProjectAccount.Role.Admin); if (project != null) { diff --git a/test/integration/component/test_acl_sharednetwork.py b/test/integration/component/test_acl_sharednetwork.py index b74405e..25b01a7 100644 --- a/test/integration/component/test_acl_sharednetwork.py +++ b/test/integration/component/test_acl_sharednetwork.py @@ -53,20 +53,20 @@ class TestSharedNetwork(cloudstackTestCase): 4. Network with scope="account" """ - cls.testclient = super(TestSharedNetwork, cls).getClsTestClient() + cls.testclient = super(TestSharedNetwork, cls).getClsTestClient() cls.apiclient = cls.testclient.getApiClient() - cls.testdata = cls.testClient.getParsedTestDataConfig() + cls.testdata = cls.testClient.getParsedTestDataConfig() cls.acldata = cls.testdata["acl"] - cls.domain_1 = None + cls.domain_1 = None cls.domain_2 = None - cleanup = [] + cls.cleanup = [] - try: + try: # backup default apikey and secretkey cls.default_apikey = cls.apiclient.connection.apiKey cls.default_secretkey = cls.apiclient.connection.securityKey - + # Create domains cls.domain_1 = Domain.create( cls.apiclient, @@ -75,17 +75,17 @@ class TestSharedNetwork(cloudstackTestCase): cls.domain_11 = Domain.create( cls.apiclient, cls.acldata["domain11"], - parentdomainid=cls.domain_1.id + parentdomainid=cls.domain_1.id ) cls.domain_111 = Domain.create( cls.apiclient, cls.acldata["domain111"], - parentdomainid=cls.domain_11.id, + parentdomainid=cls.domain_11.id, ) cls.domain_12 = Domain.create( cls.apiclient, cls.acldata["domain12"], - parentdomainid=cls.domain_1.id + parentdomainid=cls.domain_1.id ) cls.domain_2 = Domain.create( cls.apiclient, @@ -99,7 +99,7 @@ class TestSharedNetwork(cloudstackTestCase): domainid=cls.domain_1.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d1) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d1) cls.user_d1_apikey = user.apikey cls.user_d1_secretkey = user.secretkey @@ -109,7 +109,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, domainid=cls.domain_1.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d1a) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d1a) cls.user_d1a_apikey = user.apikey cls.user_d1a_secretkey = user.secretkey @@ -121,7 +121,7 @@ class TestSharedNetwork(cloudstackTestCase): domainid=cls.domain_1.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d1b) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d1b) cls.user_d1b_apikey = user.apikey cls.user_d1b_secretkey = user.secretkey @@ -132,7 +132,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=True, domainid=cls.domain_11.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d11) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d11) cls.user_d11_apikey = user.apikey cls.user_d11_secretkey = user.secretkey @@ -142,7 +142,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, domainid=cls.domain_11.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d11a) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d11a) cls.user_d11a_apikey = user.apikey cls.user_d11a_secretkey = user.secretkey @@ -152,7 +152,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, domainid=cls.domain_11.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d11b) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d11b) cls.user_d11b_apikey = user.apikey cls.user_d11b_secretkey = user.secretkey @@ -164,7 +164,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=True, domainid=cls.domain_111.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d111) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d111) cls.user_d111_apikey = user.apikey cls.user_d111_secretkey = user.secretkey @@ -174,7 +174,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, domainid=cls.domain_111.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d111a) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d111a) cls.user_d111a_apikey = user.apikey cls.user_d111a_secretkey = user.secretkey @@ -184,7 +184,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, domainid=cls.domain_111.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d111b) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d111b) cls.user_d111b_apikey = user.apikey cls.user_d111b_secretkey = user.secretkey @@ -195,7 +195,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, domainid=cls.domain_12.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d12a) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d12a) cls.user_d12a_apikey = user.apikey cls.user_d12a_secretkey = user.secretkey @@ -206,7 +206,7 @@ class TestSharedNetwork(cloudstackTestCase): domainid=cls.domain_12.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d12b) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d12b) cls.user_d12b_apikey = user.apikey cls.user_d12b_secretkey = user.secretkey @@ -219,7 +219,7 @@ class TestSharedNetwork(cloudstackTestCase): domainid=cls.domain_2.id ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_d2a) + user = cls.generateKeysForUser(cls.apiclient,cls.account_d2a) cls.user_d2a_apikey = user.apikey cls.user_d2a_secretkey = user.secretkey @@ -232,7 +232,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=False, ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_roota) + user = cls.generateKeysForUser(cls.apiclient,cls.account_roota) cls.user_roota_apikey = user.apikey cls.user_roota_secretkey = user.secretkey @@ -242,7 +242,7 @@ class TestSharedNetwork(cloudstackTestCase): admin=True, ) - user = cls.generateKeysForUser(cls.apiclient,cls.account_root) + user = cls.generateKeysForUser(cls.apiclient,cls.account_root) cls.user_root_apikey = user.apikey cls.user_root_secretkey = user.secretkey @@ -256,22 +256,22 @@ class TestSharedNetwork(cloudstackTestCase): cls.acldata['mode'] = cls.zone.networktype cls.template = get_template(cls.apiclient, cls.zone.id, cls.acldata["ostype"]) - cls.apiclient.connection.apiKey = cls.default_apikey + cls.apiclient.connection.apiKey = cls.default_apikey cls.apiclient.connection.securityKey = cls.default_secretkey list_shared_network_offerings_response = NetworkOffering.list( cls.apiclient, name="DefaultSharedNetworkOffering", - displayText="Offering for Shared networks" + displayText="Offering for Shared networks" ) - cls.shared_network_offering_id = list_shared_network_offerings_response[0].id + cls.shared_network_offering_id = list_shared_network_offerings_response[0].id - #Override vlan parameter so that there is no overlap with vlans being used in other shared network impersonation test suite - cls.acldata["network_all"]["vlan"]="3001" - cls.acldata["network_domain_with_no_subdomain_access"]["vlan"]="3002" - cls.acldata["network_domain_with_subdomain_access"]["vlan"]="3003" - cls.acldata["network_account"]["vlan"]="3004" + #Override vlan parameter so that there is no overlap with vlans being used in other shared network impersonation test suite + cls.acldata["network_all"]["vlan"]="3001" + cls.acldata["network_domain_with_no_subdomain_access"]["vlan"]="3002" + cls.acldata["network_domain_with_subdomain_access"]["vlan"]="3003" + cls.acldata["network_account"]["vlan"]="3004" cls.shared_network_all = Network.create( cls.apiclient, @@ -305,14 +305,14 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=cls.zone.id, domainid=cls.domain_111.id, accountid=cls.account_d111a.user[0].username - ) + ) cls.vmdata = {"name": "test", "displayname" : "test" } cls.cleanup = [ cls.account_root, cls.account_roota, - cls.shared_network_all, + cls.shared_network_all, cls.service_offering, ] except Exception as e: @@ -345,15 +345,15 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_all_domainuser(self): - """ - Validate that regular user in a domain is allowed to deploy VM in a shared network created with scope="all" - """ + """ + Validate that regular user in a domain is allowed to deploy VM in a shared network created with scope="all" + """ # deploy VM as user in a domain under ROOT - self.apiclient.connection.apiKey = self.user_d1a_apikey + self.apiclient.connection.apiKey = self.user_d1a_apikey self.apiclient.connection.securityKey = self.user_d1a_secretkey - self.vmdata["name"] = self.acldata["vmD1A"]["name"] +"-shared-scope-all" - self.vmdata["displayname"] = self.acldata["vmD1A"]["displayname"] +"-shared-scope-all" + self.vmdata["name"] = self.acldata["vmD1A"]["name"] +"-shared-scope-all" + self.vmdata["displayname"] = self.acldata["vmD1A"]["displayname"] +"-shared-scope-all" vm_d1a = VirtualMachine.create( self.apiclient, @@ -361,26 +361,26 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_all.id + networkids=self.shared_network_all.id ) - self.assertEqual(vm_d1a.state == "Running", + self.assertEqual(vm_d1a.state == "Running", True, "User in a domain under ROOT failed to deploy VM in a shared network with scope=all") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_all_domainadminuser(self): - """ - Validate that regular user in "ROOT" domain is allowed to deploy VM in a shared network created with scope="all" + """ + Validate that regular user in "ROOT" domain is allowed to deploy VM in a shared network created with scope="all" - """ + """ # deploy VM as an admin user in a domain under ROOT - self.apiclient.connection.apiKey = self.user_d1_apikey + self.apiclient.connection.apiKey = self.user_d1_apikey self.apiclient.connection.securityKey = self.user_d1_secretkey - self.vmdata["name"] = self.acldata["vmD1"]["name"] +"-shared-scope-all" - self.vmdata["displayname"] = self.acldata["vmD1"]["displayname"] +"-shared-scope-all" + self.vmdata["name"] = self.acldata["vmD1"]["name"] +"-shared-scope-all" + self.vmdata["displayname"] = self.acldata["vmD1"]["displayname"] +"-shared-scope-all" vm = VirtualMachine.create( self.apiclient, @@ -388,111 +388,111 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_all.id + networkids=self.shared_network_all.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "Admin User in a domain under ROOT failed to deploy VM in a shared network with scope=all") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_all_subdomainuser(self): - """ - Validate that regular user in any subdomain is allowed to deploy VM in a shared network created with scope="all" - """ + """ + Validate that regular user in any subdomain is allowed to deploy VM in a shared network created with scope="all" + """ # deploy VM as user in a subdomain under ROOT - self.apiclient.connection.apiKey = self.user_d11a_apikey + self.apiclient.connection.apiKey = self.user_d11a_apikey self.apiclient.connection.securityKey = self.user_d11a_secretkey - self.vmdata["name"] = self.acldata["vmD11A"]["name"] +"-shared-scope-all" - self.vmdata["displayname"] = self.acldata["vmD11A"]["displayname"] +"-shared-scope-all" + self.vmdata["name"] = self.acldata["vmD11A"]["name"] +"-shared-scope-all" + self.vmdata["displayname"] = self.acldata["vmD11A"]["displayname"] +"-shared-scope-all" vm_d11a = VirtualMachine.create( self.apiclient, self.vmdata, zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_all.id + networkids=self.shared_network_all.id ) - self.assertEqual(vm_d11a.state == "Running", + self.assertEqual(vm_d11a.state == "Running", True, "User in a domain under ROOT failed to deploy VM in a shared network with scope=all") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_all_subdomainadminuser(self): - """ - Validate that regular user in a subdomain under ROOT is allowed to deploy VM in a shared network created with scope="all" + """ + Validate that regular user in a subdomain under ROOT is allowed to deploy VM in a shared network created with scope="all" - """ + """ # deploy VM as an admin user in a subdomain under ROOT - self.apiclient.connection.apiKey = self.user_d11_apikey + self.apiclient.connection.apiKey = self.user_d11_apikey self.apiclient.connection.securityKey = self.user_d11_secretkey - self.vmdata["name"] = self.acldata["vmD11"]["name"] +"-shared-scope-all" - self.vmdata["displayname"] = self.acldata["vmD11"]["displayname"] +"-shared-scope-all" + self.vmdata["name"] = self.acldata["vmD11"]["name"] +"-shared-scope-all" + self.vmdata["displayname"] = self.acldata["vmD11"]["displayname"] +"-shared-scope-all" vm = VirtualMachine.create( self.apiclient, self.vmdata, zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_all.id + networkids=self.shared_network_all.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "Admin User in a domain under ROOT failed to deploy VM in a shared network with scope=all") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_all_ROOTuser(self): - """ - Validate that regular user in ROOT domain is allowed to deploy VM in a shared network created with scope="all" + """ + Validate that regular user in ROOT domain is allowed to deploy VM in a shared network created with scope="all" - """ + """ # deploy VM as user in ROOT domain - - self.apiclient.connection.apiKey = self.user_roota_apikey + + self.apiclient.connection.apiKey = self.user_roota_apikey self.apiclient.connection.securityKey = self.user_roota_secretkey - self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-all" - self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-all" + self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-all" + self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-all" vm = VirtualMachine.create( self.apiclient, self.vmdata, zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_all.id + networkids=self.shared_network_all.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "User in ROOT domain failed to deploy VM in a shared network with scope=all") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_all_ROOTadmin(self): - """ - Validate that admin user in ROOT domain is allowed to deploy VM in a shared network created with scope="all" - """ + """ + Validate that admin user in ROOT domain is allowed to deploy VM in a shared network created with scope="all" + """ # deploy VM as admin user in ROOT domain - - self.apiclient.connection.apiKey = self.user_root_apikey + + self.apiclient.connection.apiKey = self.user_root_apikey self.apiclient.connection.securityKey = self.user_root_secretkey - self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-all" - self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-all" + self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-all" + self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-all" vm = VirtualMachine.create( self.apiclient, self.vmdata, zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_all.id + networkids=self.shared_network_all.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "Admin in ROOT domain failed to deploy VM in a shared network with scope=all") @@ -500,16 +500,16 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_domainuser(self): - """ - Validate that regular user in a domain is allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ + Validate that regular user in a domain is allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ # deploy VM as user in a domain that has shared network with no subdomain access - - self.apiclient.connection.apiKey = self.user_d11a_apikey + + self.apiclient.connection.apiKey = self.user_d11a_apikey self.apiclient.connection.securityKey = self.user_d11a_secretkey - self.vmdata["name"] = self.acldata["vmD11A"]["name"] +"-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD11A"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["name"] = self.acldata["vmD11A"]["name"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD11A"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" vm = VirtualMachine.create( self.apiclient, @@ -517,26 +517,26 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_domain_d11.id + networkids=self.shared_network_domain_d11.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "User in a domain that has a shared network with no subdomain access failed to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_domainadminuser(self): - """ - Validate that admin user in a domain is allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ + Validate that admin user in a domain is allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ #deploy VM as an admin user in a domain that has shared network with no subdomain access - - self.apiclient.connection.apiKey = self.user_d11_apikey + + self.apiclient.connection.apiKey = self.user_d11_apikey self.apiclient.connection.securityKey = self.user_d11_secretkey - self.vmdata["name"] = self.acldata["vmD11"]["name"] +"-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD11"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["name"] = self.acldata["vmD11"]["name"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD11"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" vm = VirtualMachine.create( self.apiclient, @@ -544,64 +544,64 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_domain_d11.id + networkids=self.shared_network_domain_d11.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "Admin User in a domain that has a shared network with no subdomain access failed to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_subdomainuser(self): - """ - Validate that regular user in a subdomain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ + Validate that regular user in a subdomain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ # deploy VM as user in a subdomain under a domain that has shared network with no subdomain access - - self.apiclient.connection.apiKey = self.user_d111a_apikey + + self.apiclient.connection.apiKey = self.user_d111a_apikey self.apiclient.connection.securityKey = self.user_d111a_secretkey - self.vmdata["name"] = self.acldata["vmD111A"]["name"] +"-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111A"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_d11.id - ) - self.fail("Subdomain user is able to deploy VM in a shared network with scope=domain with no subdomain access ") - except Exception as e: - self.debug ("When a user from a subdomain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) - if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): + self.vmdata["name"] = self.acldata["vmD111A"]["name"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111A"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_d11.id + ) + self.fail("Subdomain user is able to deploy VM in a shared network with scope=domain with no subdomain access ") + except Exception as e: + self.debug ("When a user from a subdomain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) + if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when Subdomain user tries to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_subdomainadminuser(self): - """ - Validate that admin user in a subdomain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ + Validate that admin user in a subdomain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ # deploy VM as an admin user in a subdomain under a domain that has shared network with no subdomain access - - self.apiclient.connection.apiKey = self.user_d111_apikey + + self.apiclient.connection.apiKey = self.user_d111_apikey self.apiclient.connection.securityKey = self.user_d111_secretkey - self.vmdata["name"] = self.acldata["vmD111"]["name"] +"-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_d11.id - ) - self.fail("Subdomain admin user is able to deploy VM in a shared network with scope=domain with no subdomain access ") - except Exception as e: - self.debug ("When a admin user from a subdomain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) + self.vmdata["name"] = self.acldata["vmD111"]["name"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_d11.id + ) + self.fail("Subdomain admin user is able to deploy VM in a shared network with scope=domain with no subdomain access ") + except Exception as e: + self.debug ("When a admin user from a subdomain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when Subdomain admin user tries to deploy VM in a shared network with scope=domain with no subdomain access") @@ -609,56 +609,56 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_parentdomainuser(self): - """ - Validate that user in the parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ + Validate that user in the parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ # deploy VM as user in parentdomain of a domain that has shared network with no subdomain access - - self.apiclient.connection.apiKey = self.user_d1a_apikey + + self.apiclient.connection.apiKey = self.user_d1a_apikey self.apiclient.connection.securityKey = self.user_d1a_secretkey - self.vmdata["name"] = self.acldata["vmD1A"]["name"] +"-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD1A"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["name"] = self.acldata["vmD1A"]["name"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD1A"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_d11.id - ) - self.fail("Parent domain user is able to deploy VM in a shared network with scope=domain with no subdomain access ") - except Exception as e: - self.debug ("When a user from parent domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) - if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_d11.id + ) + self.fail("Parent domain user is able to deploy VM in a shared network with scope=domain with no subdomain access ") + except Exception as e: + self.debug ("When a user from parent domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) + if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when Parent domain user tries to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_parentdomainadminuser(self): - """ - Validate that admin user in the parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ + Validate that admin user in the parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ # deploy VM as an admin user in parentdomain of a domain that has shared network with no subdomain access - - self.apiclient.connection.apiKey = self.user_d1_apikey + + self.apiclient.connection.apiKey = self.user_d1_apikey self.apiclient.connection.securityKey = self.user_d1_secretkey - self.vmdata["name"] = self.acldata["vmD1"]["name"] +"-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD1"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["name"] = self.acldata["vmD1"]["name"] +"-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD1"]["displayname"] +"-shared-scope-domain-nosubdomainaccess" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_d11.id - ) - self.fail("Parent domain's admin user is able to deploy VM in a shared network with scope=domain with no subdomain access ") - except Exception as e: - self.debug ("When an admin user from parent domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_d11.id + ) + self.fail("Parent domain's admin user is able to deploy VM in a shared network with scope=domain with no subdomain access ") + except Exception as e: + self.debug ("When an admin user from parent domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when Parent domain's admin user tries to deploy VM in a shared network with scope=domain with no subdomain access") @@ -666,28 +666,28 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_ROOTuser(self): - """ - Validate that user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ + Validate that user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ # deploy VM as user in ROOT domain - - self.apiclient.connection.apiKey = self.user_roota_apikey + + self.apiclient.connection.apiKey = self.user_roota_apikey self.apiclient.connection.securityKey = self.user_roota_secretkey - self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-domain-nosubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_d11.id - ) - self.fail("ROOT domain's user is able to deploy VM in a shared network with scope=domain with no subdomain access ") - except Exception as e: - self.debug ("When a regular user from ROOT domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) + self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-domain-nosubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_d11.id + ) + self.fail("ROOT domain's user is able to deploy VM in a shared network with scope=domain with no subdomain access ") + except Exception as e: + self.debug ("When a regular user from ROOT domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when ROOT domain's user tries to deploy VM in a shared network with scope=domain with no subdomain access") @@ -695,28 +695,28 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_nosubdomainaccess_ROOTadmin(self): - """ - Validate that admin in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access + """ + Validate that admin in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and no subdomain access - """ + """ # deploy VM as admin user in ROOT domain - - self.apiclient.connection.apiKey = self.user_root_apikey + + self.apiclient.connection.apiKey = self.user_root_apikey self.apiclient.connection.securityKey = self.user_root_secretkey - self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-domain-nosubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-domain-nosubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_d11.id + self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-domain-nosubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-domain-nosubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_d11.id ) - self.fail("ROOT domain's admin user is able to deploy VM in a shared network with scope=domain with no subdomain access ") - except Exception as e: - self.debug ("When a admin user from ROOT domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) + self.fail("ROOT domain's admin user is able to deploy VM in a shared network with scope=domain with no subdomain access ") + except Exception as e: + self.debug ("When a admin user from ROOT domain deploys a VM in a shared network with scope=domain with no subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when ROOT domain's admin user tries to deploy VM in a shared network with scope=domain with no subdomain access") @@ -726,16 +726,16 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_domainuser(self): - """ - Validate that regular user in a domain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the domain + """ + Validate that regular user in a domain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the domain - """ + """ # deploy VM as user in a domain that has shared network with subdomain access - - self.apiclient.connection.apiKey = self.user_d11a_apikey + + self.apiclient.connection.apiKey = self.user_d11a_apikey self.apiclient.connection.securityKey = self.user_d11a_secretkey - self.vmdata["name"] = self.acldata["vmD11A"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD11A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmD11A"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD11A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" vm = VirtualMachine.create( self.apiclient, @@ -743,26 +743,26 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id + networkids=self.shared_network_domain_with_subdomain_d11.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "User in a domain that has a shared network with subdomain access failed to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_domainadminuser(self): - """ - Validate that admin user in a domain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the domain - """ + """ + Validate that admin user in a domain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the domain + """ # deploy VM as an admin user in a domain that has shared network with subdomain access - - self.apiclient.connection.apiKey = self.user_d11_apikey + + self.apiclient.connection.apiKey = self.user_d11_apikey self.apiclient.connection.securityKey = self.user_d11_secretkey - self.vmdata["name"] = self.acldata["vmD11"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD11"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmD11"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD11"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" vm = VirtualMachine.create( self.apiclient, @@ -770,113 +770,113 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id + networkids=self.shared_network_domain_with_subdomain_d11.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "Admin User in a domain that has a shared network with subdomain access failed to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_subdomainuser(self): - """ - Validate that regular user in a subdomain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the parent domain - """ + """ + Validate that regular user in a subdomain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the parent domain + """ # deploy VM as user in a subdomain under a domain that has shared network with subdomain access - - self.apiclient.connection.apiKey = self.user_d111a_apikey + + self.apiclient.connection.apiKey = self.user_d111a_apikey self.apiclient.connection.securityKey = self.user_d111a_secretkey - self.vmdata["name"] = self.acldata["vmD111A"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmD111A"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" vm = VirtualMachine.create( self.apiclient, self.vmdata, zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id + networkids=self.shared_network_domain_with_subdomain_d11.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "User in a subdomain that has a shared network with subdomain access failed to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_subdomainadminuser(self): - """ - Validate that an admin user in a subdomain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the parent domain - """ + """ + Validate that an admin user in a subdomain is allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the parent domain + """ # deploy VM as an admin user in a subdomain under a domain that has shared network with subdomain access - - self.apiclient.connection.apiKey = self.user_d111_apikey + + self.apiclient.connection.apiKey = self.user_d111_apikey self.apiclient.connection.securityKey = self.user_d111_secretkey - self.vmdata["name"] = self.acldata["vmD111"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmD111"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" vm = VirtualMachine.create( self.apiclient, self.vmdata, zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id + networkids=self.shared_network_domain_with_subdomain_d11.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "Admin User in a subdomain that has a shared network with subdomain access failed to deploy VM in a shared network with scope=domain with no subdomain access") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_parentdomainuser(self): - """ - Validate that regular user in a parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the domain - """ + """ + Validate that regular user in a parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for the domain + """ # deploy VM as user in parentdomain of a domain that has shared network with subdomain access - - self.apiclient.connection.apiKey = self.user_d1a_apikey + + self.apiclient.connection.apiKey = self.user_d1a_apikey self.apiclient.connection.securityKey = self.user_d1a_secretkey - self.vmdata["name"] = self.acldata["vmD1A"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD1A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id - ) - self.fail("Parent domain's user is able to deploy VM in a shared network with scope=domain with subdomain access ") - except Exception as e: - self.debug ("When a user from parent domain deploys a VM in a shared network with scope=domain with subdomain access %s" %e) + self.vmdata["name"] = self.acldata["vmD1A"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD1A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_with_subdomain_d11.id + ) + self.fail("Parent domain's user is able to deploy VM in a shared network with scope=domain with subdomain access ") + except Exception as e: + self.debug ("When a user from parent domain deploys a VM in a shared network with scope=domain with subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): self.fail("Error message validation failed when Parent domain's user tries to deploy VM in a shared network with scope=domain with subdomain access ") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_parentdomainadminuser(self): - """ - Validate that admin user in a parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for any domain - """ + """ + Validate that admin user in a parent domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for any domain + """ # deploy VM as an admin user in parentdomain of a domain that has shared network with subdomain access - - self.apiclient.connection.apiKey = self.user_d1_apikey + + self.apiclient.connection.apiKey = self.user_d1_apikey self.apiclient.connection.securityKey = self.user_d1_secretkey - self.vmdata["name"] = self.acldata["vmD1"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD1"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmD1"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD1"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id - ) - self.fail("Parent domain's admin user is able to deploy VM in a shared network with scope=domain with subdomain access ") + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_with_subdomain_d11.id + ) + self.fail("Parent domain's admin user is able to deploy VM in a shared network with scope=domain with subdomain access ") except Exception as e: self.debug ("When an admin user from parent domain deploys a VM in a shared network with scope=domain with subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): @@ -886,26 +886,26 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_ROOTuser(self): - """ - Validate that regular user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for any domain - """ + """ + Validate that regular user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for any domain + """ # deploy VM as user in ROOT domain - - self.apiclient.connection.apiKey = self.user_roota_apikey + + self.apiclient.connection.apiKey = self.user_roota_apikey self.apiclient.connection.securityKey = self.user_roota_secretkey - self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-domain-withsubdomainaccess" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id - ) - self.fail("ROOT domain's user is able to deploy VM in a shared network with scope=domain with subdomain access ") + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_with_subdomain_d11.id + ) + self.fail("ROOT domain's user is able to deploy VM in a shared network with scope=domain with subdomain access ") except Exception as e: self.debug ("When a user from ROOT domain deploys a VM in a shared network with scope=domain with subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): @@ -914,26 +914,26 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_domain_withsubdomainaccess_ROOTadmin(self): - """ - Validate that admin user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for any domain - """ + """ + Validate that admin user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="domain" and with subdomain access for any domain + """ # deploy VM as admin user in ROOT domain - - self.apiclient.connection.apiKey = self.user_root_apikey + + self.apiclient.connection.apiKey = self.user_root_apikey self.apiclient.connection.securityKey = self.user_root_secretkey - self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-domain-withsubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_domain_with_subdomain_d11.id - ) - self.fail("ROOT domain's admin user is able to deploy VM in a shared network with scope=domain with subdomain access ") + self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-domain-withsubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_domain_with_subdomain_d11.id + ) + self.fail("ROOT domain's admin user is able to deploy VM in a shared network with scope=domain with subdomain access ") except Exception as e: self.debug ("When an admin user from ROOT domain deploys a VM in a shared network with scope=domain with subdomain access %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.NOT_AVAILABLE_IN_DOMAIN): @@ -945,26 +945,26 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_account_domainuser(self): - """ - Validate that any other user in same domain is NOT allowed to deploy VM in a shared network created with scope="account" for an account - """ + """ + Validate that any other user in same domain is NOT allowed to deploy VM in a shared network created with scope="account" for an account + """ # deploy VM as user under the same domain but belonging to a different account from the acount that has a shared network with scope=account - - self.apiclient.connection.apiKey = self.user_d111b_apikey + + self.apiclient.connection.apiKey = self.user_d111b_apikey self.apiclient.connection.securityKey = self.user_d111b_secretkey - self.vmdata["name"] = self.acldata["vmD111B"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111B"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_account_d111a.id - ) - self.fail("User from same domain but different account is able to deploy VM in a shared network with scope=account") + self.vmdata["name"] = self.acldata["vmD111B"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111B"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_account_d111a.id + ) + self.fail("User from same domain but different account is able to deploy VM in a shared network with scope=account") except Exception as e: self.debug ("When a user from same domain but different account deploys a VM in a shared network with scope=account %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.UNABLE_TO_USE_NETWORK): @@ -974,26 +974,26 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_account_domainadminuser(self): - """ - Validate that an admin user under the same domain but belonging to a different account is allowed to deploy VM in a shared network created with scope="account" for an account + """ + Validate that an admin user under the same domain but belonging to a different account is allowed to deploy VM in a shared network created with scope="account" for an account - """ + """ # deploy VM as admin user for a domain that has an account with shared network with scope=account - - self.apiclient.connection.apiKey = self.user_d111_apikey + + self.apiclient.connection.apiKey = self.user_d111_apikey self.apiclient.connection.securityKey = self.user_d111_secretkey - self.vmdata["name"] = self.acldata["vmD111"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" - try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_account_d111a.id - ) - self.fail("User from same domain but different account is able to deploy VM in a shared network with scope=account") + self.vmdata["name"] = self.acldata["vmD111"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + try: + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_account_d111a.id + ) + self.fail("User from same domain but different account is able to deploy VM in a shared network with scope=account") except Exception as e: self.debug ("When a user from same domain but different account deploys a VM in a shared network with scope=account %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.UNABLE_TO_USE_NETWORK): @@ -1002,16 +1002,16 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_account_user(self): - """ - Validate that regular user in the account is allowed to deploy VM in a shared network created with scope="account" for an account - """ + """ + Validate that regular user in the account is allowed to deploy VM in a shared network created with scope="account" for an account + """ # deploy VM as account with shared network with scope=account - - self.apiclient.connection.apiKey = self.user_d111a_apikey + + self.apiclient.connection.apiKey = self.user_d111a_apikey self.apiclient.connection.securityKey = self.user_d111a_secretkey - self.vmdata["name"] = self.acldata["vmD111A"]["name"] +"-shared-scope-domain-withsubdomainaccess" - self.vmdata["displayname"] = self.acldata["vmD111A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["name"] = self.acldata["vmD111A"]["name"] +"-shared-scope-domain-withsubdomainaccess" + self.vmdata["displayname"] = self.acldata["vmD111A"]["displayname"] +"-shared-scope-domain-withsubdomainaccess" vm = VirtualMachine.create( self.apiclient, @@ -1019,35 +1019,35 @@ class TestSharedNetwork(cloudstackTestCase): zoneid=self.zone.id, serviceofferingid=self.service_offering.id, templateid=self.template.id, - networkids=self.shared_network_account_d111a.id + networkids=self.shared_network_account_d111a.id ) - self.assertEqual(vm.state == "Running", + self.assertEqual(vm.state == "Running", True, "User in the account that has a shared network with scope=account failed to deploy a VM in this shared network") @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_account_differentdomain(self): - """ - Validate that regular user from a domain different from that of the account is NOT allowed to deploy VM in a shared network created with scope="account" for an account - """ + """ + Validate that regular user from a domain different from that of the account is NOT allowed to deploy VM in a shared network created with scope="account" for an account + """ # deploy VM as a user in a subdomain under ROOT - - self.apiclient.connection.apiKey = self.user_d2a_apikey + + self.apiclient.connection.apiKey = self.user_d2a_apikey self.apiclient.connection.securityKey = self.user_d2a_secretkey - self.vmdata["name"] = self.acldata["vmD2A"]["name"] +"-shared-scope-account" - self.vmdata["displayname"] = self.acldata["vmD2A"]["displayname"] +"-shared-scope-account" + self.vmdata["name"] = self.acldata["vmD2A"]["name"] +"-shared-scope-account" + self.vmdata["displayname"] = self.acldata["vmD2A"]["displayname"] +"-shared-scope-account" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_account_d111a.id - ) - self.fail("User from different domain is able to deploy VM in a shared network with scope=account ") + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_account_d111a.id + ) + self.fail("User from different domain is able to deploy VM in a shared network with scope=account ") except Exception as e: self.debug ("When a user from different domain deploys a VM in a shared network with scope=account %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.UNABLE_TO_USE_NETWORK): @@ -1057,26 +1057,26 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_account_ROOTuser(self): - """ - Validate that user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="account" for an account + """ + Validate that user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="account" for an account - """ + """ # deploy VM as user in ROOT domain - - self.apiclient.connection.apiKey = self.user_roota_apikey + + self.apiclient.connection.apiKey = self.user_roota_apikey self.apiclient.connection.securityKey = self.user_roota_secretkey - self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-account" - self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-account" + self.vmdata["name"] = self.acldata["vmROOTA"]["name"] + "-shared-scope-account" + self.vmdata["displayname"] = self.acldata["vmROOTA"]["displayname"] + "-shared-scope-account" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_account_d111a.id - ) - self.fail("ROOT domain's user is able to deploy VM in a shared network with scope=account ") + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_account_d111a.id + ) + self.fail("ROOT domain's user is able to deploy VM in a shared network with scope=account ") except Exception as e: self.debug ("When a user from ROOT domain deploys a VM in a shared network with scope=account %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.UNABLE_TO_USE_NETWORK): @@ -1085,26 +1085,26 @@ class TestSharedNetwork(cloudstackTestCase): @attr("simulator_only",tags=["advanced"],required_hardware="false") def test_deployVM_in_sharedNetwork_scope_account_ROOTadmin(self): - """ - Validate that admin user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="account" for an account - """ + """ + Validate that admin user in ROOT domain is NOT allowed to deploy VM in a shared network created with scope="account" for an account + """ # deploy VM as admin user in ROOT domain - - self.apiclient.connection.apiKey = self.user_root_apikey + + self.apiclient.connection.apiKey = self.user_root_apikey self.apiclient.connection.securityKey = self.user_root_secretkey - self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-account" - self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-account" + self.vmdata["name"] = self.acldata["vmROOT"]["name"] + "-shared-scope-account" + self.vmdata["displayname"] = self.acldata["vmROOT"]["displayname"] + "-shared-scope-account" try: - vm = VirtualMachine.create( - self.apiclient, - self.vmdata, - zoneid=self.zone.id, - serviceofferingid=self.service_offering.id, - templateid=self.template.id, - networkids=self.shared_network_account_d111a.id - ) - self.fail("ROOT domain's admin user is able to deploy VM in a shared network with scope=account ") + vm = VirtualMachine.create( + self.apiclient, + self.vmdata, + zoneid=self.zone.id, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + networkids=self.shared_network_account_d111a.id + ) + self.fail("ROOT domain's admin user is able to deploy VM in a shared network with scope=account ") except Exception as e: self.debug ("When an admin user from ROOT domain deploys a VM in a shared network with scope=account %s" %e) if not CloudstackAclException.verifyMsginException(e,CloudstackAclException.UNABLE_TO_USE_NETWORK): diff --git a/test/integration/component/test_browse_templates2.py b/test/integration/component/test_browse_templates2.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_concurrent_snapshots_limit.py b/test/integration/component/test_concurrent_snapshots_limit.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_deploy_vm_userdata_multi_nic.py b/test/integration/component/test_deploy_vm_userdata_multi_nic.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_deploy_vm_userdata_reg.py b/test/integration/component/test_deploy_vm_userdata_reg.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_dhcp_dns_offload.py b/test/integration/component/test_dhcp_dns_offload.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_ncc_integration_dedicated.py b/test/integration/component/test_ncc_integration_dedicated.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_ncc_integration_shared.py b/test/integration/component/test_ncc_integration_shared.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_ps_resize_volume.py b/test/integration/component/test_ps_resize_volume.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py old mode 100755 new mode 100644 diff --git a/test/integration/component/test_tags.py b/test/integration/component/test_tags.py index 9180e7b..dcf82c1 100644 --- a/test/integration/component/test_tags.py +++ b/test/integration/component/test_tags.py @@ -878,14 +878,14 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on VM using createTags API # 2. Delete above created tag using deleteTags API - tag_key = 'scope' + tag_key = 'scope5' tag_value = 'test_05_vm_tag' self.debug("Creating a tag for user VM") tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -893,7 +893,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -927,7 +927,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -937,7 +937,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -1163,7 +1163,7 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on volume using createTags API # 2. Delete above created tag using deleteTags API - tag_key = 'scope' + tag_key = 'scope8' tag_value = 'test_08_volume_tag' if self.hypervisor.lower() == 'lxc': @@ -1364,7 +1364,7 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on Network using createTags API # 2. Delete above created tag using deleteTags API - tag_key = 'scope' + tag_key = 'scope10' tag_value = 'test_10_network_tag' self.debug("Fetching the network details for account: %s" % @@ -1463,7 +1463,7 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on VM using createTags API # 2. Delete above created tag using deleteTags API - tag_key = 'scope' + tag_key = 'scope11' tag_value = 'test_11_migrate_tagged_vm_del' if self.hypervisor.lower() in ['lxc']: @@ -1509,7 +1509,7 @@ class TestResourceTags(cloudstackTestCase): tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -1517,7 +1517,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -1544,7 +1544,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -1554,7 +1554,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -1576,14 +1576,14 @@ class TestResourceTags(cloudstackTestCase): # 2. Add same tag in upper case. # 3. Verify that tag creation failed. - tag_key = 'scope' + tag_key = 'scope13' tag_value = 'test_13_tag_case_insensitive' self.debug("Creating a tag for user VM") tag_1 = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag_1.__dict__) @@ -1591,7 +1591,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -1611,7 +1611,7 @@ class TestResourceTags(cloudstackTestCase): try: Tag.create(self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key.upper(): tag_value.uppper()}) except Exception as e: pass @@ -1622,7 +1622,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -1632,7 +1632,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -1654,14 +1654,14 @@ class TestResourceTags(cloudstackTestCase): # 1. Create more than 10 tags to VM using createTags API # 2. Create a tag with special characters on VM using createTags API - tag_key = 'scope' + tag_key = 'scope14' tag_value = 'test_14_special_char_mutiple_tags' self.debug("Creating a tag for user VM") tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={ tag_key: tag_value, 'offering': 'high', @@ -1681,7 +1681,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -1701,7 +1701,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={ tag_key: tag_value, 'offering': 'high', @@ -1727,7 +1727,7 @@ class TestResourceTags(cloudstackTestCase): # 2. Create a tag on projects using createTags API # 3. Delete the tag. - tag_key = 'scope' + tag_key = 'scope15' tag_value = 'test_15_project_tag' # Create project as a domain admin @@ -1755,7 +1755,7 @@ class TestResourceTags(cloudstackTestCase): self.apiclient, listall=True, resourceType='project', - resourceIds=project.id, + resourceId=project.id, key=tag_key, ) self.debug("tags = %s" % tags) @@ -1822,7 +1822,7 @@ class TestResourceTags(cloudstackTestCase): # 3. Login with other account and query the tags using # listTags API - tag_key = 'scope' + tag_key = 'scope16' tag_value = 'test_16_query_tags_other_account' self.debug("Creating user accounts..") @@ -1923,7 +1923,7 @@ class TestResourceTags(cloudstackTestCase): # 3. Login with admin account and query the tags using # listTags API - tag_key = 'scope' + tag_key = 'scope17' tag_value = 'test_17_query_tags_admin_account' self.debug("Creating user accounts..") @@ -2011,14 +2011,14 @@ class TestResourceTags(cloudstackTestCase): # 1. Create a tag on supported resource type(ex:vms) # 2. Run the list API commands with passing invalid key parameter - tag_key = 'scope' + tag_key = 'scope18' tag_value = 'test_18_invalid_list_parameters' self.debug("Creating a tag for user VM") tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -2029,7 +2029,7 @@ class TestResourceTags(cloudstackTestCase): # subsequent tests fail to tag the vm_1 with same key-pair # breaking the tests. self.rm_tags.append({'tag_obj': tag, - 'restype': 'userVM', + 'restype': 'UserVm', 'resid': self.vm_1.id, 'tags': [ {'key': tag_key, 'value': tag_value} @@ -2059,14 +2059,14 @@ class TestResourceTags(cloudstackTestCase): # 1. Deletion of a tag without any errors. # 2. Add same tag. - tag_key = 'scope' + tag_key = 'scope19' tag_value = 'test_19_delete_add_same_tag' self.debug("Creating a tag for user VM") tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -2074,7 +2074,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2097,7 +2097,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -2107,7 +2107,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2122,7 +2122,7 @@ class TestResourceTags(cloudstackTestCase): tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -2130,7 +2130,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2152,7 +2152,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -2163,7 +2163,7 @@ class TestResourceTags(cloudstackTestCase): def test_20_create_tags_multiple_resources(self): "Test creation of same tag on multiple resources" - tag_key = 'scope' + tag_key = 'scope20' tag_value = 'test_20_create_tags_multiple_resources' self.debug("Creating volume for account: %s " % self.account.name) @@ -2212,7 +2212,7 @@ class TestResourceTags(cloudstackTestCase): tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -2220,7 +2220,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2243,7 +2243,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -2253,7 +2253,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2271,7 +2271,7 @@ class TestResourceTags(cloudstackTestCase): def test_21_create_tag_stopped_vm(self): "Test creation of tag on stopped vm." - tag_key = 'scope' + tag_key = 'scope21' tag_value = 'test_21_create_tag_stopped_vm' try: @@ -2283,7 +2283,7 @@ class TestResourceTags(cloudstackTestCase): tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -2291,7 +2291,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2313,7 +2313,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -2324,7 +2324,7 @@ class TestResourceTags(cloudstackTestCase): def test_22_create_tag_destroyed_vm(self): "Test creation of tag on stopped vm." - tag_key = 'scope' + tag_key = 'scope22' tag_value = 'test_22_create_tag_destroyed_vm' self.debug("Destroying instance: %s" % self.vm_1.name) @@ -2334,7 +2334,7 @@ class TestResourceTags(cloudstackTestCase): tag = Tag.create( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -2342,7 +2342,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, @@ -2365,7 +2365,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_1.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -2479,7 +2479,7 @@ class TestResourceTags(cloudstackTestCase): # 3. Delete above created tag using deleteTags API # 4. Perform steps 2&3 using domain-admin - tag_key = 'scope' + tag_key = 'scope24' tag_value = 'test_24_public_ip_tag' self.debug("Creating a sub-domain under: %s" % self.domain.name) @@ -2799,10 +2799,10 @@ class TestResourceTags(cloudstackTestCase): def test_31_user_cant_remove_update_admin_tags(self): '''Tests that an user is unable to remove, modify tags created by admin but should access''' - tag_key_user = 'scope_user' + tag_key_user = 'scope31_user' tag_value_user = 'test_31_user_cant_remove_update_admin_tags' - tag_key_admin = 'scope_admin' + tag_key_admin = 'scope31_admin' tag_value_admin = 'test_31_user_cant_remove_update_admin_tags' regular_account = Account.create( @@ -2919,10 +2919,10 @@ class TestResourceTags(cloudstackTestCase): def test_32_user_a_doesnt_have_access_to_user_b_tags(self): '''Test resource security between regular accounts A and B''' - tag_key_user1 = 'scope_user1' + tag_key_user1 = 'scope32_user1' tag_value_user1 = 'test_32_user_a_doesnt_have_access_to_user_b_tags-user1' - tag_key_user2 = 'scope_user2' + tag_key_user2 = 'scope32_user2' tag_value_user2 = 'test_32_user_a_doesnt_have_access_to_user_b_tags-user2' regular_account1 = Account.create( @@ -3001,7 +3001,7 @@ class TestResourceTags(cloudstackTestCase): # 2. Create the same tag on VM using createTags API # 3. check the return for the right error message - tag_key = 'scope' + tag_key = 'scope33' tag_value = 'test_33_duplicate_vm_tag' self.debug("Creating a tag for user VM") @@ -3009,7 +3009,7 @@ class TestResourceTags(cloudstackTestCase): tag = Tag.create( self.apiclient, resourceIds=self.vm_2.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) self.debug("Tag created: %s" % tag.__dict__) @@ -3019,16 +3019,15 @@ class TestResourceTags(cloudstackTestCase): erronousTag = Tag.create( self.apiclient, resourceIds=self.vm_2.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: # verify e.message - assert "tag scope already on UserVm with id" in e.message, \ + assert "tag scope33 already on UserVm with id" in e.message, \ "neat error message missing from error result" pass - # we should still find the tag vms = VirtualMachine.list( self.apiclient, @@ -3047,7 +3046,7 @@ class TestResourceTags(cloudstackTestCase): Tag.delete( self.apiclient, resourceIds=self.vm_2.id, - resourceType='userVM', + resourceType='UserVm', tags={tag_key: tag_value} ) except Exception as e: @@ -3057,7 +3056,7 @@ class TestResourceTags(cloudstackTestCase): tags = Tag.list( self.apiclient, listall=True, - resourceType='userVM', + resourceType='UserVm', account=self.account.name, domainid=self.account.domainid, key=tag_key, diff --git a/test/integration/smoke/test_create_list_domain_account_project.py b/test/integration/smoke/test_create_list_domain_account_project.py index d06a9af..5f0f945 100644 --- a/test/integration/smoke/test_create_list_domain_account_project.py +++ b/test/integration/smoke/test_create_list_domain_account_project.py @@ -85,6 +85,7 @@ class TestDomainAccountProject(cloudstackTestCase): raise Exception("Warning: Exception during cleanup : %s" % e) return + @attr(tags=["advanced", "basic", "sg"], required_hardware="false") def test_01_create_list_domain_account_project(self): """ Verify list domain, account and project return expected response """ diff --git a/tools/travis/after_failure.sh b/tools/travis/after_failure.sh index e365567..901d06c 100755 --- a/tools/travis/after_failure.sh +++ b/tools/travis/after_failure.sh @@ -20,4 +20,5 @@ # failure. # find rat.txt -type f -exec echo -e "Printing RAT license-failures {} :\n" \; -exec cat {} \; -find /tmp//MarvinLogs -type f -exec echo -e "Printing logfile {} :\n" \; -exec cat {} \; +find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \; +find vmops.log -type f -exec echo -e "Printing management server logs {} :\n" \; -exec cat {} \; diff --git a/tools/travis/script.sh b/tools/travis/script.sh index edf53ee..4875a51 100755 --- a/tools/travis/script.sh +++ b/tools/travis/script.sh @@ -30,7 +30,7 @@ set -e for suite in "${TESTS[@]}" ; do echo "Currently running test: $suite" - nosetests --with-xunit --xunit-file=integration-test-results/$suite.xml --with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/$suite.py -s -a tags=advanced,required_hardware=false --zone=Sandbox-simulator --hypervisor=simulator || true ; + time nosetests --with-xunit --xunit-file=integration-test-results/$suite.xml --with-marvin --marvin-config=setup/dev/advanced.cfg test/integration/$suite.py -s -a tags=advanced,required_hardware=false --zone=Sandbox-simulator --hypervisor=simulator || true ; done python ./tools/travis/xunit-reader.py integration-test-results/ diff --git a/tools/travis/xunit-reader.py b/tools/travis/xunit-reader.py index b23fb46..659d3e6 100755 --- a/tools/travis/xunit-reader.py +++ b/tools/travis/xunit-reader.py @@ -99,7 +99,8 @@ def parse_reports(file_path_list): if 'type' in children.attrib: status = children.attrib['type'] - table.add_row([name, status, time, file_path.replace(".xml", "").split("/")[-1]]) + if status not in ('Skipped', 'Success'): + table.add_row([name, status, time, file_path.replace(".xml", "").split("/")[-1]]) print table.draw()