-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CLOUDSTACK-8636: Verify failure of creation of Custom disk offering with disksize parameter #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
pritisarap12
wants to merge
2
commits into
apache:master
from
pritisarap12:CLOUDSTACK-8636-Verify-failure-of-creation-of-Custom-disk-offering-with-disksize-parameter
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
test/integration/testpaths/testpath_custom_disk_offering.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # 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. | ||
| """ Test case for Create Custom DiskOffering with size Test Path | ||
| """ | ||
|
|
||
| from nose.plugins.attrib import attr | ||
| from marvin.cloudstackTestCase import cloudstackTestCase | ||
| from marvin.cloudstackAPI import (createDiskOffering, deleteDiskOffering) | ||
| from marvin.lib.utils import (cleanup_resources) | ||
| from marvin.lib.common import (get_domain, | ||
| get_zone, | ||
| ) | ||
|
|
||
|
|
||
| class TestCustomDiskOfferingWithSize(cloudstackTestCase): | ||
|
|
||
| @classmethod | ||
| def setUpClass(cls): | ||
| testClient = super( | ||
| TestCustomDiskOfferingWithSize, | ||
| cls).getClsTestClient() | ||
| cls.apiclient = testClient.getApiClient() | ||
| cls.testdata = testClient.getParsedTestDataConfig() | ||
| cls.hypervisor = cls.testClient.getHypervisorInfo() | ||
|
|
||
| # Get Zone, Domain and templates | ||
| cls.domain = get_domain(cls.apiclient) | ||
| cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) | ||
| cls._cleanup = [] | ||
|
|
||
| cls.tearDownClass() | ||
|
|
||
| return | ||
|
|
||
| @classmethod | ||
| def tearDownClass(cls): | ||
| try: | ||
| cleanup_resources(cls.apiclient, cls._cleanup) | ||
| except Exception as e: | ||
| raise Exception("Warning: Exception during cleanup : %s" % e) | ||
|
|
||
| def setUp(self): | ||
| self.apiclient = self.testClient.getApiClient() | ||
| self.dbclient = self.testClient.getDbConnection() | ||
| self.cleanup = [] | ||
|
|
||
| def tearDown(self): | ||
| try: | ||
| if hasattr(self, 'disk_offering'): | ||
| cmd = deleteDiskOffering.deleteDiskOfferingCmd() | ||
| cmd.id = self.disk_offering.id | ||
| self.apiclient.deleteDiskOffering(cmd) | ||
|
|
||
| cleanup_resources(self.apiclient, self.cleanup) | ||
| except Exception as e: | ||
| raise Exception("Warning: Exception during cleanup : %s" % e) | ||
| return | ||
|
|
||
| @attr(tags=["basic", "advanced"], required_hardware="false") | ||
| def test_create_custom_disk_offering_with_size(self): | ||
| """ Create custom disk offerign with size | ||
| 1. Create custom disk offering with size. | ||
| 2. Should not allow to create custom disk offering | ||
| with size mentioned.(Exception should be raised) | ||
| """ | ||
|
|
||
| with self.assertRaises(Exception): | ||
| cmd = createDiskOffering.createDiskOfferingCmd() | ||
| cmd.displaytext = "Custom Disk Offering" | ||
| cmd.name = "Custom Disk Offering" | ||
| cmd.customized = True | ||
| cmd.disksize = 2 | ||
| self.disk_offering = self.apiclient.createDiskOffering(cmd) | ||
|
|
||
| return | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to product bug, if custom disk offering is created with size we need to delete it as part of cleanup. Can you please handle this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the testcase as per review changes.