Skip to content

Commit 97df529

Browse files
authored
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.yadav@shapeblue.com>
1 parent b40fdbb commit 97df529

23 files changed

Lines changed: 582 additions & 578 deletions

.travis.yml

Lines changed: 65 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ env:
4343
smoke/test_affinity_groups
4444
smoke/test_affinity_groups_projects
4545
smoke/test_async_job
46+
smoke/test_create_list_domain_account_project
4647
smoke/test_deploy_vgpu_enabled_vm
4748
smoke/test_deploy_vm_iso
4849
smoke/test_deploy_vm_root_resize
@@ -52,13 +53,12 @@ env:
5253
smoke/test_disk_offerings
5354
smoke/test_dynamicroles
5455
smoke/test_global_settings
55-
smoke/test_guest_vlan_range"
56-
57-
- TESTS="smoke/test_hostha_kvm
58-
smoke/test_hostha_simulator
56+
smoke/test_guest_vlan_range
5957
smoke/test_host_annotations
6058
smoke/test_host_maintenance
61-
smoke/test_internal_lb
59+
smoke/test_hostha_simulator"
60+
61+
- TESTS="smoke/test_internal_lb
6262
smoke/test_iso
6363
smoke/test_list_ids_parameter
6464
smoke/test_loadbalance
@@ -76,14 +76,12 @@ env:
7676
smoke/test_over_provisioning
7777
smoke/test_password_server
7878
smoke/test_portable_publicip
79-
smoke/test_portforwardingrules"
80-
81-
- TESTS="smoke/test_primary_storage"
82-
83-
- TESTS="smoke/test_privategw_acl
79+
smoke/test_portforwardingrules
80+
smoke/test_privategw_acl
8481
smoke/test_projects
85-
smoke/test_public_ip_range
86-
smoke/test_pvlan
82+
smoke/test_public_ip_range"
83+
84+
- TESTS="smoke/test_pvlan
8785
smoke/test_regions
8886
smoke/test_reset_vm_on_reboot
8987
smoke/test_resource_accounting
@@ -101,79 +99,80 @@ env:
10199
smoke/test_staticroles
102100
smoke/test_templates
103101
smoke/test_usage
104-
smoke/test_usage_events
105-
smoke/test_vm_life_cycle
102+
smoke/test_usage_events"
103+
104+
- TESTS="smoke/test_vm_life_cycle
106105
smoke/test_vm_snapshots
107106
smoke/test_volumes
108107
smoke/test_vpc_redundant
109108
smoke/test_vpc_router_nics
110-
smoke/test_vpc_vpn"
109+
smoke/test_vpc_vpn
110+
smoke/test_primary_storage"
111111

112-
- TESTS="smoke/misc/test_deploy_vm
113-
smoke/misc/test_escalations_templates
114-
smoke/misc/test_vm_ha
115-
smoke/misc/test_vm_sync
116-
component/find_hosts_for_migration
112+
- TESTS="component/find_hosts_for_migration
113+
component/test_acl_isolatednetwork
117114
component/test_acl_isolatednetwork_delete
118-
component/test_acl_listsnapshot
119-
component/test_acl_listvm
115+
component/test_acl_listsnapshot"
116+
117+
- TESTS="component/test_acl_listvm
120118
component/test_acl_listvolume"
121119

122120
- TESTS="component/test_acl_sharednetwork
123121
component/test_acl_sharednetwork_deployVM-impersonation"
124122

125123
- TESTS="component/test_affinity_groups_projects
126-
component/test_allocation_states"
124+
component/test_allocation_states
125+
component/test_assign_vm"
127126

128-
- TESTS="component/test_cpu_domain_limits
127+
- TESTS="component/test_concurrent_snapshots_limit
128+
component/test_cpu_domain_limits
129129
component/test_cpu_limits
130130
component/test_cpu_max_limits
131-
component/test_cpu_project_limits"
131+
component/test_cpu_project_limits
132+
component/test_deploy_vm_userdata_multi_nic"
132133

133-
- TESTS="component/test_deploy_vm_userdata_multi_nic
134-
component/test_egress_fw_rules
134+
- TESTS="component/test_egress_fw_rules
135135
component/test_invalid_gw_nm
136-
component/test_ip_reservation
137-
component/test_lb_secondary_ip"
136+
component/test_ip_reservation"
138137

