Skip to content

Commit b198233

Browse files
author
Boris Schrijver
committed
Merge branch 'master' of https://github.com/apache/cloudstack
2 parents dd7dfc3 + 47d2d07 commit b198233

11 files changed

Lines changed: 314 additions & 34 deletions

File tree

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Description: CloudStack server library
2222

2323
Package: cloudstack-agent
2424
Architecture: all
25-
Depends: ${misc:Depends}, ${python:Depends}, openjdk-7-jre | openjdk-8-jre, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), libcommons-daemon-java, openssh-client, libvirt0, qemu-system-x86 | qemu-kvm, libvirt-bin, uuid-runtime, rsync, iproute, perl-modules, ebtables, vlan, wget, jsvc, ipset, python-libvirt, ethtool, iptables
25+
Depends: ${misc:Depends}, ${python:Depends}, openjdk-7-jre-headless | openjdk-8-jre-headless, cloudstack-common (= ${source:Version}), lsb-base (>= 3.2), libcommons-daemon-java, openssh-client, libvirt0, qemu-system-x86 | qemu-kvm, libvirt-bin, uuid-runtime, rsync, iproute, perl-modules, ebtables, vlan, wget, jsvc, ipset, python-libvirt, ethtool, iptables
2626
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
2727
Description: CloudStack agent
2828
The CloudStack agent is in charge of managing shared computing resources in
@@ -31,7 +31,7 @@ Description: CloudStack agent
3131

3232
Package: cloudstack-usage
3333
Architecture: all
34-
Depends: ${misc:Depends}, openjdk-7-jre | openjdk-8-jre, cloudstack-common (= ${source:Version}), jsvc, libmysql-java
34+
Depends: ${misc:Depends}, openjdk-7-jre-headless | openjdk-8-jre-headless, cloudstack-common (= ${source:Version}), jsvc, libmysql-java
3535
Description: CloudStack usage monitor
3636
The CloudStack usage monitor provides usage accounting across the entire cloud for
3737
cloud operators to charge based on usage parameters.

