property files and build file fixes for simulator db changes
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6e9d7aa4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6e9d7aa4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6e9d7aa4 Branch: refs/heads/javelin Commit: 6e9d7aa45bc75233fe75590ece5e87e533389116 Parents: efc58cd Author: Prasanna Santhanam <t...@apache.org> Authored: Mon Sep 17 17:32:22 2012 +0530 Committer: Prasanna Santhanam <t...@apache.org> Committed: Mon Sep 17 17:33:26 2012 +0530 ---------------------------------------------------------------------- client/tomcatconf/db.properties.in | 12 ++ setup/db/create-database-simulator.sql | 29 +++ setup/db/create-schema-simulator.sql | 26 ++-- setup/db/deploy-db-simulator.sh | 4 + .../sandbox/advanced/tests/test_scenarios.py | 145 --------------- 5 files changed, 58 insertions(+), 158 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6e9d7aa4/client/tomcatconf/db.properties.in ---------------------------------------------------------------------- diff --git a/client/tomcatconf/db.properties.in b/client/tomcatconf/db.properties.in index ba51b72..f39d8fe 100644 --- a/client/tomcatconf/db.properties.in +++ b/client/tomcatconf/db.properties.in @@ -69,3 +69,15 @@ db.usage.autoReconnect=true # awsapi database settings db.awsapi.name=cloudbridge + +# Simulator database settings +db.simulator.username=@DBUSER@ +db.simulator.password=@DBPW@ +db.simulator.host=@DBHOST@ +db.simulator.port=3306 +db.simulator.name=simulator +db.simulator.maxActive=250 +db.simulator.maxIdle=30 +db.simulator.maxWait=10000 +db.simulator.autoReconnect=true + http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6e9d7aa4/setup/db/create-database-simulator.sql ---------------------------------------------------------------------- diff --git a/setup/db/create-database-simulator.sql b/setup/db/create-database-simulator.sql new file mode 100644 index 0000000..8924eda --- /dev/null +++ b/setup/db/create-database-simulator.sql @@ -0,0 +1,29 @@ +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. + + +DROP DATABASE IF EXISTS `simulator`; + +CREATE DATABASE `simulator`; + +GRANT ALL ON simulator.* to cloud@`localhost` identified by 'cloud'; +GRANT ALL ON simulator.* to cloud@`%` identified by 'cloud'; + +GRANT process ON *.* TO cloud@`localhost`; +GRANT process ON *.* TO cloud@`%`; + +commit; http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6e9d7aa4/setup/db/create-schema-simulator.sql ---------------------------------------------------------------------- diff --git a/setup/db/create-schema-simulator.sql b/setup/db/create-schema-simulator.sql index b8168aa..1ab838b 100644 --- a/setup/db/create-schema-simulator.sql +++ b/setup/db/create-schema-simulator.sql @@ -15,14 +15,14 @@ -- specific language governing permissions and limitations -- under the License. -DROP TABLE IF EXISTS `cloud`.`mockhost`; -DROP TABLE IF EXISTS `cloud`.`mocksecstorage`; -DROP TABLE IF EXISTS `cloud`.`mockstoragepool`; -DROP TABLE IF EXISTS `cloud`.`mockvm`; -DROP TABLE IF EXISTS `cloud`.`mockvolume`; -DROP TABLE IF EXISTS `cloud`.`mocksecurityrules`; +DROP TABLE IF EXISTS `simulator`.`mockhost`; +DROP TABLE IF EXISTS `simulator`.`mocksecstorage`; +DROP TABLE IF EXISTS `simulator`.`mockstoragepool`; +DROP TABLE IF EXISTS `simulator`.`mockvm`; +DROP TABLE IF EXISTS `simulator`.`mockvolume`; +DROP TABLE IF EXISTS `simulator`.`mocksecurityrules`; -CREATE TABLE `cloud`.`mockhost` ( +CREATE TABLE `simulator`.`mockhost` ( `id` bigint unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL, `private_ip_address` char(40), @@ -48,7 +48,7 @@ CREATE TABLE `cloud`.`mockhost` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `cloud`.`mocksecstorage` ( +CREATE TABLE `simulator`.`mocksecstorage` ( `id` bigint unsigned NOT NULL auto_increment, `url` varchar(255), `capacity` bigint unsigned, @@ -56,7 +56,7 @@ CREATE TABLE `cloud`.`mocksecstorage` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `cloud`.`mockstoragepool` ( +CREATE TABLE `simulator`.`mockstoragepool` ( `id` bigint unsigned NOT NULL auto_increment, `guid` varchar(255), `mount_point` varchar(255), @@ -67,7 +67,7 @@ CREATE TABLE `cloud`.`mockstoragepool` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `cloud`.`mockvm` ( +CREATE TABLE `simulator`.`mockvm` ( `id` bigint unsigned NOT NULL auto_increment, `name` varchar(255), `host_id` bigint unsigned, @@ -83,7 +83,7 @@ CREATE TABLE `cloud`.`mockvm` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `cloud`.`mockvolume` ( +CREATE TABLE `simulator`.`mockvolume` ( `id` bigint unsigned NOT NULL auto_increment, `name` varchar(255), `size` bigint unsigned, @@ -97,7 +97,7 @@ CREATE TABLE `cloud`.`mockvolume` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `cloud`.`mockconfiguration` ( +CREATE TABLE `simulator`.`mockconfiguration` ( `id` bigint unsigned NOT NULL auto_increment, `data_center_id` bigint unsigned, `pod_id` bigint unsigned, @@ -108,7 +108,7 @@ CREATE TABLE `cloud`.`mockconfiguration` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `cloud`.`mocksecurityrules` ( +CREATE TABLE `simulator`.`mocksecurityrules` ( `id` bigint unsigned NOT NULL auto_increment, `vmid` bigint unsigned, `signature` varchar(255), http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6e9d7aa4/setup/db/deploy-db-simulator.sh ---------------------------------------------------------------------- diff --git a/setup/db/deploy-db-simulator.sh b/setup/db/deploy-db-simulator.sh index fe21c81..4f8c14e 100644 --- a/setup/db/deploy-db-simulator.sh +++ b/setup/db/deploy-db-simulator.sh @@ -87,6 +87,10 @@ echo "Recreating Database cloud_usage." mysql --user=root --password=$3 < create-database-premium.sql > /dev/null 2>/dev/null handle_error create-database-premium.sql +echo "Recreating Database simulator." +mysql --user=root --password=$3 < create-database-simulator.sql > /dev/null 2>/dev/null +handle_error create-database-simulator.sql + mysql --user=cloud --password=cloud cloud < create-schema.sql if [ $? -ne 0 ]; then printf "Error: Cannot execute create-schema.sql\n" http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6e9d7aa4/tools/marvin/marvin/sandbox/advanced/tests/test_scenarios.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/sandbox/advanced/tests/test_scenarios.py b/tools/marvin/marvin/sandbox/advanced/tests/test_scenarios.py deleted file mode 100644 index 7f552c3..0000000 --- a/tools/marvin/marvin/sandbox/advanced/tests/test_scenarios.py +++ /dev/null @@ -1,145 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - - -#!/usr/bin/env python -try: - import unittest2 as unittest -except ImportError: - import unittest - -import random -import hashlib -from cloudstackTestCase import * -import remoteSSHClient - -class SampleScenarios(cloudstackTestCase): - ''' - ''' - def setUp(self): - pass - - - def tearDown(self): - pass - - - def test_1_createAccounts(self, numberOfAccounts=2): - ''' - Create a bunch of user accounts - ''' - mdf = hashlib.md5() - mdf.update('password') - mdf_pass = mdf.hexdigest() - api = self.testClient.getApiClient() - for i in range(1, numberOfAccounts + 1): - acct = createAccount.createAccountCmd() - acct.accounttype = 0 - acct.firstname = 'user' + str(i) - acct.lastname = 'user' + str(i) - acct.password = mdf_pass - acct.username = 'user' + str(i) - acct.email = 'u...@example.com' - acct.account = 'user' + str(i) - acct.domainid = 1 - acctResponse = api.createAccount(acct) - self.debug("successfully created account: %s, user: %s, id: %s"%(acctResponse.account, acctResponse.username, acctResponse.id)) - - - def test_2_createServiceOffering(self): - apiClient = self.testClient.getApiClient() - createSOcmd=createServiceOffering.createServiceOfferingCmd() - createSOcmd.name='Sample SO' - createSOcmd.displaytext='Sample SO' - createSOcmd.storagetype='shared' - createSOcmd.cpunumber=1 - createSOcmd.cpuspeed=100 - createSOcmd.memory=128 - createSOcmd.offerha='false' - createSOresponse = apiClient.createServiceOffering(createSOcmd) - return createSOresponse.id - - def deployCmd(self, account, service): - deployVmCmd = deployVirtualMachine.deployVirtualMachineCmd() - deployVmCmd.zoneid = 1 - deployVmCmd.account=account - deployVmCmd.domainid=1 - deployVmCmd.templateid=2 - deployVmCmd.serviceofferingid=service - return deployVmCmd - - def listVmsInAccountCmd(self, acct): - api = self.testClient.getApiClient() - listVmCmd = listVirtualMachines.listVirtualMachinesCmd() - listVmCmd.account = acct - listVmCmd.zoneid = 1 - listVmCmd.domainid = 1 - listVmResponse = api.listVirtualMachines(listVmCmd) - return listVmResponse - - - def destroyVmCmd(self, key): - api = self.testClient.getApiClient() - destroyVmCmd = destroyVirtualMachine.destroyVirtualMachineCmd() - destroyVmCmd.id = key - api.destroyVirtualMachine(destroyVmCmd) - - - def test_3_stressDeploy(self): - ''' - Deploy 5 Vms in each account - ''' - service_id = self.test_2_createServiceOffering() - api = self.testClient.getApiClient() - for acct in range(1, 5): - [api.deployVirtualMachine(self.deployCmd('user'+str(acct), service_id)) for x in range(0,5)] - - @unittest.skip("skipping destroys") - def test_4_stressDestroy(self): - ''' - Cleanup all Vms in every account - ''' - api = self.testClient.getApiClient() - for acct in range(1, 6): - for vm in self.listVmsInAccountCmd('user'+str(acct)): - if vm is not None: - self.destroyVmCmd(vm.id) - - @unittest.skip("skipping destroys") - def test_5_combineStress(self): - for i in range(0, 5): - self.test_3_stressDeploy() - self.test_4_stressDestroy() - - def deployN(self,nargs=300,batchsize=0): - ''' - Deploy Nargs number of VMs concurrently in batches of size {batchsize}. - When batchsize is 0 all Vms are deployed in one batch - VMs will be deployed in 5:2:6 ratio - ''' - cmds = [] - - if batchsize == 0: - self.testClient.submitCmdsAndWait(cmds) - else: - while len(z) > 0: - try: - newbatch = [cmds.pop() for b in range(batchsize)] #pop batchsize items - self.testClient.submitCmdsAndWait(newbatch) - except IndexError: - break http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6e9d7aa4/tools/marvin/marvin/sandbox/run-marvin.sh ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/sandbox/run-marvin.sh b/tools/marvin/marvin/sandbox/run-marvin.sh old mode 100644 new mode 100755