139-
- TESTS="component/test_memory_limits
140-
component/test_mm_domain_limits
141-
component/test_mm_max_limits
142-
component/test_mm_project_limits"
138+
- TESTS="component/test_lb_secondary_ip
139+
component/test_list_nics
140+
component/test_list_pod
141+
component/test_memory_limits"
143142

144-
- TESTS="component/test_network_offering
145-
component/test_non_contiguous_vlan
146-
component/test_persistent_networks"
143+
- TESTS="component/test_mm_domain_limits
144+
component/test_mm_max_limits
145+
component/test_mm_project_limits
146+
component/test_network_offering
147+
component/test_non_contiguous_vlan"
147148

148-
- TESTS="component/test_project_limits
149+
- TESTS="component/test_persistent_networks
149150
component/test_project_configs
150-
component/test_project_usage
151+
component/test_project_limits
151152
component/test_project_resources"
152153

154+
- TESTS="component/test_project_usage
155+
component/test_resource_limits"
156+
153157
- TESTS="component/test_regions_accounts
154158
component/test_routers
155159
component/test_snapshots
156-
component/test_stopped_vm"
157-
158-
- TESTS="component/test_project_resources"
159-
160-
- TESTS="component/test_project_limits
161-
component/test_resource_limits"
162-
163-
- TESTS="component/test_tags
160+
component/test_stopped_vm
161+
component/test_tags
164162
component/test_templates
165-
component/test_update_vm
166-
component/test_volumes"
163+
component/test_updateResourceCount
164+
component/test_update_vm"
167165

168-
- TESTS="component/test_vpc
169-
component/test_vpc_network
166+
- TESTS="component/test_volumes
167+
component/test_vpc
168+
component/test_vpc_distributed_routing_offering
169+
component/test_vpc_network"
170+
171+
- TESTS="component/test_vpc_network_lbrules
170172
component/test_vpc_offerings
173+
component/test_vpc_routers
171174
component/test_vpn_users"
172175

173-
# FIXME: fix following tests and include them in Travis
174-
# - TESTS="component/test_vpc" Please add when PR: https://github.com/apache/cloudstack/pull/955 CLOUDSTACK-8969 is fixed
175-
# - TESTS="component/test_organization_states" Please add when CLOUDSTACK-7735 is fixed
176-
177176
before_install: travis_wait 30 ./tools/travis/before_install.sh
178177
install: ./tools/travis/install.sh
179178
before_script: travis_wait 30 ./tools/travis/before_script.sh
@@ -198,25 +197,15 @@ after_script: ./tools/travis/after_script.sh
198197
after_success: true
199198
after_failure: true
200199

201-
jobs:
202-
include:
203-
- stage: package
204-
services: docker
205-
env: IMAGE=khos2ow/cloudstack-rpm-builder:centos7 PARAMS="--distribution centos7 --pack oss"
206-
<<: *package_job
207-
208-
- stage: package
209-
services: docker
210-
env: IMAGE=khos2ow/cloudstack-rpm-builder:centos6 PARAMS="--distribution centos63 --pack oss"
211-
<<: *package_job
212-
213-
- stage: package
214-
services: docker
215-
env: IMAGE=khos2ow/cloudstack-deb-builder:ubuntu1804 PARAMS=""
216-
<<: *package_job
217-
218-
- stage: package
219-
services: docker
220-
env: IMAGE=khos2ow/cloudstack-deb-builder:ubuntu1604 PARAMS=""
221-
<<: *package_job
222-
200+
#Disable due to intermittent failures
201+
#jobs:
202+
# include:
203+
# - stage: package
204+
# services: docker
205+
# env: IMAGE=khos2ow/cloudstack-rpm-builder:centos7 PARAMS="--distribution centos7 --pack oss"
206+
# <<: *package_job
207+
#
208+
# - stage: package
209+
# services: docker
210+
# env: IMAGE=khos2ow/cloudstack-deb-builder:ubuntu1804 PARAMS=""
211+
# <<: *package_job

INSTALL.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,32 @@ CloudStack. For more information please refer to the official [documentation](ht
55
or the developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Home).
66

77
Apache CloudStack developers use various platforms for development, this guide
8-
was tested against a CentOS 6.5 x86_64 setup.
8+
was tested against a CentOS 7 x86_64 setup.
99