packaging/centos63/cloud.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ install -D packaging/centos63/cloud-management.sysconfig ${RPM_BUILD_ROOT}%{_sys
301301
install -D server/target/conf/cloudstack-sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
302302
install -D packaging/centos63/tomcat.sh ${RPM_BUILD_ROOT}%{_initrddir}/tomcat.sh
303303

304+
chmod 440 ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
304305
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina
305306
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost
306307
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client

packaging/centos7/cloud.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ install -D packaging/centos7/cloud-management.service ${RPM_BUILD_ROOT}%{_unitdi
278278
install -D packaging/centos7/cloud.limits ${RPM_BUILD_ROOT}%{_sysconfdir}/security/limits.d/cloud
279279
touch ${RPM_BUILD_ROOT}%{_localstatedir}/run/%{name}-management.pid
280280

281+
chmod 440 ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
281282
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina
282283
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost
283284
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client

packaging/fedora20/cloud.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ install -D packaging/centos63/cloud-management.rc ${RPM_BUILD_ROOT}%{_initrddir}
300300
install -D packaging/centos63/cloud-management.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-management
301301
install -D packaging/centos63/tomcat.sh ${RPM_BUILD_ROOT}%{_initrddir}/tomcat.sh
302302

303+
chmod 440 ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
303304
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina
304305
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost
305306
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client

packaging/fedora21/cloud.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ install -D packaging/centos63/cloud-management.rc ${RPM_BUILD_ROOT}%{_initrddir}
300300
install -D packaging/centos63/cloud-management.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}-management
301301
install -D packaging/centos63/tomcat.sh ${RPM_BUILD_ROOT}%{_initrddir}/tomcat.sh
302302

303+
chmod 440 ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
303304
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina
304305
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost
305306
chmod 770 ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/Catalina/localhost/client

plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625StorageProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public Answer copyTemplateToPrimaryStorage(final CopyCommand cmd) {
198198
final Set<VDI> setVdis = srcSr.getVDIs(conn);
199199

200200
if (setVdis.size() != 1) {
201-
return new CopyCmdAnswer("Can't find template VDI under: " + uri.getHost() + ":" + uri.getPath() + "/" + volumeDirectory);
201+
return new CopyCmdAnswer("Expected 1 VDI template but found " + setVdis.size() + " VDI template(s) on: " + uri.getHost() + ":" + uri.getPath() + "/" + volumeDirectory);
202202
}
203203

204204
final VDI srcVdi = setVdis.iterator().next();
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
""" Test case for Create Custom DiskOffering with size Test Path
18+
"""
19+
20+
from nose.plugins.attrib import attr
21+
from marvin.cloudstackTestCase import cloudstackTestCase
22+
from marvin.cloudstackAPI import (createDiskOffering, deleteDiskOffering)
23+
from marvin.lib.utils import (cleanup_resources)
24+
from marvin.lib.common import (get_domain,
25+
get_zone,
26+
)
27+
28+
29+
class TestCustomDiskOfferingWithSize(cloudstackTestCase):
30+
31+
@classmethod
32+
def setUpClass(cls):
33+
testClient = super(
34+
TestCustomDiskOfferingWithSize,
35+
cls).getClsTestClient()
36+
cls.apiclient = testClient.getApiClient()
37+
cls.testdata = testClient.getParsedTestDataConfig()
38+
cls.hypervisor = cls.testClient.getHypervisorInfo()
39+
40+
# Get Zone, Domain and templates
41+
cls.domain = get_domain(cls.apiclient)
42+
cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
43+
cls._cleanup = []
44+
45+
cls.tearDownClass()
46+
47+
return
48+
49+
@classmethod
50+
def tearDownClass(cls):
51+
try:
52+
cleanup_resources(cls.apiclient, cls._cleanup)
53+
except Exception as e:
54+
raise Exception("Warning: Exception during cleanup : %s" % e)
55+
56+
def setUp(self):
57+
self.apiclient = self.testClient.getApiClient()
58+
self.dbclient = self.testClient.getDbConnection()
59+
self.cleanup = []
60+
61+
def tearDown(self):
62+
try:
63+
if hasattr(self, 'disk_offering'):
64+
cmd = deleteDiskOffering.deleteDiskOfferingCmd()
65+
cmd.id = self.disk_offering.id
66+
self.apiclient.deleteDiskOffering(cmd)
67+
68+
cleanup_resources(self.apiclient, self.cleanup)
69+
except Exception as e:
70+
raise Exception("Warning: Exception during cleanup : %s" % e)
71+
return
72+
73+
@attr(tags=["basic", "advanced"], required_hardware="false")
74+
def test_create_custom_disk_offering_with_size(self):
75+
""" Create custom disk offerign with size
76+
1. Create custom disk offering with size.
77+
2. Should not allow to create custom disk offering
78+
with size mentioned.(Exception should be raised)
79+
"""
80+
81+
with self.assertRaises(Exception):
82+
cmd = createDiskOffering.createDiskOfferingCmd()
83+
cmd.displaytext = "Custom Disk Offering"
84+
cmd.name = "Custom Disk Offering"
85+
cmd.customized = True
86+
cmd.disksize = 2
87+
self.disk_offering = self.apiclient.createDiskOffering(cmd)
88+
89+
return
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
"""Test case for checking creation of two VM's with same name on VMWare"""
19+
20+
from nose.plugins.attrib import attr
21+
from marvin.cloudstackTestCase import cloudstackTestCase
22+
from marvin.lib.utils import (cleanup_resources)
23+
from marvin.lib.base import (Account,
24+
ServiceOffering,
25+
VirtualMachine,
26+
Configurations
27+
)
28+
from marvin.lib.common import (get_domain,
29+
get_zone,
30+
get_template,
31+
)
32+
33+
from marvin.sshClient import SshClient
34+
import time
35+
36+
37+
class TestSameVMName(cloudstackTestCase):
38+
39+
@classmethod
40+
def setUpClass(cls):
41+
testClient = super(TestSameVMName, cls).getClsTestClient()
42+
cls.apiclient = testClient.getApiClient()
43+
cls.testdata = testClient.getParsedTestDataConfig()
44+
45+
# Get Zone, Domain and templates
46+
cls.domain = get_domain(cls.apiclient)
47+
cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
48+
49+
cls.template = get_template(
50+
cls.apiclient,
51+
cls.zone.id,
52+
cls.testdata["ostype"])
53+
54+
cls._cleanup = []
55+
56+
cls.mgtSvrDetails = cls.config.__dict__["mgtSvr"][0].__dict__
57+
try:
58+
cls.skiptest = False
59+
60+
if cls.hypervisor.lower() not in ['vmware']:
61+
cls.skiptest = True
62+
63+
# Create an account
64+
cls.account_1 = Account.create(
65+
cls.apiclient,
66+
cls.testdata["account"],
67+
domainid=cls.domain.id
68+
)
69+
cls.account_2 = Account.create(
70+
cls.apiclient,
71+
cls.testdata["account"],
72+
domainid=cls.domain.id
73+
)
74+
75+
# Create user api client of the account
76+
cls.userapiclient_1 = testClient.getUserApiClient(
77+
UserName=cls.account_1.name,
78+
DomainName=cls.account_1.domain
79+
)
80+
81+
cls.userapiclient_2 = testClient.getUserApiClient(
82+
UserName=cls.account_2.name,
83+
DomainName=cls.account_2.domain
84+
)
85+
# Create Service offering
86+
cls.service_offering = ServiceOffering.create(
87+
cls.apiclient,
88+
cls.testdata["service_offering"],
89+
)
90+
91+
cls._cleanup = [
92+
cls.account_1,
93+
cls.account_2,
94+
cls.service_offering,
95+
]
96+
except Exception as e:
97+
cls.tearDownClass()
98+
raise e
99+
return
100+
101+
@classmethod
102+
def RestartServer(cls):
103+
"""Restart management server"""
104+
105+
sshClient = SshClient(
106+
cls.mgtSvrDetails["mgtSvrIp"],
107+
22,
108+
cls.mgtSvrDetails["user"],
109+
cls.mgtSvrDetails["passwd"]
110+
)
111+
command = "service cloudstack-management restart"
112+
sshClient.execute(command)
113+
114+
return
115+
116+
@classmethod
117+
def tearDownClass(cls):
118+
try:
119+
cleanup_resources(cls.apiclient, cls._cleanup)
120+
except Exception as e:
121+
raise Exception("Warning: Exception during cleanup : %s" % e)
122+
123+
def setUp(self):
124+
self.apiclient = self.testClient.getApiClient()
125+
self.dbclient = self.testClient.getDbConnection()
126+
self.cleanup = []
127+
if self.skiptest:
128+
self.skipTest("This test is to be checked on VMWare only Hence, skip for %s" % self.hypervisor)
129+
130+
def tearDown(self):
131+
try:
132+
cleanup_resources(self.apiclient, self.cleanup)
133+
except Exception as e:
134+
raise Exception("Warning: Exception during cleanup : %s" % e)
135+
return
136+
137+
@attr(tags=["advanced", "basic"])
138+
def test_vms_with_same_name(self):
139+
""" Test vm deployment with same name
140+
141+
# 1. Deploy a VM on with perticular name from account_1
142+
# 2. Try to deploy another vm with same name from account_2
143+
# 3. Verify that second VM deployment fails
144+
145+
"""
146+
# Step 1
147+
# Create VM on cluster wide
148+
configs = Configurations.list(
149+
self.apiclient,
150+
name="vm.instancename.flag")
151+
orig_value = configs[0].value
152+
153+
if orig_value == "false":
154+
Configurations.update(self.apiclient,
155+
name="vm.instancename.flag",
156+
value="true"
157+
)
158+
159+
# Restart management server
160+
self.RestartServer()
161+
time.sleep(120)
162+
163+
self.testdata["small"]["displayname"]="TestName"
164+
self.testdata["small"]["name"]="TestName"
165+
VirtualMachine.create(
166+
self.userapiclient_1,
167+
self.testdata["small"],
168+
templateid=self.template.id,
169+
accountid=self.account_1.name,
170+
domainid=self.account_1.domainid,
171+
serviceofferingid=self.service_offering.id,
172+
zoneid=self.zone.id,
173+
)
174+
175+
with self.assertRaises(Exception):
176+
VirtualMachine.create(
177+
self.userapiclient_2,
178+
self.testdata["small"],
179+
templateid=self.template.id,
180+
accountid=self.account_2.name,
181+
domainid=self.account_2.domainid,
182+
serviceofferingid=self.service_offering.id,
183+
zoneid=self.zone.id,
184+
)
185+
return

ui/scripts/accounts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,21 +1099,21 @@
10991099
},
11001100
select: function(args) {
11011101
var samlChecked = false;
1102-
var idpUrl = "";
1102+
var idpUrl = args.$form.find('select[name=samlEntity]').children(':selected').val();
11031103
var appendDomainToUsername = function() {
11041104
if (!g_appendIdpDomain) {
11051105
return;
11061106
}
1107-
var username = $('input[name=username]').val();
1107+
var username = args.$form.find('input[name=username]').val();
11081108
if (username) {
11091109
username = username.split('@')[0];
11101110
}
11111111
if (samlChecked) {
11121112
var link = document.createElement('a');
11131113
link.setAttribute('href', idpUrl);
1114-
$('input[name=username]').val(username + "@" + link.host.split('.').splice(-2).join('.'));
1114+
args.$form.find('input[name=username]').val(username + "@" + link.host.split('.').splice(-2).join('.'));
11151115
} else {
1116-
$('input[name=username]').val(username);
1116+
args.$form.find('input[name=username]').val(username);
11171117
}
11181118
};
11191119
args.$form.find('select[name=samlEntity]').change(function() {

ui/scripts/accountsWizard.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -179,33 +179,6 @@
179179
required: false
180180
},
181181
select: function(args) {
182-
var samlChecked = false;
183-
var idpUrl = "";
184-
var appendDomainToUsername = function() {
185-
if (!g_appendIdpDomain) {
186-
return;
187-
}
188-
var username = $('input[name=username]').val();
189-
if (username) {
190-
username = username.split('@')[0];
191-
}
192-
if (samlChecked) {
193-
var link = document.createElement('a');
194-
link.setAttribute('href', idpUrl);
195-
$('input[name=username]').val(username + "@" + link.host.split('.').splice(-2).join('.'));
196-
} else {
197-
$('input[name=username]').val(username);
198-
}
199-
};
200-
args.$form.find('select[name=samlEntity]').change(function() {
201-
idpUrl = $(this).children(':selected').val();
202-
appendDomainToUsername();
203-
});
204-
args.$form.find('input[name=samlEnable]').change(function() {
205-
samlChecked = $(this).context.checked;
206-
appendDomainToUsername();
207-
});
208-
209182
var items = [];
210183
$(g_idpList).each(function() {
211184
items.push({

0 commit comments

Comments
 (0)