mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Removing tests that were written in the old design
The APIs addVolumeDetail and addNicDetail do not exist. These were part of the old resource tagging design. Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
		
							parent
							
								
									a23f151df5
								
							
						
					
					
						commit
						6e1103e924
					
				| @ -1,224 +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. |  | ||||||
| """ P1 tests for Scaling up Vm |  | ||||||
| """ |  | ||||||
| #Import Local Modules |  | ||||||
| import marvin |  | ||||||
| from marvin.cloudstackTestCase import * |  | ||||||
| from marvin.cloudstackAPI import * |  | ||||||
| from marvin.remoteSSHClient import remoteSSHClient |  | ||||||
| from marvin.integration.lib.utils import * |  | ||||||
| from marvin.integration.lib.base import * |  | ||||||
| from marvin.integration.lib.common import * |  | ||||||
| from nose.plugins.attrib import attr |  | ||||||
| #Import System modules |  | ||||||
| import time |  | ||||||
| 
 |  | ||||||
| _multiprocess_shared_ = True |  | ||||||
| class Services: |  | ||||||
|     """Test VM Life Cycle Services |  | ||||||
|     """ |  | ||||||
| 
 |  | ||||||
|     def __init__(self): |  | ||||||
|         self.services = { |  | ||||||
| 
 |  | ||||||
|                 "account": { |  | ||||||
|                     "email": "test@test.com", |  | ||||||
|                     "firstname": "Test", |  | ||||||
|                     "lastname": "User", |  | ||||||
|                     "username": "test", |  | ||||||
|                     # Random characters are appended in create account to  |  | ||||||
|                     # ensure unique username generated each time |  | ||||||
|                     "password": "password", |  | ||||||
|                 }, |  | ||||||
|                 "small": |  | ||||||
|                 # Create a small virtual machine instance with disk offering  |  | ||||||
|                 { |  | ||||||
|                     "displayname": "testserver", |  | ||||||
|                     "username": "root", # VM creds for SSH |  | ||||||
|                     "password": "password", |  | ||||||
|                     "ssh_port": 22, |  | ||||||
|                     "hypervisor": 'XenServer', |  | ||||||
|                     "privateport": 22, |  | ||||||
|                     "publicport": 22, |  | ||||||
|                     "protocol": 'TCP', |  | ||||||
|                 }, |  | ||||||
|                 "disk_offering": { |  | ||||||
|                             "displaytext": "Small", |  | ||||||
|                             "name": "Small", |  | ||||||
|                             "storagetype": "shared", |  | ||||||
|                             "disksize": 1 |  | ||||||
|                 }, |  | ||||||
|                 "service_offerings": |  | ||||||
|                 { |  | ||||||
|                  "small": |  | ||||||
|                     { |  | ||||||
|                      # Small service offering ID to for change VM  |  | ||||||
|                      # service offering from medium to small |  | ||||||
|                         "name": "SmallInstance", |  | ||||||
|                         "displaytext": "SmallInstance", |  | ||||||
|                         "cpunumber": 1, |  | ||||||
|                         "cpuspeed": 100, |  | ||||||
|                         "memory": 256, |  | ||||||
|                     }, |  | ||||||
|                 "big": |  | ||||||
|                     { |  | ||||||
|                      # Big service offering ID to for change VM  |  | ||||||
|                         "name": "BigInstance", |  | ||||||
|                         "displaytext": "BigInstance", |  | ||||||
|                         "cpunumber": 1, |  | ||||||
|                         "cpuspeed": 100, |  | ||||||
|                         "memory": 512, |  | ||||||
|                     } |  | ||||||
|                 }, |  | ||||||
|                 #Change this |  | ||||||
|                 "template": { |  | ||||||
|                     "displaytext": "xs", |  | ||||||
|                     "name": "xs", |  | ||||||
|                     "passwordenabled": False, |  | ||||||
|                 }, |  | ||||||
|             "diskdevice": '/dev/xvdd', |  | ||||||
|             # Disk device where ISO is attached to instance |  | ||||||
|             "mount_dir": "/mnt/tmp", |  | ||||||
|             "sleep": 60, |  | ||||||
|             "timeout": 10, |  | ||||||
|             #Migrate VM to hostid |  | ||||||
|             "ostype": 'CentOS 5.6 (64-bit)', |  | ||||||
|             # CentOS 5.3 (64-bit) |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
| class TestNicDetail(cloudstackTestCase): |  | ||||||
| 
 |  | ||||||
|     @classmethod |  | ||||||
|     def setUpClass(cls): |  | ||||||
|         cls.api_client = super(TestNicDetail, cls).getClsTestClient().getApiClient() |  | ||||||
|         cls.services = Services().services |  | ||||||
| 
 |  | ||||||
|         # Get Zone, Domain and templates |  | ||||||
|         domain = get_domain(cls.api_client, cls.services) |  | ||||||
|         zone = get_zone(cls.api_client, cls.services) |  | ||||||
|         cls.services['mode'] = zone.networktype |  | ||||||
| 
 |  | ||||||
|         # Set Zone |  | ||||||
| 
 |  | ||||||
|         # Create account, service offerings, vm. |  | ||||||
|         cls.account = Account.create( |  | ||||||
|                             cls.api_client, |  | ||||||
|                             cls.services["account"], |  | ||||||
|                             domainid=domain.id |  | ||||||
|                             ) |  | ||||||
| 
 |  | ||||||
|         cls.nic = "163738c7-ce3a-481d-ac68-4a8337043415"; |  | ||||||
|         #how does it work |  | ||||||
|         cls._cleanup = [ |  | ||||||
|                         cls.account |  | ||||||
|                         ] |  | ||||||
| 
 |  | ||||||
|     @classmethod |  | ||||||
|     def tearDownClass(cls): |  | ||||||
|         cls.api_client = super(TestNicDetail, cls).getClsTestClient().getApiClient() |  | ||||||
|         cleanup_resources(cls.api_client, cls._cleanup) |  | ||||||
|         return |  | ||||||
| 
 |  | ||||||
|     def setUp(self): |  | ||||||
|         self.apiclient = self.testClient.getApiClient() |  | ||||||
|         self.dbclient = self.testClient.getDbConnection() |  | ||||||
|         self.cleanup = [] |  | ||||||
| 
 |  | ||||||
|     def tearDown(self): |  | ||||||
|         #Clean up, terminate the created ISOs |  | ||||||
|         cleanup_resources(self.apiclient, self.cleanup) |  | ||||||
|         return |  | ||||||
| 
 |  | ||||||
|     @attr(tags = ["advanced", "xenserver"]) |  | ||||||
|     def test_01_updatenicdetail(self): |  | ||||||
|         """Test nic detail  |  | ||||||
|         """ |  | ||||||
|         # Validate the following |  | ||||||
|         # Scale up the vm and see if it scales to the new svc offering and is finally in running state |  | ||||||
|        |  | ||||||
|         self.debug("Testing ADD nic detail Nic-ID: %s " % ( |  | ||||||
|                                         self.nic |  | ||||||
|                                         )) |  | ||||||
|          |  | ||||||
|         cmd = addNicDetail.addNicDetailCmd() |  | ||||||
|         cmd.name = self.nic |  | ||||||
|         cmd.value = self.nic |  | ||||||
|         cmd.id = self.nic |  | ||||||
|         self.apiclient.addNicDetail(cmd)   |  | ||||||
|          |  | ||||||
|         listNicDetailCmd = listNicDetails.listNicDetailsCmd() |  | ||||||
|         listNicDetailCmd.id = self.nic |  | ||||||
|         listNicDetailResponse = self.api_client.listVirtualMachines(listNicDetailCmd) |  | ||||||
| 
 |  | ||||||
|         self.assertNotEqual(len(listNicDetailResponse), 0, "Check if the list API \ |  | ||||||
|                             returns a non-empty response") |  | ||||||
| 
 |  | ||||||
|         nicdetail = listNicDetailResponse[0] |  | ||||||
| 
 |  | ||||||
|         #self.assertEqual(nicdetail.id, self.nic, "Check if the Nic returned is the same as the one we asked for") |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|         self.assertEqual(nicdetail.name, self.nic, "Check if Nic has right name") |  | ||||||
|          |  | ||||||
|         self.assertEqual(nicdetail.value, self.nic, "Check if Nic has right value") |  | ||||||
|          |  | ||||||
|         #updatenicdetail |  | ||||||
|         self.debug("Testing UPDATE nic detail Nic-ID: %s " % ( |  | ||||||
|                                         self.nic |  | ||||||
|                                         )) |  | ||||||
|         cmd = updateNicDetail.updateNicDetailCmd() |  | ||||||
|         cmd.name = self.nic |  | ||||||
|         cmd.value = self.disk_offering.id |  | ||||||
|         cmd.id = self.nic |  | ||||||
|         self.apiclient.addNicDetail(cmd)   |  | ||||||
|          |  | ||||||
|         listNicDetailCmd = listNicDetails.listNicDetailsCmd() |  | ||||||
|         listNicDetailCmd.id = self.nic |  | ||||||
|         listNicDetailResponse = self.api_client.listVirtualMachines(listNicDetailCmd) |  | ||||||
| 
 |  | ||||||
|         self.assertNotEqual(len(listNicDetailResponse), 0, "Check if the list API \ |  | ||||||
|                             returns a non-empty response") |  | ||||||
| 
 |  | ||||||
|         nicdetail = listNicDetailResponse[0] |  | ||||||
| 
 |  | ||||||
|         #self.assertEqual(nicdetail.id, self.nic, "Check if the Nic returned is the same as the one we asked for") |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|         self.assertEqual(nicdetail.name, self.nic, "Check if Nic has right name") |  | ||||||
|          |  | ||||||
|         self.assertEqual(nicdetail.value, self.disk_offering.id, "Check if Nic has right value") |  | ||||||
| 
 |  | ||||||
|          |  | ||||||
|         #remove detail |  | ||||||
|         self.debug("Testing REMOVE nic detail Nic-ID: %s " % ( |  | ||||||
|                                         self.nic |  | ||||||
|                                         )) |  | ||||||
|         cmd = removeNicDetail.removeNicDetailCmd() |  | ||||||
|         cmd.name = self.nic |  | ||||||
|         cmd.id = self.nic |  | ||||||
|         self.apiclient.removeNicDetail(cmd)   |  | ||||||
|          |  | ||||||
|         listNicDetailCmd = listNicDetails.listNicDetailsCmd() |  | ||||||
|         listNicDetailCmd.id = self.nic |  | ||||||
|         listNicDetailResponse = self.api_client.listVirtualMachines(listNicDetailCmd) |  | ||||||
| 
 |  | ||||||
|         self.assertEqual(listNicDetailResponse, None, "Check if the list API \ |  | ||||||
|                             returns a non-empty response") |  | ||||||
|          |  | ||||||
| 
 |  | ||||||
|         return |  | ||||||
| @ -1,239 +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. |  | ||||||
| """ P1 tests for Scaling up Vm |  | ||||||
| """ |  | ||||||
| #Import Local Modules |  | ||||||
| import marvin |  | ||||||
| from marvin.cloudstackTestCase import * |  | ||||||
| from marvin.cloudstackAPI import * |  | ||||||
| from marvin.remoteSSHClient import remoteSSHClient |  | ||||||
| from marvin.integration.lib.utils import * |  | ||||||
| from marvin.integration.lib.base import * |  | ||||||
| from marvin.integration.lib.common import * |  | ||||||
| from nose.plugins.attrib import attr |  | ||||||
| #Import System modules |  | ||||||
| import time |  | ||||||
| 
 |  | ||||||
| _multiprocess_shared_ = True |  | ||||||
| class Services: |  | ||||||
|     """Test VM Life Cycle Services |  | ||||||
|     """ |  | ||||||
| 
 |  | ||||||
|     def __init__(self): |  | ||||||
|         self.services = { |  | ||||||
| 
 |  | ||||||
|                 "account": { |  | ||||||
|                     "email": "test@test.com", |  | ||||||
|                     "firstname": "Test", |  | ||||||
|                     "lastname": "User", |  | ||||||
|                     "username": "test", |  | ||||||
|                     # Random characters are appended in create account to  |  | ||||||
|                     # ensure unique username generated each time |  | ||||||
|                     "password": "password", |  | ||||||
|                 }, |  | ||||||
|                 "small": |  | ||||||
|                 # Create a small virtual machine instance with disk offering  |  | ||||||
|                 { |  | ||||||
|                     "displayname": "testserver", |  | ||||||
|                     "username": "root", # VM creds for SSH |  | ||||||
|                     "password": "password", |  | ||||||
|                     "ssh_port": 22, |  | ||||||
|                     "hypervisor": 'XenServer', |  | ||||||
|                     "privateport": 22, |  | ||||||
|                     "publicport": 22, |  | ||||||
|                     "protocol": 'TCP', |  | ||||||
|                 }, |  | ||||||
|                 "disk_offering": { |  | ||||||
|                             "displaytext": "Small", |  | ||||||
|                             "name": "Small", |  | ||||||
|                             "storagetype": "shared", |  | ||||||
|                             "disksize": 1 |  | ||||||
|                 }, |  | ||||||
|                 "service_offerings": |  | ||||||
|                 { |  | ||||||
|                  "small": |  | ||||||
|                     { |  | ||||||
|                      # Small service offering ID to for change VM  |  | ||||||
|                      # service offering from medium to small |  | ||||||
|                         "name": "SmallInstance", |  | ||||||
|                         "displaytext": "SmallInstance", |  | ||||||
|                         "cpunumber": 1, |  | ||||||
|                         "cpuspeed": 100, |  | ||||||
|                         "memory": 256, |  | ||||||
|                     }, |  | ||||||
|                 "big": |  | ||||||
|                     { |  | ||||||
|                      # Big service offering ID to for change VM  |  | ||||||
|                         "name": "BigInstance", |  | ||||||
|                         "displaytext": "BigInstance", |  | ||||||
|                         "cpunumber": 1, |  | ||||||
|                         "cpuspeed": 100, |  | ||||||
|                         "memory": 512, |  | ||||||
|                     } |  | ||||||
|                 }, |  | ||||||
|                 #Change this |  | ||||||
|                 "template": { |  | ||||||
|                     "displaytext": "xs", |  | ||||||
|                     "name": "xs", |  | ||||||
|                     "passwordenabled": False, |  | ||||||
|                 }, |  | ||||||
|             "diskdevice": '/dev/xvdd', |  | ||||||
|             # Disk device where ISO is attached to instance |  | ||||||
|             "mount_dir": "/mnt/tmp", |  | ||||||
|             "sleep": 60, |  | ||||||
|             "timeout": 10, |  | ||||||
|             #Migrate VM to hostid |  | ||||||
|             "ostype": 'CentOS 5.6 (64-bit)', |  | ||||||
|             # CentOS 5.3 (64-bit) |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
| class TestVolumeDetail(cloudstackTestCase): |  | ||||||
| 
 |  | ||||||
|     @classmethod |  | ||||||
|     def setUpClass(cls): |  | ||||||
|         cls.api_client = super(TestVolumeDetail, cls).getClsTestClient().getApiClient() |  | ||||||
|         cls.services = Services().services |  | ||||||
| 
 |  | ||||||
|         # Get Zone, Domain and templates |  | ||||||
|         domain = get_domain(cls.api_client, cls.services) |  | ||||||
|         zone = get_zone(cls.api_client, cls.services) |  | ||||||
|         cls.services['mode'] = zone.networktype |  | ||||||
| 
 |  | ||||||
|         # Set Zones and disk offerings ?? |  | ||||||
| 
 |  | ||||||
|         # Create account, service offerings, vm. |  | ||||||
|         cls.account = Account.create( |  | ||||||
|                             cls.api_client, |  | ||||||
|                             cls.services["account"], |  | ||||||
|                             domainid=domain.id |  | ||||||
|                             ) |  | ||||||
| 
 |  | ||||||
|   |  | ||||||
|         cls.disk_offering = DiskOffering.create( |  | ||||||
|                                     cls.api_client, |  | ||||||
|                                     cls.services["disk_offering"] |  | ||||||
|                                     ) |  | ||||||
| 
 |  | ||||||
|         #create a volume |  | ||||||
|         cls.volume = Volume.create( |  | ||||||
|                                    cls.api_client, |  | ||||||
|                                    { "diskname" : "ndm"}, |  | ||||||
|                                    zoneid=zone.id, |  | ||||||
|                                    account=cls.account.name, |  | ||||||
|                                    domainid=cls.account.domainid, |  | ||||||
|                                    diskofferingid=cls.disk_offering.id |  | ||||||
|                                    ) |  | ||||||
|         #how does it work ?? |  | ||||||
|         cls._cleanup = [ |  | ||||||
|                         cls.volume, |  | ||||||
|                         cls.account |  | ||||||
|                         ] |  | ||||||
| 
 |  | ||||||
|     @classmethod |  | ||||||
|     def tearDownClass(cls): |  | ||||||
|         cls.api_client = super(TestVolumeDetail, cls).getClsTestClient().getApiClient() |  | ||||||
|         cleanup_resources(cls.api_client, cls._cleanup) |  | ||||||
|         return |  | ||||||
| 
 |  | ||||||
|     def setUp(self): |  | ||||||
|         self.apiclient = self.testClient.getApiClient() |  | ||||||
|         self.dbclient = self.testClient.getDbConnection() |  | ||||||
|         self.cleanup = [] |  | ||||||
| 
 |  | ||||||
|     def tearDown(self): |  | ||||||
|         #Clean up, terminate the created ISOs |  | ||||||
|         cleanup_resources(self.apiclient, self.cleanup) |  | ||||||
|         return |  | ||||||
| 
 |  | ||||||
|     @attr(tags = ["advanced", "xenserver"]) |  | ||||||
|     def test_01_updatevolumedetail(self): |  | ||||||
|         """Test volume detail  |  | ||||||
|         """ |  | ||||||
|         # Validate the following |  | ||||||
|         # Scale up the vm and see if it scales to the new svc offering and is finally in running state |  | ||||||
|        |  | ||||||
|         self.debug("Testing ADD volume detail Volume-ID: %s " % ( |  | ||||||
|                                         self.volume.id |  | ||||||
|                                         )) |  | ||||||
|          |  | ||||||
|         cmd = addVolumeDetail.addVolumeDetailCmd() |  | ||||||
|         cmd.name = self.volume.id |  | ||||||
|         cmd.value = self.volume.id |  | ||||||
|         cmd.id = self.volume.id |  | ||||||
|         self.apiclient.addVolumeDetail(cmd)   |  | ||||||
|          |  | ||||||
|         listVolumeDetailCmd = listVolumeDetails.listVolumeDetailsCmd() |  | ||||||
|         listVolumeDetailCmd.id = self.volume.id |  | ||||||
|         listVolumeDetailResponse = self.api_client.listVirtualMachines(listVolumeDetailCmd) |  | ||||||
| 
 |  | ||||||
|         self.assertNotEqual(len(listVolumeDetailResponse), 0, "Check if the list API \ |  | ||||||
|                             returns a non-empty response") |  | ||||||
| 
 |  | ||||||
|         volumedetail = listVolumeDetailResponse[0] |  | ||||||
| 
 |  | ||||||
|         #self.assertEqual(volumedetail.id, self.volume.id, "Check if the Volume returned is the same as the one we asked for") |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|         self.assertEqual(volumedetail.name, self.volume.id, "Check if Volume has right name") |  | ||||||
|          |  | ||||||
|         self.assertEqual(volumedetail.value, self.volume.id, "Check if Volume has right value") |  | ||||||
|          |  | ||||||
|         #updatevolumedetail |  | ||||||
|         self.debug("Testing UPDATE volume detail Volume-ID: %s " % ( |  | ||||||
|                                         self.volume.id |  | ||||||
|                                         )) |  | ||||||
|         cmd = updateVolumeDetail.updateVolumeDetailCmd() |  | ||||||
|         cmd.name = self.volume.id |  | ||||||
|         cmd.value = self.disk_offering.id |  | ||||||
|         cmd.id = self.volume.id |  | ||||||
|         self.apiclient.addVolumeDetail(cmd)   |  | ||||||
|          |  | ||||||
|         listVolumeDetailCmd = listVolumeDetails.listVolumeDetailsCmd() |  | ||||||
|         listVolumeDetailCmd.id = self.volume.id |  | ||||||
|         listVolumeDetailResponse = self.api_client.listVirtualMachines(listVolumeDetailCmd) |  | ||||||
| 
 |  | ||||||
|         self.assertNotEqual(len(listVolumeDetailResponse), 0, "Check if the list API \ |  | ||||||
|                             returns a non-empty response") |  | ||||||
| 
 |  | ||||||
|         volumedetail = listVolumeDetailResponse[0] |  | ||||||
| 
 |  | ||||||
|         #self.assertEqual(volumedetail.id, self.volume.id, "Check if the Volume returned is the same as the one we asked for") |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|         self.assertEqual(volumedetail.name, self.volume.id, "Check if Volume has right name") |  | ||||||
|          |  | ||||||
|         self.assertEqual(volumedetail.value, self.disk_offering.id, "Check if Volume has right value") |  | ||||||
| 
 |  | ||||||
|          |  | ||||||
|         #remove detail |  | ||||||
|         self.debug("Testing REMOVE volume detail Volume-ID: %s " % ( |  | ||||||
|                                         self.volume.id |  | ||||||
|                                         )) |  | ||||||
|         cmd = removeVolumeDetail.removeVolumeDetailCmd() |  | ||||||
|         cmd.name = self.volume.id |  | ||||||
|         cmd.id = self.volume.id |  | ||||||
|         self.apiclient.removeVolumeDetail(cmd)   |  | ||||||
|          |  | ||||||
|         listVolumeDetailCmd = listVolumeDetails.listVolumeDetailsCmd() |  | ||||||
|         listVolumeDetailCmd.id = self.volume.id |  | ||||||
|         listVolumeDetailResponse = self.api_client.listVirtualMachines(listVolumeDetailCmd) |  | ||||||
| 
 |  | ||||||
|         self.assertEqual(listVolumeDetailResponse, None, "Check if the list API \ |  | ||||||
|                             returns a non-empty response") |  | ||||||
|          |  | ||||||
| 
 |  | ||||||
|         return |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user