1010
* [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for Apache CloudStack.
1111
* [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+CloudStack) Apache CloudStack.
12+
* [Appliance based development](https://github.com/rhtyd/monkeybox)
1213

1314
## Setting up Development Environment
1415

1516
Install tools and dependencies used for development:
1617

17-
$ yum install git ant ant-devel java-1.6.0-openjdk java-1.6.0-openjdk-devel
18+
$ yum install git java-1.8.0-openjdk java-1.8.0-openjdk-devel \
1819
mysql mysql-server mkisofs gcc python MySQL-python openssh-clients wget
1920

2021
# yum -y update
21-
# yum -y install java-1.7.0-openjdk
22-
# yum -y install java-1.7.0-openjdk-devel
22+
# yum -y install java-1.8.0-openjdk
23+
# yum -y install java-1.8.0-openjdk-devel
2324
# yum -y install mysql-server
2425
# yum -y install git
2526
# yum -y install genisoimage
2627

27-
Set up Maven (3.0.5):
28+
Set up Maven (3.6.0):
2829

29-
# wget http://www.us.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
30-
# tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /usr/local
30+
# wget http://www.us.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
31+
# tar -zxvf apache-maven-3.6.0-bin.tar.gz -C /usr/local
3132
# cd /usr/local
32-
# ln -s apache-maven-3.0.5 maven
33+
# ln -s apache-maven-3.6.0 maven
3334
# echo export M2_HOME=/usr/local/maven >> ~/.bashrc # or .zshrc or .profile
3435
# echo export PATH=/usr/local/maven/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile
3536
# source ~/.bashrc
@@ -44,10 +45,10 @@ CloudStack is built using Java and Python. To make selection of these tools ver
4445

4546
Following installation, execute the following commands to configure jenv and pyenv for use with CloudStack development:
4647

47-
# pyenv install 2.7.11 ## Install Python 2.7.11
48-
# pyenv virtualenv 2.7.11 cloudstack ## Create a cloudstack virtualenv using Python 2.7.11
48+
# pyenv install 2.7.16 ## Install Python 2.7.16
49+
# pyenv virtualenv 2.7.16 cloudstack ## Create a cloudstack virtualenv using Python 2.7.16
4950
# pip install -r <root CloudStack source tree>/requirements.txt ## Install cloudstack Python dependencies
50-
# jenv add <path to JDK 1.7 installation> ## Add Java7 to jenv
51+
# jenv add <path to JDK 1.8 installation> ## Add Java7 to jenv
5152

5253
*N.B.* If you are running Linux, you may need to install additional packages to allow pyenv to build Python.
5354

@@ -61,10 +62,10 @@ You may get the source code from the repository hosted on Apache:
6162

6263
Or, you may fork the repository from the official Apache CloudStack mirror on [Github](https://github.com/apache/cloudstack)
6364

64-
To checkout a specific branch, for example 4.4, do:
65+
To checkout a specific branch, for example 4.11, do:
6566

6667
$ git fetch origin
67-
$ git checkout -b 4.4 origin/4.4
68+
$ git checkout -b 4.11 origin/4.11
6869

6970
## Building
7071

@@ -142,7 +143,7 @@ To create rpms, install the following extra packages:
142143

143144
Then:
144145

145-
$ cd packaging/centos63
146+
$ cd packaging
146147
$ package.sh
147148

148149
To create packages for noredist add the `-p noredist` option to the package script.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 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)
1+
# 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 count](https://img.shields.io/github/languages/count/apache/cloudstack.svg) ![GitHub top language](https://img.shields.io/github/languages/top/apache/cloudstack.svg)
22

33
![Apache CloudStack](tools/logo/apache_cloudstack.png)
44

api/src/main/java/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
5555
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, validations = ApiArgValidator.NotNullOrEmpty, description = "name of the project")
5656
private String name;
5757

58-
@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, validations = ApiArgValidator.NotNullOrEmpty, description = "display text of the project")
58+
@Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, required = true, description = "display text of the project")
5959
private String displayText;
6060

6161
// ///////////////////////////////////////////////////

plugins/hypervisors/simulator/src/main/java/com/cloud/resource/AgentRoutingResource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public StartupCommand[] initialize() {
198198
cmd.setName(agentHost.getName());
199199
cmd.setGuid(agentHost.getGuid());
200200
cmd.setVersion(agentHost.getVersion());
201+
cmd.setHypervisorVersion(agentHost.getVersion());
201202
cmd.setAgentTag("agent-simulator");
202203
cmd.setDataCenter(String.valueOf(agentHost.getDataCenterId()));
203204
cmd.setPod(String.valueOf(agentHost.getPodId()));

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
import com.cloud.projects.Project.ListProjectResourcesCriteria;
182182
import com.cloud.projects.ProjectInvitation;
183183
import com.cloud.projects.ProjectManager;
184+
import com.cloud.projects.ProjectVO;
184185
import com.cloud.projects.dao.ProjectAccountDao;
185186
import com.cloud.projects.dao.ProjectDao;
186187
import com.cloud.resource.ResourceManager;
@@ -640,10 +641,22 @@ private Pair<List<ResourceTagJoinVO>, Integer> listTagsInternal(ListTagsCmd cmd)
640641
String resourceType = cmd.getResourceType();
641642
String customerName = cmd.getCustomer();
642643
boolean listAll = cmd.listAll();
644+
Long projectId = cmd.getProjectId();
645+
646+
if (projectId == null && ResourceObjectType.Project.name().equalsIgnoreCase(resourceType) && !Strings.isNullOrEmpty(resourceId)) {
647+
try {
648+
projectId = Long.parseLong(resourceId);
649+
} catch (final NumberFormatException e) {
650+
final ProjectVO project = _projectDao.findByUuidIncludingRemoved(resourceId);
651+
if (project != null) {
652+
projectId = project.getId();
653+
}
654+
}
655+
}
643656

644657
Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean, ListProjectResourcesCriteria>(cmd.getDomainId(), cmd.isRecursive(), null);
645658

646-
_accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, listAll, false);
659+
_accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), projectId, permittedAccounts, domainIdRecursiveListProject, listAll, false);
647660
Long domainId = domainIdRecursiveListProject.first();
648661
Boolean isRecursive = domainIdRecursiveListProject.second();
649662
ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();

server/src/main/java/com/cloud/projects/ProjectManagerImpl.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,12 @@
3838
import javax.mail.internet.InternetAddress;
3939
import javax.naming.ConfigurationException;
4040

41-
import org.apache.log4j.Logger;
42-
import org.springframework.stereotype.Component;
43-
44-
import com.sun.mail.smtp.SMTPMessage;
45-
import com.sun.mail.smtp.SMTPSSLTransport;
46-
import com.sun.mail.smtp.SMTPTransport;
47-
4841
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
4942
import org.apache.cloudstack.context.CallContext;
5043
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
5144
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
45+
import org.apache.log4j.Logger;
46+
import org.springframework.stereotype.Component;
5247

5348
import com.cloud.api.ApiDBUtils;
5449
import com.cloud.api.query.dao.ProjectAccountJoinDao;
@@ -90,6 +85,9 @@
9085
import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn;
9186
import com.cloud.utils.db.TransactionStatus;
9287
import com.cloud.utils.exception.CloudRuntimeException;
88+
import com.sun.mail.smtp.SMTPMessage;
89+
import com.sun.mail.smtp.SMTPSSLTransport;
90+
import com.sun.mail.smtp.SMTPTransport;
9391

9492
@Component
9593
public class ProjectManagerImpl extends ManagerBase implements ProjectManager {
@@ -207,15 +205,15 @@ public Project createProject(final String name, final String displayText, String
207205
@Override
208206
public Project doInTransaction(TransactionStatus status) {
209207

210-
//Create an account associated with the project
211-
StringBuilder acctNm = new StringBuilder("PrjAcct-");
208+
//Create an account associated with the project
209+
StringBuilder acctNm = new StringBuilder("PrjAcct-");
212210
acctNm.append(name).append("-").append(ownerFinal.getDomainId());
213211

214-
Account projectAccount = _accountMgr.createAccount(acctNm.toString(), Account.ACCOUNT_TYPE_PROJECT, null, domainId, null, null, UUID.randomUUID().toString());
212+
Account projectAccount = _accountMgr.createAccount(acctNm.toString(), Account.ACCOUNT_TYPE_PROJECT, null, domainId, null, null, UUID.randomUUID().toString());
215213

216214
Project project = _projectDao.persist(new ProjectVO(name, displayText, ownerFinal.getDomainId(), projectAccount.getId()));
217215

218-
//assign owner to the project
216+
//assign owner to the project
219217
assignAccountToProject(project, ownerFinal.getId(), ProjectAccount.Role.Admin);
220218

221219
if (project != null) {

0 commit comments

Comments
 (0)